You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Perf] Tune DeepSeek V4 fused MoE for C32/C64 decode
Enable 16-row FP8-activation/FP4-weight FlyDSL kernels for the gfx950 DeepSeek V4 7168/512/E385/top-k7 sparse-decode shape, selecting them only for the C32 and C64 production rows. Preserve the shuffled activation-scale buffer physical allocation by rounding descriptor bounds to 32 rows. This adds no serving environment knob, dependency, or public API.
The commit is based directly on AITER main 45ef6f3 with FlyDSL 0.2.4. C4, C16, and C128+ rows are unchanged. The unrelated mixed-MoE XCD remap fix is intentionally excluded because both selected BM16 kernels use XCD0.
Kernel efficiency was remeasured after rebasing. Both sides use the same main-based source, compiler, full production routes, live non-unit activation scales, and full-size weights; only the upstream-main BM32 versus proposed BM16 configuration rows differ. Per-stage HIP event timing excludes sorting and quantization and uses 200 warmups, 1,000 iterations, and three repeats.
At C32, stage 1 improves from 93.5605 to 54.3600 us (-41.90%), stage 2 from 48.6800 to 27.7200 us (-43.06%), and combined stages from 142.2405 to 82.0800 us (-42.29%, 1.73x). At C64, stage 1 improves from 161.8010 to 86.8410 us (-46.33%), stage 2 from 87.9210 to 42.5210 us (-51.64%), and combined stages from 249.7220 to 129.3620 us (-48.20%, 1.93x). Every per-stage repeat range is below 0.3%.
Repeated stage outputs are bitwise stable and explicit two-stage output is bitwise identical to fused output. Exact route replay is bitwise identical to the upstream-main BM32 row at C32 and to the safe BM32/XCD0 control at C64. The upstream C64 row uses an unsafe non-divisible XCD4 mapping, while the selected BM16 route uses XCD0.
Full GSM8K validation of the same BM16 implementation completed all 1,319 samples: strict match 1258/1319 (95.375%) and flexible extraction 1257/1319 (95.299%), both above the required 94% threshold. No new end-to-end performance claim is made after the AITER-version rebase because it would not be an apples-to-apples comparison.
AI assistance was used to implement, test, benchmark, and document this change.
Co-authored-by: OpenAI Codex <codex@openai.com>
Signed-off-by: Fangzhou Ai <fangzhouai@gmail.com>
0 commit comments