Repository navigation
Conversation
There was a problem hiding this comment.
Copilot review overview
🔵 Needs a closer look
The GPU correctness and performance claims cannot be confirmed by the dispatch-only test or the available environment.
Review effort: Balanced
Findings: None
What changed in this PR
Adds tuned gfx950 dispatch configurations for GLM-5 MXFP4 EP4 decoding, selecting fused FP4 stage-1 kernels.
Changes:
- Adds tuned and untuned rows for 8–64 token tiers.
- Adds dispatch tests covering kernel selection and FP4 quantization metadata.
| File | Description |
|---|---|
op_tests/test_moe_glm5_fp4_ep_dispatch.py |
Verifies tier mapping and selected kernels. |
aiter/configs/model_configs/glm5_fp4_untuned_fmoe.csv |
Registers GLM-5 EP4 tuning shapes. |
aiter/configs/model_configs/glm5_fp4_tuned_fmoe.csv |
Adds measured gfx950 kernel selections. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
🏷️ CI GuideRuns automatically on every PR:
Extended tests (opt-in via labels):
One backend per PR: PR title tags & labels: |
Tuned rows for (model_dim 4096, inter_dim 2048, expert 289, topk 9) at
QuantType.per_1x32 -- GLM-5.3-Flash served at TP1 with shared-experts fusion on,
so the shared expert is folded into the routed MoE as E=289/topk=9. Tokens
32/64/128 cover the decode range (batch x 4 draft tokens, padded by
get_padded_M to the next power of two) and 16384 is the prefill chunk.
Produced by csrc/ck_gemm_moe_2stages_codegen/gemm_moe_tune.py --mp 8
--shape_grouped (1472 candidates, all four shapes tuned, no failures).
The rows select the _fp4 stage-1 variants, which fold the fp4 quant+sort into
the GEMM (gemm_moe_tune.py:5497). Without a tuned row the heuristic fallback in
aiter/ops/flydsl/moe_kernels.py branches on inter_dim % 256 alone and picks the
UNFUSED t32x128x256_w2, so the quant+sort runs as two extra launches per MoE
layer.
Measured back to back with --run_config on an idle 8x MI355X node, both arms
confirmed from the dispatch log to run the kernels intended, E2E us:
token heuristic tuned+_fp4 delta
32 434.67 402.50 -7.4%
64 578.49 526.76 -8.9%
128 657.63 596.13 -9.4%
16384 3661.80 2902.26 -20.7%
Note for anyone repeating this: --mxfp4-flydsl is the WRONG mode here. It tunes
the MXMOE port (flydsl_mxmoe_g1_a4w4_*), whose rows this model cannot use at all
-- the runtime discards them with 'MXMOE cannot apply swiglu_limit=10.0 to
activation silu', GLM-5.3-Flash being clamped SiLU. The plain FmoeTuner tunes
the flydsl_moe1/2_afp4_wfp4_bf16_* family we actually execute, which is also
what upstream's GLM-5 rows (ROCm#5986) select.
Co-Authored-By: Claude Opus 5 <[email protected]>
GLM-5.3 Quark MXFP4 TP4/EP4 decode has no tuned fused-MoE row for the gfx950/256-CU per-rank shape
(model_dim=6144, inter_dim=2048, E=65, topk=8), with SiLU, BF16 output, and per-1x32 MXFP4 activations and weights. The heuristic stage-1 kernel writes BF16 and requires another activation quantization and sort before stage 2.Add tuned and untuned rows for padded token tiers 8/16/32/64, covering runtime M=5–64, plus dispatch tests for the FP4 stage-1 epilogue, stage-2 kernel,
fuse_quant=fp4, andblock_m=32. Other architectures, CU counts, M<=4, and M>64 keep their existing dispatch. Host validation covered 42 tests and 45 subtests.On MI355X, a HIP-graph comparison against the stock heuristic path saved 4.3–6.0 us per layer at M=12/24/36. Environment: ROCm 10.0, SGLang
abef3efb64, AITER baseacf8fdf930, TP4/EP4.