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.
Historical serving measurements used AITER release/v0.1.16.post4 plus the preceding XCD correctness change, FlyDSL 0.2.2, and vLLM 0aa67bb9b on eight gfx950 GPUs with DeepSeek-V4-Pro TP8, shared-expert fusion, FP8 KV cache, and a random 8K-input/1K-output workload. C32 output throughput improved from 754.678 to 816.933 tok/s (+8.249%), mean TPOT from 40.0946 to 36.8640 ms (-8.057%), and p99 TPOT from 46.6609 to 43.2632 ms (-7.282%). C64 output throughput improved from 988.157 to 1074.459 tok/s (+8.734%), mean TPOT from 61.578 to 56.418 ms (-8.380%), and p99 TPOT from 72.778 to 67.272 ms (-7.566%). All 320 and 640 requests completed. These are post4 results, not an A/B claim against current main; C64 was the accepted-row selection run rather than a rerun of the combined final configuration.
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.
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