Skip to content

[Config] [Bugfix] Retune DSV3 fused-shared-expert fmoe rows on gfx942 - #6190

Merged
yifehuan merged 3 commits into
ROCm:mainfrom
simondanielsson:fix/correct-dsv3-fmoe-shapes
Oct 12, 2026
Merged

yifehuan merged 3 commits into
ROCm:mainfrom
simondanielsson:fix/correct-dsv3-fmoe-shapes

Conversation

@simondanielsson

@simondanielsson simondanielsson commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Motivation

Some fmoe rows for DSv3 on gfx942 used a 2stage CK config that's numerically broken (see err1 and 2). This PR retunes them.

This eventually caused higher rate of gibberish being generatred in vllm.

Microbenchmarks show the new configs are up to 10% slower, but at least they are 30-40x more accurate and don't produce gibberish.

Generated using

TUNE_ONLY=asm,cktile python3 csrc/ck_gemm_moe_2stages_codegen/gemm_moe_tune.py \
  --untune_file untuned.csv --tune_file tuned.csv

Test Plan

1. Run op_tests/test_moe_2stage.py

python3 op_tests/test_moe_2stage.py --no-flydsl-csv \
  -dim 7168,2048 -e 33 -k 9 -q 5 -a silu -s f -p t \
  -t 1 2 4 8 16 32 64 128 256 512 1024 2048 4096 8192 16384

2. e2e performance in vllm on DSv3 with this cfg:

Tested on vllm/vllm-openai-rocm:v0.30.0.

VLLM_ROCM_USE_AITER=1 \
VLLM_ROCM_USE_AITER_FUSION_SHARED_EXPERTS=1 \
vllm serve deepseek-ai/DeepSeek-V3-0324     --tensor-parallel-size 8 --enable-expert-parallel --speculative-config='{"method":"mtp","num_speculative_tokens":1}'     --gpu-memory-utilization 0.8     --max-model-len 64k

1k/1k conc 32

vllm bench serve \
  --backend vllm --model deepseek-ai/DeepSeek-V3-0324  \
  --dataset_name random --random_input_len 1024 --random_output_len 1024 \
  --max_concurrency 32 --num_prompts 320 --num_warmups 64 \
  --host localhost --port 8000 --ignore_eos --seed 56552124

Test Result

test_moe_2stage.py

Tokens 1-32

token main logits_diff this PR logits_diff main us this PR us
1 0.0342 0.000149 110.6 114.1
2 0.0288 0.000158 195.7 188.5
4 0.0170 0.0000964 282.5 282.7
8 0.0195 0.000130 380.5 361.4
16 NaN output 0.000117 395.0 392.9
32 0.0194 0.000132 418.6 417.4

Tokens >=64

token main logits_diff this PR logits_diff main us this PR us us ratio
64 1.869e-3 1.833e-4 402.27 418.71 0.96x
128 5.321e-3 1.234e-4 481.10 466.56 1.03x
256 4.051e-3 1.280e-4 594.27 611.03 0.97x
512 4.203e-3 1.258e-4 849.13 955.69 0.89x
1024 4.192e-3 1.271e-4 1434.49 1609.56 0.89x
2048 4.161e-3 1.259e-4 2409.03 2717.83 0.89x
4096 4.248e-3 1.268e-4 4620.93 5251.80 0.88x
8192 4.467e-3 1.256e-4 8550.06 9751.83 0.88x
16384 4.457e-3 1.259e-4 16779.2 19654.75 0.85x

e2e test

With this csv

============ Serving Benchmark Result ============
Successful requests:                     320
Failed requests:                         0
Maximum request concurrency:             32
Benchmark duration (s):                  252.97
Total input tokens:                      327680
Total generated tokens:                  327680
Request throughput (req/s):              1.26
Output token throughput (tok/s):         1295.36
Peak output token throughput (tok/s):    1056.00
Peak concurrent requests:                37.00
Total token throughput (tok/s):          2590.71
---------------Time to First Token----------------
Mean TTFT (ms):                          261.79
Median TTFT (ms):                        156.32
P99 TTFT (ms):                           1558.76
-----Time per Output Token (excl. 1st token)------
Mean TPOT (ms):                          23.57
Median TPOT (ms):                        22.97
P99 TPOT (ms):                           34.08
---------------Inter-token Latency----------------
Mean ITL (ms):                           35.99
Median ITL (ms):                         33.92
P99 ITL (ms):                            88.74
---------------Speculative Decoding---------------
Acceptance rate (%):                     52.74
Acceptance length:                       1.53
Drafts:                                  214412
Draft tokens:                            214412
Accepted tokens:                         113086
Per-position acceptance (%):
  Position 0:                            52.74
==================================================

On main

============ Serving Benchmark Result ============
Successful requests:                     320
Failed requests:                         0
Maximum request concurrency:             32
Benchmark duration (s):                  249.10
Total input tokens:                      327680
Total generated tokens:                  327680
Request throughput (req/s):              1.28
Output token throughput (tok/s):         1315.45
Peak output token throughput (tok/s):    1056.00
Peak concurrent requests:                38.00
Total token throughput (tok/s):          2630.91
---------------Time to First Token----------------
Mean TTFT (ms):                          257.04
Median TTFT (ms):                        152.54
P99 TTFT (ms):                           1527.05
-----Time per Output Token (excl. 1st token)------
Mean TPOT (ms):                          23.36
Median TPOT (ms):                        22.76
P99 TPOT (ms):                           33.99
---------------Inter-token Latency----------------
Mean ITL (ms):                           35.57
Median ITL (ms):                         33.64
P99 ITL (ms):                            85.43
---------------Speculative Decoding---------------
Acceptance rate (%):                     52.32
Acceptance length:                       1.52
Drafts:                                  214995
Draft tokens:                            214995
Accepted tokens:                         112484
Per-position acceptance (%):
  Position 0:                            52.32
==================================================

Submission Checklist

@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

🏷️ CI Guide

Runs automatically on every PR:

  • ✅ Pre-checks (submodule verification, code formatting)
  • ✅ Aiter op tests (gfx942 + gfx950)
  • ✅ Triton tests on MI35X (only when aiter/ops/triton/** or related paths are changed)

Extended tests (opt-in via labels):

Label Tests
ci:gfx1250-ffm-triton Run the five-shard gfx1250 FFM Triton test suite
ci:triton-300x Run an additional Triton test job on MI300X in PRs (added automatically when gfx942 configs change); main branch always runs both MI35X and MI300X
ci:triton-355 Run the full Triton test suite on MI35X, not only the tests the change affects
multigpu Aiter multi-GPU tests on the 8-GPU runner
ci:sglang SGLang integration tests: DeepSeek-R1-MXFP4 accuracy, Qwen 3.5 accuracy
ci:atom ATOM benchmark: DeepSeek-R1-0528, GPT-OSS-120B
ci:atom_full ATOM accuracy suite for PR and main models from ATOM models_accuracy.json
ci:vllm vLLM benchmark: GPT-OSS-120B, DeepSeek-R1-0528, Kimi-K2.5
ci:all All standard extended tests (excludes ci:atom_full)

Only add ci:atom_full for FlyDSL or Triton upgrades.
Add labels via the sidebar or gh pr edit 6190 --add-label <label>

One backend per PR:
A PR changes one kernel backend: [Triton/Gluon] (Triton and Gluon count as one), [HIP], [ASM], [CK], [OPUS] or [FlyDSL]. If the title ends up with two backend tags, split the PR -- as stacked pull requests when one part cannot merge without the other.

PR title tags & labels:
Component tags ([Triton/Gluon], [HIP], [CK], [ASM], ...) are added to the PR title and as PR labels automatically from the changed files and re-synced on every push — change-type tags like [fix]/[Perf], op tags like [MLA], and human labels (ci:*) are left untouched. Add the no-auto-title label to stop the title rewrites; labels stay in sync either way.

Signed-off-by: simondanielsson <[email protected]>
Signed-off-by: simondanielsson <[email protected]>
@simondanielsson simondanielsson changed the title [Config][Bugfix] Retune numerical inaccuracy for DSR1/V3 BF16 fmoe rows on gfx942 [Config][Bugfix] Retune DSV3 fused-shared-expert fmoe rows on gfx942 Oct 7, 2026
@simondanielsson
simondanielsson marked this pull request as ready for review October 7, 2026 19:36
@simondanielsson
simondanielsson requested a review from a team October 7, 2026 19:36
@github-actions github-actions Bot changed the title [Config][Bugfix] Retune DSV3 fused-shared-expert fmoe rows on gfx942 [Config] [Bugfix] Retune DSV3 fused-shared-expert fmoe rows on gfx942 Oct 7, 2026
@github-actions github-actions Bot added the Config label Oct 7, 2026
@zufayu
zufayu requested a review from yifehuan October 8, 2026 02:09

@yifehuan yifehuan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@yifehuan
yifehuan merged commit 02575f1 into ROCm:main Oct 12, 2026
@simondanielsson
simondanielsson deleted the fix/correct-dsv3-fmoe-shapes branch October 12, 2026 16:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants