Repository navigation
[Config] [Perf] Add DeepSeek-V4.1-Flash TP4 A8W4 MoE rows for gfx950 (E385, top-7) - #6363
amd-pedghazi wants to merge 2 commits into
Conversation
🏷️ CI GuideRuns automatically on every PR:
Extended tests (opt-in via labels):
One backend per PR: PR title tags & labels: |
…h TP4 A8W4 MoE at M 16384 and add M 32768.
|
Closing this draft. The small-M rows gave no serving gain: SGLang prefills DeepSeek-V4.1-Flash in 16k-token chunks, which AITER pads to M 16384, so prefill never looks up the rows from M 64 to 8192, and in our serving tests the tuned small-M rows changed throughput by only +0.06 to +0.18%. The useful buckets are covered elsewhere: #8213 has the 16384 and 32768 rows (the same tile pair as here, with the XCD-remap stage 1), #8051 adds 4096, 8192 and 16384, and rows for 512 to 2048 tokens will come in a new PR with new measurements. |
Summary
Adds nine rows to
aiter/configs/model_configs/dsv41_fp8_tuned_fmoe.csv, and the same shapes to the untuned CSV, for DeepSeek-V4.1-Flash on gfx950 at TP4 with SGLang's fused shared expert. The key is model dimension 5120, padded intermediate dimension 640, 385 experts, top-7, FP8 activations and MXFP4 weights, at padded M 64, 256, 512, 1024, 2048, 4096, 8192, 16384 and 32768. The M 16384 and 32768 rows pair a stage-1 kernel with the stage-2 layout reduce kernel and were measured with the FP8 stage-2 route (AITER_FLYDSL_STAGE2_FP8=1). Draft: merge after #6170.Motivation
DeepSeek-V4.1-Flash on MI355X with 4 GPUs has no tuned MoE (mixture-of-experts) settings for its shape, so AITER falls back to guessed kernel settings. The rows for M 64-8192 make the MoE step take 0.89-0.98x of the time it takes today. Long prompts run every 16k prefill chunk in the M 16384 bucket, and the M 32768 row covers larger prefill batches. At M 16384 the first version of this PR did not help in serving, so its row is replaced by a kernel pair that lowers mean TTFT by 3-4% in serving.
No table has this key today, so every M bucket falls back to the heuristic tiles. Rows M 256, 512 and 4096-8192 reuse the kernel pairs from #6125, while M 64 and the pair shared by M 1024 and 2048 were tuned for this key, selected with the
fused_moecall SGLang makes for this model, with shared-expert routing and CUDA graphs. #6433 adds rows for the same key (including M 256), so the two sets should be merged into one PR with one row per M.Changes
aiter/configs/model_configs/dsv41_fp8_tuned_fmoe.csv: 9 rows (M 64, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768). M 16384 and 32768 useflydsl_moe1_afp8_wfp4_bf16_t64x128x256_w4_bnt0_guiwithflydsl_moe2_layout_afp8_wfp4_bf16_t64x256x128_reduce_sbm64.aiter/configs/model_configs/dsv41_fp8_untuned_fmoe.csv: the same 9 shapes.us1,us2,us,tflops,bw) repeat M=1024's (the kernel pair is shared on purpose); the M 16384 and 32768 rows leavetflopsandbwat 0. Theiruscolumns come from a one-GPU study with routing calibrated from a served expert histogram, so they are not comparable with the tuner timings of the other rows.Performance (if applicable)
fused_moeA8W4 for DeepSeek-V4.1-Flash TP4, M 768-8192fused_moestage 2 at M 16384, routing calibrated from a served expert histogramAITER_FLYDSL_STAGE2_FP8=1: 617 usAITER_FLYDSL_STAGE2_FP8=1in both arms, no speculative decoding / DSparkServing numbers are geomeans over the 7 concurrencies of single runs per arm, on a ROCm SGLang image of 2026-10-29 with #6170 applied. The first version's M 16384 row did not clear a 16k-prompt serving check (two A-B-B-A runs: +19.1% / +14.2%, then +4.1% within a 14.0% base spread), which is why it is replaced.
Testing
The M 64-8192 rows produced no NaN and had the same 0.032-0.035 worst-row relative-L2 range as the heuristic against a bf16-intermediate reference. The M 64, 256 and 512 rows hit an async stage-1 race without #6170 (1-10 bad runs out of 192), as do the heuristic's own stage-1 kernels (7/192 at M 12288, 5/192 at 16384); with #6170, every tested point from M 64 through 1024 gave 0/192. For the M 16384 and 32768 rows, AITER's
using 2stage (kernelName1=..., kernelName2=...)log line showed both kernels in every serving run. Accuracy with these rows and the FP8 route: GSM8K 97.11 -> 96.42 (no speculative decoding) and 97.26 -> 96.58 (DSpark), GPQA (3 runs, DSpark) mean 88.38 vs 88.89 (one question). The FP8 route itself costs about 0.5 GSM8K points (96.71 vs 97.17 over 4 runs each, rows in both arms). Only gfx950 is targeted, so MI250X and MI300X do not apply.Documentation
Tuned-config rows only.
Dependencies
Merge after #6170 (stage-1 race fix). The M 16384 and 32768 rows were measured on AITER with #6170 applied; our serving image, which also carries #7918, uses the
_xcd1variant of the same stage-1 kernel.Breaking Changes
None.
PR Self-Review
Reviewed revision
628a5fb57e724634f56ec9ab6571d2f97dd15c86Behavior and intent
The listed M buckets of this key use the tuned kernel pairs instead of the heuristic tiles; the M 16384 and 32768 buckets use the stage-2 layout reduce kernel, which writes FP8 route rows when
AITER_FLYDSL_STAGE2_FP8=1. Other keys are unchanged.Validation and unverified scope
Kernel timing, NaN and L2 checks on MI355X, and serving runs, as above. Not verified: the M 16384 and 32768 rows on current main (measured on an older AITER with #6170), the same rows without
AITER_FLYDSL_STAGE2_FP8=1, and the M=2048 timing columns.PR-specific question
There is no automated PR Self-Review comment on this PR yet.
Changed op tests
None.