Repository navigation
[Config] [DSV4.1Flash] Fuse the moe stage-2 input quant into the stage-1 epilogue - #6611
Conversation
aiter already has stage-1 FlyDSL variants whose epilogue quantizes the SiLU result to mxfp8 and writes it in the sorted layout stage 2 reads, selected by a "_fp8" suffix on kernelName1: fused_moe_2stages then sets fuse_quant="fp8", takes (a2, a2_scale) straight from stage 1 and skips the separate stage-2 input quant entirely. The DSv4.1-Flash a8w4 shape has no tuned row, so it fell back to the heuristic, which picks the bf16-output twin of that same kernel and pays for a standalone quant pass. Both rows pin the same tile the heuristic already chose (t64x128x256_w4_bnt0_gui) and the same stage-2 kernel, so the only difference is where the quantization happens. token=32768 is the only key the routed MoE resolves to under DP8/EP8, since get_padded_M() keys off the padded MoRI receive buffer rather than the live token count; expert=48/topk=6 is the routed MoE and expert=16/topk=3 the DSpark draft MoE. Measured standalone on gfx950 at the DSv4.1-Flash shape (5120/2304/48 experts/ topk 6), fused vs the heuristic bf16 stage 1: 1.18x at 256 tokens, 1.37x at 512, 1.59x at 1024, 1.09x at 4096 and 8192. The epilogue quantizes from the fp32 accumulator instead of round-tripping through bf16, so stage-2 input differs slightly from the separate-quant path (1.7e-2 mean relative, and if anything closer to the reference). Co-authored-by: Cursor <[email protected]>
🏷️ CI GuideRuns automatically on every PR:
Extended tests (opt-in via labels):
One backend per PR: PR title tags & labels: |
Motivation
aiter already has stage-1 FlyDSL variants whose epilogue quantizes the SiLU
result to mxfp8 and writes it in the sorted layout stage 2 reads. They are
selected by a
_fp8suffix onkernelName1:fused_moe_2stagesthen setsfuse_quant="fp8", takes(a2, a2_scale)straight from stage 1, and skips theseparate stage-2 input quant entirely.
The DeepSeek-V4.1-Flash a8w4 shape has no tuned row, so it fell back to the
heuristic. The heuristic picks the bf16-output twin of that same kernel, which
means the model pays for a standalone stage-2 quant pass that the hardware never
needed to run.
Summary of changes
Adds
aiter/configs/model_configs/dsv41_fp8fp4_tuned_fmoe.csvwith two rows.Both rows pin the same tile the heuristic already chose
(
t64x128x256_w4_bnt0_gui) and the same stage-2 kernel, so the only differenceis where the quantization happens — no tile or kernel family changes.
token=32768is the only key the routed MoE resolves to under DP8/EP8, sinceget_padded_M()keys off the padded MoRI receive buffer rather than the livetoken count.
expert=48, topk=6is the routed MoE (384 experts / 8 ranks).expert=16, topk=3is the DSpark draft MoE (128 experts / 8 ranks).No collision with the existing
dsv41_fp8_tuned_fmoe.csv, which coversexpert=96, topk=6(EP4). Merging allmodel_configs/*tuned_fmoe*.csvproduceszero duplicate shape keys.
Results
Measured standalone on gfx950 at the DeepSeek-V4.1-Flash shape (5120 / 2304 /
48 experts / topk 6), fused vs the heuristic bf16 stage 1: 1.18x at 256
tokens, 1.37x at 512, 1.59x at 1024, 1.09x at 4096 and 8192. The epilogue
quantizes from registers rather than re-reading the stage-1 output from HBM.
End to end: 8x MI355X (gfx950), DP8/EP8 with
mori_high_throughput,speculative decoding off, 8192 in / 1024 out, 256 prompts at concurrency 64,
against a stock vLLM nightly (
0.32.0rc1.dev190+g3f1bcfd82)Performance
Accuracy
gsm8k, 5-shot, all 1319 questions, strict-match.
Within ~1.5 sigma of baseline. The fused epilogue and the standalone quant pass
produce the same mxfp8 values; only the memory traffic differs.
Reproduction
Server:
Benchmark:
Accuracy: