Repository navigation
[FlyDSL] [Bugfix] gfx1250 grouped MoE: read integer config cells that the merge writes as floats - #6360
[FlyDSL] [Bugfix] gfx1250 grouped MoE: read integer config cells that the merge writes as floats#6360jhinpan wants to merge 5 commits into
Conversation
🏷️ CI GuideRuns automatically on every PR:
Extended tests (opt-in via labels):
One backend per PR: PR title tags & labels: |
|
The pandas-generated Please parse integral decimal syntax exactly (for example, with |
…floats Since #6090 added a grouped MoE config under model_configs/, the default AITER_CONFIG_GROUPED_FMOE resolves to a file that update_config_files merges with pandas. pandas writes the integers of a column that has a blank cell as floats ("16.0"). Every row of the merged file has such a cell in a column that grouped_moe_gfx1250 reads with _as_int, which calls int(), so fused_moe on gfx1250 raises ValueError when it finds a row. The same merge writes ep_fused = 1 as "1.0", so EP lookups never match their rows. Read integral float cells as integers in _as_int (runtime and AOT) and in the lookup's key comparison. Non-integral values still raise. Signed-off-by: Jin Pan <[email protected]>
dtypes.fp8 is torch.float8_e4m3fnuz on gfx942, so on the MI300X runner the lookup key did not match the synthetic rows (written as torch.float8_e4m3fn) and the test got no row. Pass the dtypes the rows name and write the rows from the same objects. Signed-off-by: Jin Pan <[email protected]>
e194103 to
9909b8d
Compare
|
@zufayu Done in 9909b8d. Both The branch is also rebased on main. #6425 had changed the runtime |
|
No activity for 15 days, so this is now labelled |
…arser main removed aiter/aot/flydsl/grouped_moe.py (#6362), so importing its parser made both tests skip. The AOT build now replays the runtime lookup, so the tests check grouped_moe_gfx1250._as_int alone.
READY FOR HUMAN REVIEWPR Self-ReviewRevision Author self-review accepted. Readiness report: Author answers
Show the author's self-review answersBehavior and intentValidation and unverified scopePR-specific questionChanged op testsPR state
Copilot findings
Code and op-test hygiene
Required CI
Shadow mode reports what would block but keeps the status successful. Set |
|
@coderfeli @zufayu Please review this PR. The last reviewer comment was on Oct 12. |
Since #6090 added
model_configs/qwen3_5_397b_tuned_grouped_fmoe.csv, the defaultAITER_CONFIG_GROUPED_FMOEresolves to a file thatupdate_config_filesmerges with pandas. pandas writes the integers of a column that has a blank cell as floats:16becomes16.0, andep_fused = 1becomes1.0.On main at 0f6cb2f,
grouped_moe_gfx1250reads those cells throughfloat():_as_intsince #6425, and the lookup's key comparison (_cellin_find_grouped_config) since #6557. That accepts the integral floats, but it also rounds through a binary float:9007199254740993.0becomes 9007199254740992, and1.0000000000000001is read as 1.This PR reads integer cells as exact text in both places.
_integral_textdrops only an all-zero fraction, and_as_intraises on anything else. This also covers #6557's"1.0"/"0.0"flag case, so that special case is gone. The first version of this PR also fixed the AOT parser inaiter/aot/flydsl/grouped_moe.py; #6362 removed that file, and the AOT build now replays the runtime lookup.op_tests/tuning_tests/test_config_shape_collision.pygets three tests:test_grouped_int_cells_parse_exactly:16.0reads as 16,9007199254740993.0as 9007199254740993, and1.0000000000000001raises. It fails on main (9007199254740992 != 9007199254740993).test_grouped_fmoe_merged_cells_parse: every integer cell of the real merged grouped config parses.test_grouped_fmoe_merged_ep_row_matches: anep_fusedrow still wins its EP lookup after the merge writes it as1.0.The last two also pass on main; they keep the merged-config cases covered.
@zufayu, could you help review this?
PR Self-Review
Reviewed revision
50d31f5
Behavior and intent
grouped_moe_gfx1250reads integer config cells as exact text._as_intand the lookup's key comparison drop only an all-zero fraction (16.0reads as 16,1.0matches1) and reject any other fraction, instead of parsing through a binary float. On main,float()rounds integers above 2^53 and accepts near-integers such as1.0000000000000001, so a mistyped or corrupted cell is read as a different integer without an error.Validation and unverified scope
CU_NUM=256,python3 -m pytest op_tests/tuning_tests/test_config_shape_collision.py: the 3 tests of this PR passed at this revision. With the same tests on main 0f6cb2f,test_grouped_int_cells_parse_exactlyfailed (9007199254740992 != 9007199254740993), and the other two passed.test_config_shape_collision,test_csv_validation,test_grouped_ep_fused_lookupandtest_grouped_gemm_launch_abiotherwise gave the same results as on main; the same 9 cases failed on both because they need a GPU.fused_moeon gfx1250 with the merged default config.PR-specific question
No config file changes. The parser change affects every gfx1250 grouped MoE row lookup (
_find_grouped_config) and every integer cell that_as_intreads. For well-formed cells (integers, and integers written as floats with an all-zero fraction), the result is the same as on main. Only cells that main rounds or accepts throughfloat()now raise.test_grouped_fmoe_merged_cells_parsechecks that every integer cell of the merged default config still parses (13,900 subtests), andtest_grouped_fmoe_merged_ep_row_matcheschecks that anep_fusedrow still wins its lookup.Changed op tests
op_tests/tuning_tests/test_config_shape_collision.py: three tests.test_grouped_int_cells_parse_exactlyfails on main because of the float rounding and passes here; no other test checks that_as_intkeeps every digit.test_grouped_fmoe_merged_cells_parseandtest_grouped_fmoe_merged_ep_row_matchesread the real pandas-merged config, which no other test parses with the grouped reader; they keep the integral-float andep_fused = "1.0"cases from regressing.