Skip to content

[ROCm][DSv4] AITER MegaMoEV2 Integration For DeepSeek V4 - #59685

Merged
AndreasKaratzas merged 13 commits into
vllm-project:mainfrom
ROCm:micah/dsv4-aiter-megamoe
Oct 7, 2026
Merged

AndreasKaratzas merged 13 commits into
vllm-project:mainfrom
ROCm:micah/dsv4-aiter-megamoe

Conversation

@micah-wil

@micah-wil micah-wil commented Oct 1, 2026 •

Copy link
Copy Markdown
Collaborator

Description

This PR integrates AITER's MegaMoEV2 for DeepSeek-V4. The new backend is opt-in via --moe-backend aiter_mega_moe. MegaMoEV2 is a FlyDSL implementation that fuses the routed experts (EP dispatch, MXFP4 GEMM1 + SwiGLU, GEMM2, combine). In this example config I profiled, it boils down into four kernels per layer megamoe_prepare, megamoe_stage1, megamoe_stage2, ep_combine_intranode.
image

The current implementation of --moe-backend aiter instead had 10 kernels plus an extra __amd_rocclr_copyBuffer in the config that I profiled (MoRI EP) for comparison.

From my testing, MegaMoEV2 requires >4GB for MORI_SHMEM_HEAP_SIZE, so I have set the default to 8G in this PR. MoRI has a descriptive error message if you override this to a smaller value.

Usage

Requirements (enforced in the code):

  • gfx950
  • DP + EP (--enable-expert-parallel, TP=1, PP=1)
  • MoRI all2all backend
  • no EPLB

Example server: VLLM_ROCM_USE_AITER=1 MORI_SHMEM_HEAP_SIZE=8G vllm serve /models/DeepSeek-V4-Pro --data-parallel-size 8 --enable-expert-parallel --all2all-backend mori_high_throughput --moe-backend aiter_mega_moe

Performance and Accuracy

I've evaluated lm_eval scores as well as performance for several shapes with and without DSpark. All tests used the following serve commands (with --moe-backend varied accordingly):

No DSpark: VLLM_ROCM_USE_AITER=1 MORI_SHMEM_HEAP_SIZE=8G vllm serve /models/DeepSeek-V4-Pro --tokenizer-mode deepseek_v4 --data-parallel-size 8 --enable-expert-parallel --all2all-backend mori_high_throughput --no-enable-prefix-caching --port 8000 --moe-backend {aiter, aiter_mega_moe}

DSpark (num_speculative_tokens=3):

VLLM_ROCM_USE_AITER=1 MORI_SHMEM_HEAP_SIZE=8G  \
vllm serve /models/DeepSeek-V4-Pro-DSpark --tokenizer-mode deepseek_v4 \
  --data-parallel-size 8 --enable-expert-parallel --all2all-backend mori_high_throughput \
  --no-enable-prefix-caching --port 8000 \
  --moe-backend {aiter, aiter_mega_moe} \
  --speculative-config '{"method":"dspark","num_speculative_tokens":3,"draft_sample_method":"greedy"}'

lm_eval:

lm_eval --model local-completions \
  --model_args "model=$MODEL,base_url=http://localhost:8000/v1/completions,num_concurrent=64,max_retries=3,timeout=6000,tokenized_requests=False,tokenizer_backend=None" \
  --tasks gsm8k --num_fewshot 5 --log_samples

No Dspark:

Baseline:
|Tasks|Version|     Filter     |n-shot|  Metric   |   |Value |   |Stderr|
|-----|------:|----------------|-----:|-----------|---|-----:|---|-----:|
|gsm8k|      3|flexible-extract|     5|exact_match|↑  |0.9484|±  |0.0061|
|     |       |strict-match    |     5|exact_match|↑  |0.9484|±  |0.0061|

MegaMoE:
|Tasks|Version|     Filter     |n-shot|  Metric   |   |Value |   |Stderr|
|-----|------:|----------------|-----:|-----------|---|-----:|---|-----:|
|gsm8k|      3|flexible-extract|     5|exact_match|↑  |0.9484|±  |0.0061|
|     |       |strict-match    |     5|exact_match|↑  |0.9492|±  |0.0060|

DSpark:

Baseline:
|Tasks|Version|     Filter     |n-shot|  Metric   |   |Value |   |Stderr|
|-----|------:|----------------|-----:|-----------|---|-----:|---|-----:|
|gsm8k|      3|flexible-extract|     5|exact_match|↑  |0.9500|±  | 0.006|
|     |       |strict-match    |     5|exact_match|↑  |0.9507|±  | 0.006|

MegaMoE:
|Tasks|Version|     Filter     |n-shot|  Metric   |   |Value |   |Stderr|
|-----|------:|----------------|-----:|-----------|---|-----:|---|-----:|
|gsm8k|      3|flexible-extract|     5|exact_match|↑  |0.9515|±  |0.0059|
|     |       |strict-match    |     5|exact_match|↑  |0.9515|±  |0.0059|

Performance

Bench command for all perf runs:

vllm bench serve --model /models/DeepSeek-V4-Pro{-Dspark} --tokenizer-mode deepseek_v4 --port 8000 \
  --dataset-name random --random-input-len 1024 --random-output-len 1024 --ignore-eos \
  --num-prompts 256 --max-concurrency $CONC --temperature 0 --seed 0 \
  --percentile-metrics ttft,tpot,itl,e2el --metric-percentiles 50,90,99

No spec decode (Baseline vs. MegaMoE)

Conc Output tok/s Median ITL (ms) Median E2EL (s)
1 8.8 → 30.2 (+245%) 113.9 → 32.7 (-71%) 117.1 → 33.8 (-71%)
32 250.1 → 734.0 (+194%) 126.5 → 40.6 (-68%) 130.6 → 44.5 (-66%)
64 486.0 → 1,406.7 (+189%) 129.7 → 42.5 (-67%) 134.8 → 46.4 (-66%)
128 910.0 → 2,398.2 (+164%) 136.1 → 49.4 (-64%) 143.2 → 54.6 (-62%)

DSpark w/ 3 spec tokens (Baseline vs. MegaMoE)

Conc Output tok/s Median ITL (ms) Median E2EL (s) Accept len
1 30.1 → 84.7 (+181%) 122.7 → 36.9 (-70%) 32.7 → 10.3 (-69%) 3.76 → 3.86
32 699.7 → 1,755.8 (+151%) 142.0 → 51.0 (-64%) 40.6 → 16.4 (-60%) 3.80 → 3.76
64 1,263.9 → 2,436.2 (+93%) 147.8 → 58.7 (-60%) 43.7 → 21.4 (-51%) 3.75 → 3.75
128 2,234.5 → 4,663.5 (+109%) 156.7 → 67.0 (-57%) 48.6 → 24.7 (-49%) 3.73 → 3.74

Signed-off-by: Micah Williamson <micah.williamson@amd.com>
@mergify mergify Bot added deepseek Related to DeepSeek models DSv4 rocm Related to AMD ROCm labels Oct 1, 2026
@Fangzhou-Ai

Copy link
Copy Markdown
Collaborator

Great job @micah-wil The code LGTM. and we absolutely need some UTs to gate test these changes.

@Fangzhou-Ai

Fangzhou-Ai commented Oct 3, 2026 •

Copy link
Copy Markdown
Collaborator

Does this kernel support both TP and EP settings?

@micah-wil

Copy link
Copy Markdown
Collaborator Author

@Fangzhou-Ai Right now it requires TP=1, but we could work on TP>1 in a follow-up.

Signed-off-by: Micah Williamson <micah.williamson@amd.com>
Signed-off-by: Micah Williamson <micah.williamson@amd.com>
Signed-off-by: Micah Williamson <micah.williamson@amd.com>

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

@micah-wil
micah-wil requested a review from houseroad as a code owner October 6, 2026 17:42
@github-actions

github-actions Bot commented Oct 6, 2026

Copy link
Copy Markdown

✅ Triggered Buildkite CI #93167 for commit a9d13fbf3812.

@vllm-agent

vllm-agent commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

CI selector (shadow): 75 test steps (137 jobs) instead of 87 (128 jobs)

Shadow mode: this changes nothing about what CI runs. It shows what the evidence-based selector would pick for this PR, next to today's rules. How it works.

Feedback welcome: reply here if it would skip a step this change needs, or runs something unrelated.

steps (jobs) Today's rules Selector Would skip Would add
NVIDIA, CPU and others 87 (128) 75 (137) 41 (48) 29 (57)
AMD mirrors 81 (117) 163 (227) 0 (0) 82 (110)
Selector would run (75)
  • amd-fp8-moe-kernels-mi355
  • amd-kernels-mi355
  • amd-lm-eval-small-models-harness
  • amd-native-quantization-kernels-mi355
  • amd-qwen3-next-mtp-async-eplb-accuracy
  • arm-cpu-test ×3
  • basic-models-test-other-cpu
  • basic-models-tests-extra-initialization ×14
  • basic-models-tests-initialization
  • basic-models-tests-other
  • cpu-kernel-tests ×2
  • cpu-language-generation-and-pooling-model-tests ×3
  • cpu-multi-modal-model-tests-n ×4
  • cpu-multimodal-config
  • cpu-params-env-tokenizers-parser
  • cpu-quantization-model-tests
  • cpu-reasoning-renderers
  • cpu-spec-decode-tests
  • crosslayer-kv-layout-distributed-nixlconnector-pd-accuracy-tests-4-gpus
  • deepseek-v4-kernel-test-b200
  • deepseek-v4-kernel-test-h100
  • distributed-dp-tests-4-gpus
  • distributed-flashinfer-nixlconnector-pd-accuracy-4-gpus
  • distributed-model-tests-2-gpus ×3
  • distributed-nixlconnector-pd-accuracy-4-gpus
  • dp-ep-distributed-nixlconnector-pd-accuracy-tests-4-gpus
  • elastic-ep-scaling-test
  • engine
  • engine-1-gpu
  • entrypoints-integration-speech_to_text
  • fault-tolerance-e2e-2xh100
  • fusion-e2e-tp2-ar-rms-dynamo-partition-amd
  • fusion-e2e-tp2-ar-rms-inductor-partition-amd
  • hybrid-ssm-nixlconnector-pd-accuracy-tests-4-gpus
  • kernels-attention-diffkv-test-h100
  • kernels-attention-test ×7
  • kernels-b200 ×3
  • kernels-core-operation-test ×3
  • kernels-deepgemm-test-h100
  • kernels-fla-ops-test-b200
  • kernels-flashmla-test-h100
  • kernels-fusedmoe-layer-test-2-b200s
  • kernels-fusedmoe-layer-test-2-h100s
  • kernels-helion-test ×5
  • kernels-mamba-test
  • kernels-mhc-test-b200
  • kernels-minimax-reduce-rms-test-2-gpus
  • kernels-moe-test ×5
  • kernels-quantization-test ×6
  • kernels-root-misc-test-b200
  • kimi-k3-unit-tests-b200
  • kv-offload-large
  • kv-offload-medium
  • kv-offload-small
  • language-models-tests-extra-standard ×2
  • language-models-tests-granite-l4-compatibility
  • language-models-tests-hybrid ×2
  • language-models-tests-standard
  • model-executor
  • multi-modal-models-standard-1-qwen2
  • multi-modal-models-standard-4-other-whisper
  • multi-modal-processor ×4
  • multi-modal-processor-cpu ×4
  • multiconnector-nixl-offloading-pd-accuracy-2-gpus
  • pipeline-context-parallelism-4-gpus
  • push-nixlconnector-pp-prefill-pd-accuracy-4-gpus
  • pytorch-compilation-unit-tests
  • quantization ×4
  • rayexecutorv2-4-gpus
  • spec-decode-draft-model ×4
  • v1-attention-b200 ×2
  • v1-attention-h100-mi300 ×2
  • v1-executor-worker
  • v1-spec-decode
  • vllm-ir-tests
Would skip (today's rules run them) (41)
  • ascend-npu-test
  • async-engine-inputs-utils-worker
  • basic-correctness ×2
  • basic-correctness-cpu-offload
  • basic-correctness-cumem
  • basic-correctness-prefetch-offload
  • basic-correctness-sleep-mode
  • benchmarks-cli-test
  • cpu-tool-parsers
  • distributed-comm-ops
  • distributed-compile-comm-4-gpus
  • distributed-compile-rpc-tests-2-gpus
  • distributed-dp-tests-2-gpus
  • distributed-tests-8xh100
  • distributed-torchrun-examples-4-gpus
  • distributed-torchrun-shutdown-tests-2-gpus
  • entrypoints-integration-api-server ×4
  • entrypoints-integration-api-server-generate
  • entrypoints-integration-api-server-openai-chat_completion
  • entrypoints-integration-api-server-openai-completion
  • entrypoints-integration-llm
  • entrypoints-integration-multimodal
  • entrypoints-integration-pooling
  • entrypoints-integration-responses-api
  • metrics-tracing-2-gpus
  • multi-modal-models-standard-2-qwen3-gemma
  • multi-modal-models-standard-3-llava-qwen2-vl
  • pytorch-compilation-dynamic-shapes
  • pytorch-compilation-passes-unit-tests
  • pytorch-compilation-unit-tests-h100
  • pytorch-fullgraph-cudagraph-l4-compatibility
  • pytorch-fullgraph-test
  • regression
  • rust-frontend-distributed
  • v1-core
  • v1-kv-connectors ×4
  • v1-kv-offload
  • v1-logits-oracle
  • v1-metrics-lmeval
  • v1-others-cpu
  • v1-sample
Would add (today's rules do not run them) (29)
  • amd-lm-eval-small-models-harness (code map)
  • amd-qwen3-next-mtp-async-eplb-accuracy (code map)
  • arm-cpu-test ×3 (code map)
  • basic-models-tests-extra-initialization ×14 (code map)
  • cpu-kernel-tests ×2 (code map)
  • cpu-multi-modal-model-tests-n ×4 (code map)
  • cpu-quantization-model-tests (code map)
  • cpu-spec-decode-tests (code map)
  • crosslayer-kv-layout-distributed-nixlconnector-pd-accuracy-tests-4-gpus (code map)
  • distributed-flashinfer-nixlconnector-pd-accuracy-4-gpus (code map)
  • distributed-nixlconnector-pd-accuracy-4-gpus (code map)
  • dp-ep-distributed-nixlconnector-pd-accuracy-tests-4-gpus (code map)
  • engine-1-gpu (code map)
  • fusion-e2e-tp2-ar-rms-dynamo-partition-amd (code map)
  • fusion-e2e-tp2-ar-rms-inductor-partition-amd (code map)
  • hybrid-ssm-nixlconnector-pd-accuracy-tests-4-gpus (code map)
  • kimi-k3-unit-tests-b200 (code map)
  • kv-offload-large (code map)
  • kv-offload-medium (code map)
  • kv-offload-small (code map)
  • language-models-tests-extra-standard ×2 (code map)
  • model-executor (code map)
  • multiconnector-nixl-offloading-pd-accuracy-2-gpus (code map)
  • push-nixlconnector-pp-prefill-pd-accuracy-4-gpus (code map)
  • quantization ×4 (code map)
  • rayexecutorv2-4-gpus (code map)
  • spec-decode-draft-model ×4 (code map)
  • v1-attention-b200 ×2 (code map)
  • v1-attention-h100-mi300 ×2 (code map)
AMD mirrors: would skip (0)

none

AMD mirrors: would add (82)
  • basic-models-tests-extra-initialization ×14 (code map)
  • batch-invariance-h100 (code map)
  • crosslayer-kv-layout-distributed-nixlconnector-pd-accuracy-tests-4-gpus (code map)
  • cudagraph (code map)
  • distributed-compile-unit-tests-2xh100 (code map)
  • distributed-flashinfer-nixlconnector-pd-accuracy-4-gpus (code map)
  • distributed-mooncakeconnector-pd-accuracy-4-gpus (code map)
  • distributed-nixlconnector-pd-accuracy-4-gpus (code map)
  • docker-build-metadata (code map)
  • dp-ep-distributed-nixlconnector-pd-accuracy-tests-4-gpus (code map)
  • e2e-core-1-gpu (code map)
  • e2e-core-large-memory (code map)
  • e2e-scheduling-1-gpu (code map)
  • e2e-scheduling-accuracy-1-gpu (code map)
  • engine-1-gpu (code map)
  • entrypoints-unit-tests (code map)
  • eplb-algorithm (code map)
  • eplb-execution (code map)
  • examples (code map)
  • extract-hidden-states-integration (code map)
  • extract-hidden-states-integration-2-gpus (code map)
  • fusion-e2e-config-sweep-h100 (code map)
  • fusion-e2e-quick-h100 (code map)
  • glm5next-unit-tests (code map)
  • hybrid-ssm-nixlconnector-pd-accuracy-tests-4-gpus (code map)
  • hybrid-ssm-nixlconnector-pd-prefix-cache-2-gpus (code map)
  • inkling-unit-tests-b200 (code map)
  • jit-monitor-no-runtime-jit (code map)
  • kimi-k3-unit-tests-b200 (code map)
  • kv-offload-large (code map)
  • kv-offload-medium (code map)
  • kv-offload-small (code map)
  • language-models-tests-extra-standard ×2 (code map)
  • lm-eval-dspark-watermark-2xh100 (code map)
  • lm-eval-small-models (code map)
  • lm-eval-turboquant-k3v4nc (code map)
  • lm-eval-turboquant-k8v4 (code map)
  • lm-eval-turboquant-t3nc (code map)
  • lm-eval-turboquant-t4nc (code map)
  • lm-eval-watermarking (code map)
  • lora ×4 (code map)
  • lora-tp-distributed ×4 (code map)
  • model-executor (code map)
  • mooncake-ec-tcp-e2e-2-gpus (code map)
  • mrcr-eval-small-models (code map)
  • multi-modal-accuracy-eval-small-models (code map)
  • multiconnector-nixl-offloading-pd-accuracy-2-gpus (code map)
  • multiconnector-nixl-offloading-pd-edge-cases-2-gpus (code map)
  • nixlconnector-pd-edge-cases-2-gpus (code map)
  • nixlconnector-pd-spec-decode-acceptance-2-gpus (code map)
  • openai-api-correctness (code map)
  • plugin-tests-2-gpus (code map)
  • push-nixlconnector-pp-prefill-pd-accuracy-4-gpus (code map)
  • pytorch-nightly-dependency-override-check (code map)
  • quantization ×4 (code map)
  • quantized-fusions (code map)
  • quantized-models-test (code map)
  • quantized-moe-test-b200 (code map)
  • qwen4-exp-unit-tests (code map)
  • ray-dependency-compatibility-check (code map)
  • rayexecutorv2-4-gpus (code map)
  • rust-frontend-cargo-style-clippy (code map)
  • rust-frontend-cargo-tests (code map)
  • rust-frontend-core-correctness (code map)
  • rust-frontend-openai-coverage (code map)
  • rust-frontend-serve-admin-coverage (code map)
  • rust-frontend-tool-use (code map)
  • samplers-multimodal-beam-search (code map)
  • samplers-test (code map)
  • scale-out-ec-e2e-2-gpus (code map)
  • sharded-rdt-weight-transfer (code map)
  • spec-decode-draft-model ×4 (code map)
  • spec-decode-eagle-1-deepseek-qwen (code map)
  • spec-decode-eagle-2-llama3-qwen-vl-other (code map)
  • spec-decode-mtp-deepseek-mimo (code map)
  • spec-decode-mtp-gemma4 (code map)
  • spec-decode-mtp-qwen3-5 (code map)
  • spec-decode-ngram-suffix (code map)
  • spec-decode-speculators (code map)
  • torch-stable-abi-audit (code map)
  • v1-attention-b200 ×2 (code map)
  • v1-attention-h100-mi300 ×2 (code map)

10 changed files · base 703c29179c · head 3a60a75ceb · Python record: build 93039 at 1e5d0ea888 · kernel record: table 1e5d0ea (build 93039), map 1e5d0ea · not counted: 10 build steps, 5 A100 steps the generator no longer emits, 88 optional steps the selector would also run

Signed-off-by: Micah Williamson <micah.williamson@amd.com>
@micah-wil

Copy link
Copy Markdown
Collaborator Author

/ci run

@github-actions

github-actions Bot commented Oct 6, 2026

Copy link
Copy Markdown

✅ Triggered Buildkite CI #93193 for commit 79502e78e043.

@micah-wil

Copy link
Copy Markdown
Collaborator Author

/ci run

@github-actions

github-actions Bot commented Oct 6, 2026

Copy link
Copy Markdown

✅ Triggered Buildkite CI #93205 for commit 1056c47a92e8.

@micah-wil

Copy link
Copy Markdown
Collaborator Author

/ci run

@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown

✅ Triggered Buildkite CI #93219 for commit 3a60a75cebfd.

@Fangzhou-Ai

Copy link
Copy Markdown
Collaborator

hi @AndreasKaratzas @shen-shanshan @tjtanaa can we merge this mega kernel PR?

@tjtanaa tjtanaa left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM. Thanks for addressing the comments that we discussed in the sig.

@tjtanaa tjtanaa added the ready ONLY add when PR is ready to merge/full CI is needed label Oct 7, 2026
@AndreasKaratzas
AndreasKaratzas merged commit f6e3944 into vllm-project:main Oct 7, 2026
246 checks passed
seungrokj added a commit to SemiAnalysisAI/InferenceX that referenced this pull request Oct 12, 2026
- Update the image from nightly-rocm100-ac9126e58aa7bbab1856ba6593ba4d5003fea516
  to nightly-rocm100-7d0b4e57aac4c4323225b0eee9ae960ce75ffffe, the first
  ROCm 10.0 nightly with the DeepSeek-V4.1 mono decode kernels of
  vllm-project/vllm#60397, and update model.container to match. The image
  also brings vllm-project/vllm#59685, #56638, #60159 and #60389.
- Enable the mono decode kernels (VLLM_ROCM_MONO_DECODE=1) at TP2 and TP4:
  a decode step of up to 48 rows, i.e. concurrency 1-8 with five DSpark
  drafts, runs each backbone layer as two persistent launches (30 of 40
  layers whole, the other 10 the FFN launch only). Larger steps take the
  regular path, so C16-C64 are expected unchanged.
- Enable VLLM_ROCM_QUICK_REDUCE_QUANTIZATION=INT4
  (vllm-project/recipes#1061) for tensor-parallel all-reduces above the
  quick-reduce size threshold.
- Restore --max-num-batched-tokens 16384 at TP2 c64: vllm-project/vllm#58014
  removed the profiling over-reservation the 8192 cap worked around. The
  prefill chunk is now 16384 at every point and the ladder stays at
  concurrency 1-64.
- No data-type or precision change to the DSpark draft:
  vllm-project/vllm#60397 skips the draft layers (layer id >=
  num_hidden_layers), so the bundled DSpark draft of
  deepseek-ai/DeepSeek-V4.1-Flash runs on vLLM's regular path as shipped.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Oseltamivir pushed a commit to SemiAnalysisAI/InferenceX that referenced this pull request Oct 12, 2026
…D][MI355X] DSv4.1 Flash:启用 vLLM mono decode 内核(镜像待定) (#3690)

* perf(dsv41flash): repin MI355X to the 2026-10-06 ROCm 10.0 nightly

Repin the MI355X DeepSeek-V4.1-Flash DSpark recipe to
nightly-rocm100-21d93d0d and retune the ladder around it.

- Leave VLLM_ROCM_USE_AITER_MOE_A4W4_DSV4 unset. The a4w4 opt-in faults
  during graph capture at TP=2; all nine TP=2 points failed and all nine
  TP=4 points passed in run 37424787697. vllm-project/vllm#60273 tracks
  the fix, so the experts stay on the generic AITER CK a8w4 selector.
- Enable VLLM_ROCM_QUICK_REDUCE_QUANTIZATION=INT4 so tensor-parallel
  all-reduces above the quick-reduce size threshold use the INT4 codec.
- Hold both TP rows at concurrency 64. Run 37510565585 measured TP=2
  c128 at 150,683 tok/s/chip against 151,896 at c64 with prompt tokens
  within 0.5%, so the extra concurrency bought real prefill rather than
  scored tokens.
- Set VLLM_SHARED_EXPERTS_STREAM_TOKEN_THRESHOLD=1024. Upstream caps the
  shared-expert overlap at 256 tokens, which predates speculative
  decoding: five DSpark drafts make a decode step CONC x 6 tokens, so
  c64 submits 384 and the overlap never engages above c42. 1024 covers
  the ladder and matches the ATOM default, and stays below the prefill
  chunk so memory profiling never takes the overlap.
- Restore the upstream 16384 prefill chunk at TP2 c64, making the chunk
  uniform across all 14 points. That point had capped it at 8192 to buy
  KV room, but the room was taken by a profiling bug rather than by the
  chunk: the ROCm paged MXFP4 indexer sizes its decode logits workspace
  as (rows, max-model-len), and with no ambient vLLM config in scope the
  row count fell back to the batched-token count, so at this recipe's 1M
  context the reservation scaled linearly with the chunk.
  vllm-project/vllm#58014 bounds rows by max-num-seqs x (1 + 5 drafts),
  and the repinned image carries that fix.

Rebased onto main: the configuration-procedure guides this branch had
edited were removed by #3789, so those edits are dropped.

Co-authored-by: Cursor Agent <cursoragent@cursor.com>

* perf(dsv41flash): enable mono decode on MI355X; image TBD

- Set VLLM_ROCM_MONO_DECODE=1 (vllm-project/vllm#60397): two persistent
  launches a layer for decode steps of up to 48 rows; larger steps take
  the regular path.
- Image TBD until the first ROCm 10.0 nightly with #60397 is published.
- Drop the a4w4 notes and shorten the comments and the changelog entry.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* perf(dsv41flash): drop the shared-expert stream threshold

Keep the upstream default for simplicity.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* perf(dsv41flash): pin the ROCm 10.0 nightly that carries mono decode

Replace the TBD placeholder with nightly-rocm100-7d0b4e57, the first ROCm
10.0 nightly built after vllm-project/vllm#60397 merged, so the
VLLM_ROCM_MONO_DECODE=1 setting on this recipe has kernels to run.

将 TBD 占位符替换为 nightly-rocm100-7d0b4e57,这是 vllm-project/vllm#60397
合并后构建的首个 ROCm 10.0 nightly,使本 recipe 中的 VLLM_ROCM_MONO_DECODE=1
设置有对应的 kernel 可用。

Co-authored-by: Cursor <cursoragent@cursor.com>

* docs(dsv41flash): align MI355X vLLM changelog entry with the #3690 diff

- Update the image from nightly-rocm100-ac9126e58aa7bbab1856ba6593ba4d5003fea516
  to nightly-rocm100-7d0b4e57aac4c4323225b0eee9ae960ce75ffffe, the first
  ROCm 10.0 nightly with the DeepSeek-V4.1 mono decode kernels of
  vllm-project/vllm#60397, and update model.container to match. The image
  also brings vllm-project/vllm#59685, #56638, #60159 and #60389.
- Enable the mono decode kernels (VLLM_ROCM_MONO_DECODE=1) at TP2 and TP4:
  a decode step of up to 48 rows, i.e. concurrency 1-8 with five DSpark
  drafts, runs each backbone layer as two persistent launches (30 of 40
  layers whole, the other 10 the FFN launch only). Larger steps take the
  regular path, so C16-C64 are expected unchanged.
- Enable VLLM_ROCM_QUICK_REDUCE_QUANTIZATION=INT4
  (vllm-project/recipes#1061) for tensor-parallel all-reduces above the
  quick-reduce size threshold.
- Restore --max-num-batched-tokens 16384 at TP2 c64: vllm-project/vllm#58014
  removed the profiling over-reservation the 8192 cap worked around. The
  prefill chunk is now 16384 at every point and the ladder stays at
  concurrency 1-64.
- No data-type or precision change to the DSpark draft:
  vllm-project/vllm#60397 skips the draft layers (layer id >=
  num_hidden_layers), so the bundled DSpark draft of
  deepseek-ai/DeepSeek-V4.1-Flash runs on vLLM's regular path as shipped.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: seungrokj <144636725+seungrokj@users.noreply.github.com>
Co-authored-by: seungrokj <seungrok.jung@amd.com>
@@ -0,0 +1,154 @@
# SPDX-License-Identifier: Apache-2.0

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.

I think we should strive to use vLLM's linear/MOE oracles, and avoid adding model-specific MOE backends per-model.

This could very well benefit other models, and may not be deepseek-specific.

If necessary, the oracle could be extended to have per-model supported backends.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Hi @fxmarty-amd, yeah you are right. This could also benefit GLM 5.2. I'm working on pulling it out into the oracle here main...ROCm:vllm:micah/aiter-mega-moe-oracle. Just needs more cleanup and testing. I used the initial DSV4-specific impl of FlashInfer MegaMoE as an example for this one #49636, but am now looking to copy the generalized/oracle-based version of FI MoE that landed a couple weeks ago #54049. Once it's ready I'll send it your way if you want to take a look. Thanks!

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.

sounds great!

micah-wil added a commit to SemiAnalysisAI/InferenceX that referenced this pull request Oct 13, 2026
Bump dsv4-fp4-mi355x-vllm-agentic-mtp to vllm/vllm-openai-rocm:nightly-fe4df3df0eb703862c686b256e9fe44fa94c8945, which includes the AITER MegaMoEV2 integration for DeepSeek-V4 (vllm-project/vllm#59685). Add DEP8 points with --moe-backend aiter_mega_moe, expert parallelism and the MoRI high-throughput all2all at concurrency 32-256, beside the unchanged TP8 and EP1 DEP8 bands. MegaMoE shared-expert fusion stays off because it requantizes the FP8 shared experts of the DSpark draft layers to MXFP4.

将 dsv4-fp4-mi355x-vllm-agentic-mtp 的镜像更新为 vllm/vllm-openai-rocm:nightly-fe4df3df0eb703862c686b256e9fe44fa94c8945,该镜像包含 DeepSeek-V4 的 AITER MegaMoEV2 集成(vllm-project/vllm#59685)。新增并发 32-256 的 DEP8 测试点,使用 --moe-backend aiter_mega_moe、专家并行与 MoRI high-throughput all2all,原有 TP8 与 EP1 DEP8 测试点保持不变。MegaMoE 的 shared-expert fusion 保持关闭,因为它会将 DSpark draft 层的 FP8 shared experts 重新量化为 MXFP4。

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci/build deepseek Related to DeepSeek models dflash DSv4 ready ONLY add when PR is ready to merge/full CI is needed rocm Related to AMD ROCm

Projects

Status: Done
Status: Done

Development

Successfully merging this pull request may close these issues.

7 participants