Repository navigation
[FlyDSL] [Perf] MiniMax-M3 MoE on gfx1250: fused route psum and tuned grouped A8W4 tiles - #6668
Conversation
🏷️ CI GuideRuns automatically on every PR:
Extended tests (opt-in via labels):
One backend per PR: PR title tags & labels: |
cbe6fce to
1f16642
Compare
Adds aiter/configs/model_configs/minimax_m3_gfx1250_tuned_grouped_fmoe.csv for MiniMax-M3 at TP4 (model_dim 6144, inter_dim 768, expert 129, topk 5), one row per padded token from 1 to 32768 except 1024, where no candidate beat the default tiles. Up to 512 tokens the rows use tile_m 16 or 32 with narrow N tiles; from 2048 both GEMMs use tile_m 128 with 256x256 tiles. Co-Authored-By: Claude Opus 5.5 <[email protected]>
TP calls with no compact layout, EP or stage-2 scatter and at most _FUSED_ROUTE_PSUM_MAX_NUMEL routes take the one-workgroup moe_route_psum_fused kernel in place of the route counter zero-fill, moe_route and moe_contiguous_psum_remap launches. The limit drops from 4096 to 2048 routes: the split launches catch up at about 2.5K on gfx1250. Adds decode-shaped cases to test_route_psum_fused and an M3 TP decode case to test_flydsl_grouped_gemm. Co-Authored-By: Claude Opus 5.5 <[email protected]>
1f16642 to
22471d2
Compare
… grouped A8W4 tiles (#6668) * Tune M3 grouped A8W4 MoE GEMM tiles on gfx1250 Adds aiter/configs/model_configs/minimax_m3_gfx1250_tuned_grouped_fmoe.csv for MiniMax-M3 at TP4 (model_dim 6144, inter_dim 768, expert 129, topk 5), one row per padded token from 1 to 32768 except 1024, where no candidate beat the default tiles. Up to 512 tokens the rows use tile_m 16 or 32 with narrow N tiles; from 2048 both GEMMs use tile_m 128 with 256x256 tiles. Co-Authored-By: Claude Opus 5.5 <[email protected]> * Use fused_route_psum_remap on the gfx1250 TP MoE path TP calls with no compact layout, EP or stage-2 scatter and at most _FUSED_ROUTE_PSUM_MAX_NUMEL routes take the one-workgroup moe_route_psum_fused kernel in place of the route counter zero-fill, moe_route and moe_contiguous_psum_remap launches. The limit drops from 4096 to 2048 routes: the split launches catch up at about 2.5K on gfx1250. Adds decode-shaped cases to test_route_psum_fused and an M3 TP decode case to test_flydsl_grouped_gemm. Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: lirui927 <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
No conflicts, but main changed code the deployment replay runs through: - #7020: the MXFP4 inline sort takes num_local_tokens and skips expert ids outside [0, E), as the sentinel ids of EP callers are. - #7067: the a16w4 stage-2 reduce mode in fused_moe.py and Kimi-K3's a16w4 table. - #7068, #6668: gfx1250 grouped tables for DeepSeek-V4.1 MegaMoE EP and MiniMax-M3. - #7055: the OPUS CO tests read local kernel IDs; this branch's 1-GPU CI shards failed on the global ones. Co-authored-by: Cursor <[email protected]>
… grouped A8W4 tiles (#6668) * Tune M3 grouped A8W4 MoE GEMM tiles on gfx1250 Adds aiter/configs/model_configs/minimax_m3_gfx1250_tuned_grouped_fmoe.csv for MiniMax-M3 at TP4 (model_dim 6144, inter_dim 768, expert 129, topk 5), one row per padded token from 1 to 32768 except 1024, where no candidate beat the default tiles. Up to 512 tokens the rows use tile_m 16 or 32 with narrow N tiles; from 2048 both GEMMs use tile_m 128 with 256x256 tiles. Co-Authored-By: Claude Opus 5.5 <[email protected]> * Use fused_route_psum_remap on the gfx1250 TP MoE path TP calls with no compact layout, EP or stage-2 scatter and at most _FUSED_ROUTE_PSUM_MAX_NUMEL routes take the one-workgroup moe_route_psum_fused kernel in place of the route counter zero-fill, moe_route and moe_contiguous_psum_remap launches. The limit drops from 4096 to 2048 routes: the split launches catch up at about 2.5K on gfx1250. Adds decode-shaped cases to test_route_psum_fused and an M3 TP decode case to test_flydsl_grouped_gemm. Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: lirui927 <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
No conflicts, but main changed code the deployment replay runs through: - #7020: the MXFP4 inline sort takes num_local_tokens and skips expert ids outside [0, E), as the sentinel ids of EP callers are. - #7067: the a16w4 stage-2 reduce mode in fused_moe.py and Kimi-K3's a16w4 table. - #7068, #6668: gfx1250 grouped tables for DeepSeek-V4.1 MegaMoE EP and MiniMax-M3. - #7055: the OPUS CO tests read local kernel IDs; this branch's 1-GPU CI shards failed on the global ones. Co-authored-by: Cursor <[email protected]>
Speeds up the MiniMax-M3 MoE layer on gfx1250 (MI455, TP4; per rank H=6144, I=768, E=129 with the shared expert, top_k=5, MXFP4).
Changes
aiter/configs/model_configs/minimax_m3_gfx1250_tuned_grouped_fmoe.csvadds a row for every padded token from 1 to 32768 except 1024; main has no grouped row for this shape, so every call ran the default 64x256x256 tile. At 1024 no candidate beat the default.aiter/ops/flydsl/grouped_moe_gfx1250.py, TP calls with no compact layout, EP or stage-2 scatter call the existingfused_route_psum_remap, one launch in place of the counter zero-fill,moe_routeandmoe_contiguous_psum_remap, whenT * top_k <= _FUSED_ROUTE_PSUM_MAX_NUMELandE <= 512. The limit counts routes, not tokens, so it holds for any top_k; for M3 (top_k=5) it means T <= 409. The limit, unused on main, drops from 4096 to 2048 routes: past about 2.5K the one-workgroup kernel is slower than the split launches.Results
fused_moeus/layer, main 567ff81 vs this branch, one GPU, CUDA graph, 8 weight copies so weights are not L2-resident. "Tune only" is the branch with the fused route off.Tuned tiles (main vs tune only)
Fused route (tune only vs branch)
Outputs are bitwise identical to main at every T measured.
Testing
On gfx1250:
test_config_shape_collision.py27 passed;test_flydsl_grouped_gemm.py -k m3_tp_decode2 passed;test_flydsl_moe_aux.pyall route rows err 0;test_moe_ep.py -t g1u1_a8w4_mxfp4 g1u1_a4w4_mxfp4logits_diff 0.001066 and 0.000025, equal to main.End-to-end
MiniMax-M3-MXFP4 on 4 x MI455, TP4, BF16 KV cache, 8K/1K at concurrency 4, base and branch servers alternating on one node: TPOT 10.66 to 10.04 ms (-5.8%), output 347.6 to 368.5 tok/s (+6.0%), TTFT unchanged. GSM8K 5-shot: 0.9356 to 0.9386 (flexible).