Skip to content

[JIT] Replay biased interleaved MoE callers again and fix #6362's CI failures - #6700

Merged
zhiding512 merged 3 commits into
zhiding512/flydsl-aot-moe-dryrun-20261009from
zhiding512/flydsl-aot-moe-dryrun-fix-20261020
Oct 21, 2026
Merged

zhiding512 merged 3 commits into
zhiding512/flydsl-aot-moe-dryrun-20261009from
zhiding512/flydsl-aot-moe-dryrun-fix-20261020

Conversation

@zhiding512

@zhiding512 zhiding512 commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Fixes for #6362, to merge into its branch (zhiding512/flydsl-aot-moe-dryrun-20261009). Its head 2f85842 fails Aiter Test run 39349922515 on MI35X shard 7 and MI300X shard 5; these three commits fix both and a latent dedup bug in the config merge.

Changes

  • Replay interleaved MoE callers with expert bias again (aiter/aot/flydsl/moe.py, README). 2f85842 dropped every gate_mode=interleave x bias variant to keep CK-Tile's interleaved split-k epilogue out of the replay, but after the same commit limits bias to Swiglu + MXFP4 rows, no parsed row reaches that epilogue: the only Swiglu MXFP4 rows with a cktile_ stage 1 are the 14 gptoss_fp8fp4 rows tagged flydsl_fallback, which parse_csv skips. The filter instead dropped GPT-OSS a8w4's serving path on gfx950 (interleaved weights with expert bias) and every biased gfx1250 caller, so op_tests/test_moe_2stage.py hit FLYDSL_RUNTIME_RUN_ONLY=1 but no usable AOT cache for launch_mixed_moe_gemm1 (MI35X shard 7). test_moe_aot_replays_swiglu_bias_with_interleaved_weights pins interleave x {none, both, stage1} for gptoss_fp8fp4 and the gfx1250 grouped table.
  • Pin gfx950's fp8 alias in the FHMoE caller-choice replay test (op_tests/test_fhmoe.py). The pytest process imports aiter for its host, so on gfx942 dtypes.fp8 is float8_e4m3fnuz and _caller_inputs finds no recipe for the HY4 float8_e4m3fn row; both cases of test_fhmoe_aot_replay_forwards_caller_choices failed on MI300X shard 5. The test now pins the alias as _mock_gfx950_fhmoe_metadata does.
  • Pick the fastest duplicate on a numeric us (aiter/jit/core.py). With tables read as text, one written us of nan on any row kept the whole column textual in comparable, so the lowest-us pick became a text sort ("10.5" before "9.5"): the slower duplicate was kept and the faster row deleted from its source table (main keeps 9.5). us is now coerced on its own. Three tests in op_tests/tuning_tests/test_config_shape_collision.py cover this and the two behaviours the text merge exists for: integer cells of a column with a blank stay integers, and 256 and 256.0 stay one shape.

Testing

All on one 256-CPU MI355X host, FlyDSL 0.4.0, against 2f85842 ("before") and this branch ("after"):

Check Before After
Full MoE replay, gfx942 + gfx950 + gfx1250 9116 jobs, 0 failed 9440 jobs, 0 failed; --check passes
AOT artifacts (.pkl) 2156 2191; 35 added, none removed (gfx950: 11 launch_mixed_moe_gemm1 + 18 launch_gemm2; gfx1250: 4 launch_gemm_a8w4_tdm + 2 launch_fused)
op_tests/test_moe_2stage.py --no-legacy on the gptoss_fp8fp4 table, run-only against a cache built from that table no usable AOT cache for launch_mixed_moe_gemm1 (manager_key cd1531ae…, as on CI) 8 of 8 cases pass, logits_diff ~1.5e-5
op_tests/test_fhmoe.py -k aot with the runtime pinned to gfx942 (dtypes.fp8 fnuz) both caller-choice cases fail 7 passed, 1 skipped (gfx950-only); 8 passed on gfx950
op_tests/tuning_tests/test_config_shape_collision.py new nan case fails (keeps 10.5) 29 passed

The 104 extra [SKIP]s on gfx950 (153 vs 49) are MiniMax-M3 a4w4 interleave x bias combinations at inter_dim 384, which the runtime refuses for want of a safe MXFP4 backend, as it already does for their other variants; they compile nothing. black and ruff 0.16.0 are clean.

zhiding512 and others added 3 commits October 20, 2026 06:41
2f85842 dropped every gate_mode=interleave x bias variant from the
replay to keep CK-Tile's interleaved split-k epilogue, which cannot
apply a bias, out of it. The same commit limits bias to Swiglu + MXFP4
rows, and since then no row the replay parses reaches that epilogue:
the only Swiglu MXFP4 rows with a cktile_ stage 1 are the 14
gptoss_fp8fp4 rows tagged flydsl_fallback, which parse_csv skips.

What the filter did drop is the path GPT-OSS a8w4 serves on gfx950
(gate/up-interleaved weights with expert bias), and every biased
gfx1250 caller, which takes only the interleaved layout. The runtime
serves all of those jobs and requests kernels the cache then lacked:
CI's MI35X shard failed op_tests/test_moe_2stage.py on the
gptoss_fp8fp4 rows with "no usable AOT cache for
launch_mixed_moe_gemm1".

A full replay of every arch now has 9440 jobs (324 more) and no
failure, and its cache gains 31 kernel directories and loses none. The
extra [SKIP]s are MiniMax-M3 a4w4 interleave x bias combinations at
inter_dim 384, which the runtime refuses for want of a safe MXFP4
backend, as it already does for their other variants.

Signed-off-by: zhimding <[email protected]>
Co-authored-by: Cursor <[email protected]>
A replay process imports aiter for the arch it replays, so its
dtypes.fp8 matches the table's fp8 flavour. The pytest process imports
aiter for its host instead: on gfx942 dtypes.fp8 is float8_e4m3fnuz,
_caller_inputs finds no recipe for the HY4 float8_e4m3fn row, and both
cases of test_fhmoe_aot_replay_forwards_caller_choices failed on CI's
MI300X shard. Pin the alias as _mock_gfx950_fhmoe_metadata does.

Signed-off-by: zhimding <[email protected]>
Co-authored-by: Cursor <[email protected]>
Reading tuned tables as text keeps every cell as written, but
_raise_on_duplicate_shapes still sorted on `comparable`, where a column
with one unparseable written cell stays text. One us written as nan, on
any row, made the lowest-us pick a text sort: "10.5" sorts before
"9.5", so the slower duplicate was kept and the faster row deleted from
its source table, where main, parsing nan as NaN, keeps 9.5. Coerce us
on its own.

op_tests/tuning_tests/test_config_shape_collision.py also pins the two
behaviours the text merge exists for: integer cells of a column with a
blank stay integers in the merged table, and 256 and 256.0 stay one
shape.

Signed-off-by: zhimding <[email protected]>
Co-authored-by: Cursor <[email protected]>
@zhiding512
zhiding512 merged commit 3563493 into zhiding512/flydsl-aot-moe-dryrun-20261009 Oct 21, 2026
@zhiding512
zhiding512 deleted the zhiding512/flydsl-aot-moe-dryrun-fix-20261020 branch October 21, 2026 01:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants