Repository navigation
[HIP] [GLM-5.3-Flash] MXFP4 fused-MoE tuned configs for MI355X - #6435
Conversation
🏷️ CI GuideRuns automatically on every PR:
Extended tests (opt-in via labels):
One backend per PR: PR title tags & labels: |
There was a problem hiding this comment.
🟢 Approval recommended
The configuration table is structurally valid and the runtime and generated-kernel shape lists remain synchronized.
0 open findings
What changed in this PR
Adds MI355X tuning coverage for GLM-5.3-Flash MXFP4 fused MoE.
Changes:
- Adds 153 tuned FlyDSL configurations.
- Enables six no-EP auxiliary-kernel shapes.
- Synchronizes runtime and code-generation shape allow-lists.
| File | Description |
|---|---|
gen_instances.py |
Generates auxiliary kernels for new shapes. |
moe_mxfp4_aux.py |
Enables runtime dispatch for those shapes. |
glm53flash_fp4_tuned_fmoe.csv |
Adds MI355X tuned configurations. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
damien-lejeune
left a comment
There was a problem hiding this comment.
I've reviewed the changes and could not find anything to improve, given the scope provided in the description.
04d00b0 to
9720556
Compare
They were extended to TP1 from the TP2/4/8 expert-parallel layouts without a run, and vLLM never requests that shape: at TP1 it does not fuse the shared expert.
08afe85 to
99a3cc0
Compare
|
Thanks for the GLM-5.3-Flash tuning. Before I can sign off on the performance change, please attach the complete In particular, please show how many rows were admitted as |
One row per layout. Without them, batches above 8192 tokens (16K prefill chunks) fell back to the heuristic FlyDSL kernels. Tuned on this head with --compare --update_improved --min_improvement_pct 2; every row beat the heuristic through fused_moe by 7.6% to 37.3%.
@Raiden-Makoto Added token=16384 rows for all 10 layouts in d1c93c7. On your four shapes, ours and yours are within 1% (same GPUs, 4 runs each, swapped), so I kept one tuning run for all of them. |
@zufayu Raw data is in this gist: https://gist.github.com/amd-sriram/28e8cb47589db3f95fb916c0734a29dc How the 139 rows were admitted
Every tuner log ends with Re-check on 99a3cc0 The tuning was on an older AITER, so I re-ran all 139 shapes on this head with
Per-shape numbers are in End to end (vLLM, GLM-5.3-Flash MXFP4)
GSM8K is 5-shot on the full set; all three changes are within one standard error. Serve, bench and eval commands, bench JSONs and eval logs are in the gist. I also added token=16384 rows in d1c93c7, tuned on this head; their compare reports are in the gist too. |
Resolve the MXFP4 MoE aux shape list conflicts in aiter/ops/moe_mxfp4_aux.py and csrc/kernels/mxfp4_moe/moe_aux/codegen/gen_instances.py by keeping the union: main's Qwen3.8 TP=8 (513, 8192, 256, 11) from #6468 and the GLM-5.3-Flash TP=2/4/8 shapes from #6435, plus this PR's Qwen3.8-Flash-Next TP=1 (513, 2560, 768, 11). Co-authored-by: Cursor <[email protected]>
… MI355X AITER has tuned fused-MoE configs for the GLM-5.3-Flash fused shared-expert shape (289 experts, top-k 9) at the TP2 per-rank intermediate size 1024: block FP8 in ROCm/aiter#6077 and MXFP4 in ROCm/aiter#6435. Add TP2 to the gate's TP set, so VLLM_ROCM_USE_AITER_FUSION_SHARED_EXPERTS applies at TP2 too; TP1 stays refused. Signed-off-by: Sriram Kumar <[email protected]>
…hem in test_moe_ep A caller behind an expert-parallel dispatch passes fused_moe an expert mask, and the launches it masks compile for the mask's length: the gfx950 masked stage-2 reduction and route-guarded GEMM2, the gfx1250 g2l route and bf16 gather-reduce. No tuned row records that length, so the AOT build never compiled them and EP serving JIT-compiled them on the request path. aiter/aot/flydsl/moe_ep_profiles.csv lists EP callers as what one rank passes fused_moe: local experts, routing columns, expert-mask length, largest M. moe.py replays each profile with the mask at both ends of every get_padded_M bucket up to that M (bisecting between them as for rows), with and without num_local_tokens, against the tuned tables serving reads, so a profile needs no tuned row. --ep-profile selects profile tables; without --csv and --ep-profile both defaults are replayed, and run_aot replays both. The default table covers gfx950 Kimi-K3 EP8, DeepSeek-V4-Pro EP8 (EPLB r0, r32, r64) and EP16, GLM-5.3-Flash EP8/EP4/EP2, and gfx1250 Kimi-K3 EP8/EP16 and DeepSeek-V4-Pro EP4, from the EP rows tuned in #5804, #6928, #6435, op_tests/test_moe_ep.py -t aot_ep_profiles, first in the defaults, runs every profile of the GPU's arch through the EP fused_moe call in FlyDSL run-only mode and requires logits_diff < 0.01. The MXFP4 cases now pin quant_dtype_a instead of setting env switches, accept SiTUv2, and compare against a stage-wise reference that quantizes a4w4 activations as the kernels do. Co-authored-by: Cursor <[email protected]>
Purpose
GLM-5.3-Flash MXFP4 on MI355X had no tuned fused-MoE config: every lookup fell back to the FlyDSL heuristic (
no tuned FlyDSL config).model_configs/glm53flash_fp4_tuned_fmoe.csv: 149 rows, tokens 1 to 16384.flydsl_moe1+flydsl_moe2_layout): experts 73/145/37 with topk 10 (fused shared expert, TP4/TP2/TP8) and 72 with topk 8 (TP4 unfused).flydsl_mxmoe_g1+flydsl_moe2_layout): 288/289 experts, inter_dim 1024/512/256 (TP2/TP4/TP8).MXFP4_MOE_SUPPORTED_SHAPESandgen_instances.py::SHAPES; without them the port rows are discarded (generated MXFP4 auxiliary kernels do not cover ...).Port rows are not added for the EP layouts: they are refused under expert parallelism (
the MXMOE output_aux sort drops expert_mask).Test Result
Tuned with
gemm_moe_tune.py --compare --update_improved --min_improvement_pct 2on 8x MI355X; every row improved the productionfused_moeop by at least 2% over the heuristic. The token=16384 rows were tuned the same way on the current head.End-to-end, vLLM serving
amd/GLM-5.3-Flash-Quark-MXFP4, 8k/1k and 60k/600 at concurrency 4 to 64, GSM8K 5-shot full set: