Repository navigation
[Config] [DSv4] DeepSeek-V4 EP8 a8w4 MXFP4 fused-MoE rows for gfx950 - #5821
Conversation
🏷️ CI GuideRuns automatically on every PR:
Extended tests (opt-in via labels):
PR title tags & labels: |
|
let's consider other ways |
Under --ep-size 8 with shared-expert fusion aiter resolves expert=49 (48 local routed experts plus this rank's fused shared expert), a shape the shipped DSv4 table carries no rows for, so it falls back to the heuristic. Serving deployments have been supplying these six rows out-of-band; carrying them here lets the tuning travel with aiter. Measured on MI355X at 8k/1k, concurrency 128, TP8/DP8/EP8 with DSpark, against the same table with these rows removed: +2.25% output token throughput and -2.55% mean TPOT. Co-authored-by: Cursor <[email protected]>
8f3c1d6 to
344d4d9
Compare
@valarLip i checked how much the prefill tokens overlap with decode and i think its a very small % of the time this happens in the agent-x runs (for smaller chunks), but for most of the time when we run at chunk-size 8192 prefill should not look up the solutions that we add for decode and shouldnt require separate tuning tables. I have now removed the logic we had previously to allow for separate prefill and decode tuning tables. This is the A/B testing at fixed length (8k1k, conc-128) which still shows the gains:
|
|
Since the regime approach was intentionally removed after the earlier review, please validate the replacement as a default-table tune. These rows are merged for both prefill and decode; for example, prefill with The referenced #5500/#5953 established a stronger bar: compare every bucket against the current default, reproduce the result across two runs, keep only stable improvements, and drop marginal or regressing rows. Here the six rows contain only tuned Please provide per-bucket default-vs-tuned correctness and latency for both decode-like and prefill-like routing, keep only consistently positive rows, add an exact lookup/correctness test, and update the stale PR description and linked SGLang contract. Please also rebase and run the SGLang downstream CI. |
|
No activity for 15 days, so this is now labelled |
…e_stage1 Co-authored-by: Cursor <[email protected]> # Conflicts: # aiter/configs/model_configs/dsv4_fp8fp4_tuned_fmoe.csv
Re-tuned the six expert=49 (7168x3072, topk=6) rows with the standard fused-MoE tuner on main, replacing the stage1-only rows. Every column is now tuner output: us1/err1, us2/err2, us, tflops and bw. Stage2 moves from the plain flydsl_moe2_afp8_wfp4_bf16_* family to flydsl_moe2_layout_*, which the tuner selects at every bucket. Co-authored-by: Cursor <[email protected]>
@zufayu : I have rerun the tuner to fill in the missing details in the tuned csv. Rerun the microbench for the updated solutions and remade the results table in the format you requested. I have updated the stale PR description as well + pasted the updated microbench results there. Can you please take a look again? |
…5821) * [Config] Add DSV4 EP8 stage1 tuned fmoe rows for gfx950 Under --ep-size 8 with shared-expert fusion aiter resolves expert=49 (48 local routed experts plus this rank's fused shared expert), a shape the shipped DSv4 table carries no rows for, so it falls back to the heuristic. Serving deployments have been supplying these six rows out-of-band; carrying them here lets the tuning travel with aiter. Measured on MI355X at 8k/1k, concurrency 128, TP8/DP8/EP8 with DSpark, against the same table with these rows removed: +2.25% output token throughput and -2.55% mean TPOT. Co-authored-by: Cursor <[email protected]> * [Config] Retune DSV4 EP8 fmoe rows on gfx950: full stage1+stage2 data Re-tuned the six expert=49 (7168x3072, topk=6) rows with the standard fused-MoE tuner on main, replacing the stage1-only rows. Every column is now tuner output: us1/err1, us2/err2, us, tflops and bw. Stage2 moves from the plain flydsl_moe2_afp8_wfp4_bf16_* family to flydsl_moe2_layout_*, which the tuner selects at every bucket. Co-authored-by: Cursor <[email protected]> --------- Co-authored-by: Cursor <[email protected]>
…OCm#5821) * [Config] Add DSV4 EP8 stage1 tuned fmoe rows for gfx950 Under --ep-size 8 with shared-expert fusion aiter resolves expert=49 (48 local routed experts plus this rank's fused shared expert), a shape the shipped DSv4 table carries no rows for, so it falls back to the heuristic. Serving deployments have been supplying these six rows out-of-band; carrying them here lets the tuning travel with aiter. Measured on MI355X at 8k/1k, concurrency 128, TP8/DP8/EP8 with DSpark, against the same table with these rows removed: +2.25% output token throughput and -2.55% mean TPOT. Co-authored-by: Cursor <[email protected]> * [Config] Retune DSV4 EP8 fmoe rows on gfx950: full stage1+stage2 data Re-tuned the six expert=49 (7168x3072, topk=6) rows with the standard fused-MoE tuner on main, replacing the stage1-only rows. Every column is now tuner output: us1/err1, us2/err2, us, tflops and bw. Stage2 moves from the plain flydsl_moe2_afp8_wfp4_bf16_* family to flydsl_moe2_layout_*, which the tuner selects at every bucket. Co-authored-by: Cursor <[email protected]> --------- Co-authored-by: Cursor <[email protected]>
Motivation
DeepSeek-V4 EP8 (Mori) dispatches AITER's a8w4 MXFP4 fused-MoE operator with this gfx950 runtime signature:
(7168, 3072)(49, 6)e4m3fn) activations, MXFP4 (float4_e2m1fn_x2) weightsQuantType.per_1x32, G1U1,doweight_stage1=0, SiLUOn
mainno tuned table carries this key, so every token bucket falls through toAITER's heuristic FlyDSL fallback. The same table already covers
E=48andE=24at
(7168, 3072); theE=49keys are disjoint from both.What this adds
Six gfx950/cu256 rows in the existing DSV4 FP8-FP4 table,
M = {512, 1024, 2048, 4096, 8192, 16384}:block_m=64atM=512,block_m=128aboveflydsl_moe1_afp8_wfp4_bf16_*, stage2flydsl_moe2_layout_afp8_wfp4_bf16_*run_1stage=0,ksplit=0)All six were tuned with the standard fused-MoE tuner over the FlyDSL a8w4 stage1 and
stage2 families (248 candidates per shape). Both stages are tuned; every column is
tuner output, including
us1/err1,us2/err2,us,tflopsandbw. Only rowsimproving the production operator by at least 3% in both verification runs were
retained — all six clear that bar, the weakest at +5.1%.
Validation
Per-bucket default-vs-tuned through the production
fused_moe, decode-like routing,two independent runs. "Default" is the heuristic fallback on
main— verified fromthe dispatch log, which emits
using heuristic FlyDSL fallbackfor all six bucketswhen the rows are absent and never emits it when they are present.
decode-like routing (router scores from
torch.randn— uneven per-expert load)prefill-like routing (balanced round-robin,
AITER_MOE_EXPERT_BALANCE=1)Speedup over the fallback at
M=512/1024/2048/4096/8192/16384, mean of two runs:Routing definitions, since these rows are merged for both prefill and decode:
decode-like draws router scores from
torch.randn, giving the uneven per-experttoken distribution typical of decode; prefill-like uses balanced round-robin
assignment (
AITER_MOE_EXPERT_BALANCE=1), approximating a large uniform prefillchunk. Both were measured at every bucket, and every bucket is positive in both
regimes and both runs, so no row is prefill-regressing.
Correctness, same runs, against the harness's torch reference (threshold
1e-2):logits_diffis 3.98e-4 to 4.08e-4 for the fallback and 4.11e-4 to 4.17e-4 for thetuned rows, at every bucket in both routings. All rows carry
err1=0.0%anderr2=0.0%from the tuner.test_config_shape_collision.pyandtest_csv_validation.py: 46 passed, 50subtests passed. All six rows survive the
AITER_CONFIG_FMOEmerge.maincarries thegfx950 / (7168, 3072) / E=49, topk=6dispatch key.Hardware: MI355X (
gfx950, 256 CUs). Latency was measured on a single pinned GPUwith the other seven idle; the tuner sweep used all eight.
Image:
lmsysorg/sglang-rocm:v0.5.22-rocm724-mi35x-20261025(ROCm 7.2.4,torch 2.11.0+rocm7.2).
Tuning base: upstream
ROCm/aitermainat905967361.