Skip to content

[ROCm][Perf][DSv4.1] Mono decode on every backbone layer - #61082

Merged
shen-shanshan merged 7 commits into
vllm-project:mainfrom
Fangzhou-Ai:dsv41-mono-all-layers
Oct 13, 2026
Merged

shen-shanshan merged 7 commits into
vllm-project:mainfrom
Fangzhou-Ai:dsv41-mono-all-layers

Conversation

@Fangzhou-Ai

@Fangzhou-Ai Fangzhou-Ai commented Oct 11, 2026 •

Copy link
Copy Markdown
Collaborator

Overview

Follow-up to #60397. The DeepSeek-V4.1-Flash mono decode kernels (MI355X, --monokernel) now run all 40 backbone layers whole as K1 + K2. Before, 30 layers ran whole and the other 10 kept vLLM's attention plus the FFN launch: layer 0, the Engram layer 1, and the index sources 2, 8, 14, 20, 24, 28, 32, 36. The switch is now --monokernel (KernelConfig.monokernel, per RFC #60904), replacing the VLLM_ROCM_MONO_DECODE environment variable from #60397.

Claims

  • AgentX at TP4, concurrency 1, 3,600 s, Rust frontend, against main with mono on: P90 interactivity goes from 541.6 to 562.6 tokens/s/user (+3.9%), P50 from 569.8 to 595.5 (+4.5%), and ITL p50 from 1.760 to 1.680 ms.
  • Accuracy is unchanged. GPQA-Diamond and AIME25 pass@1, mono on against off on this branch, differ by +0.1 ± 0.7 and +1.7 ± 1.2 points, both within noise. RULER NIAH scores 1.00 with mono on and off at 32K, 128K and 256K.
  • Nothing changes with the switch off, and the 30 standard layers build the same kernels as before.

Validation

Performance. MI355X, TP4, DSpark with 5 drafts and synthetic acceptance 3.51 (InferenceX#3690's TP4 recipe), AgentX at concurrency 1. Each arm is one 3,600 s run, and both arms ran at the same time on GPUs 0–3 and 4–7.

P90 interactivity P50 interactivity ITL p50 TTFT p50 requests
main (7d0b4e5), mono on 541.6 569.8 1.760 ms 0.200 s 328
this PR, mono on 562.6 595.5 1.680 ms 0.201 s 332

The main arm reproduces InferenceX's sweep point for this config (543). A 900 s run of each arm on the Python frontend gave +6.2% on P90 (503.5 to 534.5).

Accuracy. TP2, this branch, mono on against off, 4 seeds each, thinking on, DSpark with block rejection. Each mono-on server logged every backbone layer running whole.

mono on mono off on − off (paired by question)
GPQA-Diamond pass@1 85.0 ± 2.2 85.0 ± 2.2 +0.1 ± 0.7
AIME25 pass@1 100.0 ± 0.0 98.3 ± 1.2 +1.7 ± 1.2

Long context. RULER NIAH, TP2, this branch, mono on against off: single-1, multikey-2 and multikey-3 at 32K, 128K and 256K, 40 samples each, greedy. All 9 points score 1.00 on both arms (360 samples per arm).

Tests, all run locally on MI355X:

  • tests/models/test_dsv41_mono_layers.py at TP2 and TP4: passed. Its 5-layer model now covers every variant: the first layer, a ratio-2 KV and index source, a ratio-2 consumer with an Engram, a ratio-1 KV, index and candidate source, and a ratio-1 index source over layer 3's candidates. Every layer has to take the whole-layer path on every rank at every decode step.
  • tests/models/test_dsv41_mono_numerics.py at TP2 and TP4, including the 300-replay CUDA-graph stress: passed.
  • tests/models/test_dsv41_mono_decode.py: 37 passed.
  • VLLM_GPU_SYNC_CHECK=error on the 5-layer model with CUDA graphs: no sync in steady-state decode. The runner's one-time setup on the first decode step syncs, as on main.
Reproduce
.venv/bin/python -m pytest tests/models/test_dsv41_mono_decode.py tests/models/test_dsv41_mono_numerics.py tests/models/test_dsv41_mono_layers.py -v
# AgentX: InferenceX#3690 dsv41flash TP4 c1 recipe with --monokernel, `infx.bench agentic`, DURATION=3600
# Evals: lm-eval local-chat-completions on GPQA-Diamond / AIME25, temperature 0.6, top_p 0.95, 4 seeds, mono on vs off
# NIAH: lm-eval RULER niah_single_1 / niah_multikey_2 / niah_multikey_3 (chat), max_seq_lengths 32768 / 131072 / 262144, --limit 40

Details

  • Settled residual (layers 0, 1, 14). K1 gets a fold build flag. Without it, the seam slice takes the residual as it arrives instead of folding the previous layer's output in. Layer 0's residual is the embedding broadcast to the 4 streams, with an identity incoming pre-mix. The mix projection uses hc_attn_fn over the broadcast, which equals vLLM's folded hc_attn_fn_broadcast up to summation order. On an Engram layer, mhc_post and the Engram write run in torch before K1, as on vLLM's path.
  • Index sources (layers 2, 8, 14, 20, 24, 28, 32, 36). K1 gets an index build flag.
    • K1 also stores its normed input and its bf16 qr (the q_norm output). It skips the key-table stage, because the top-k does not exist yet.
    • Between the two launches, _select runs vLLM's own modules: the compressor and its cache insert, the indexer K write, weights_proj, forward_q and indexer_op.
    • K2 then builds the key table on its last CTAs. Each attention split task waits on its token's flag, and the table goes through device scope, since the same launch reads it.
  • Tradeoffs.
    • The compressor and indexer now run serially between the kernels. vLLM's path overlapped them on side streams, which the persistent kernels can't do, since they need every CU.
    • The indexer's wq_b quantizes the bf16 qr itself, where vLLM's fused q-norm hands it fp8 qr. The model-level test bounds the difference.
    • _select restates the module call sequence of _forward_csa2_full and _forward_csa2_reindex without their stream forks.
  • Not covered. The DSpark draft layers still take vLLM's path. A layer outside the kernels (an MXFP8 KV cache, another indexer type) still takes the FFN launch, and the model-level test no longer exercises that launch; the numerics test does.
  • Model-level test bounds.
    • Layer 0 now runs whole, so its output is held to 3% at every token. The old 1.5% at a request's first decode token was written for the FFN launch.
    • The near-tie exemption past layer 0 widens from 5e-3 to 1e-2. Every layer's input now carries the earlier layers' kernel differences (0.4–0.7%). One TP4 token flipped an expert at a gap of 0.0072 while every other token stayed near 4%.
  • Relation to other PRs. [ROCm][Perf][DSv4.1] Mono decode on MI300X and MI325X (gfx942) #60731 ports the mono kernels to gfx942 and touches the same files. The two don't overlap in function, but whichever merges second needs a rebase.
  • Remaining gap. On the formal sweep, ATOM's P90 at this point is 574. Moving the indexer's scoring and top-k, and the draft layers, into the kernels are the next steps.

Pull Request Checklist
  • I used vLLM's /pr-checklist skill. (Mandatory for agents, optional for humans).

  • AI assistance was used during the creation of this PR.

  • Design Fit: Minimizes impact on core components, reuses existing functionality, and justifies added complexity.

  • Testing and Validation: Validates the change and ensures any added tests are meaningful and reliable, with CI coverage or documented CI resource constraints and validation performed outside CI.

  • Code Quality and Style: Keeps code and comments clear and concise, and updates relevant documentation and examples.

  • Pull Request Contents: Includes a brief summary and relevant links, supports claims with evidence, explains root causes and implementation trade-offs, and follows the contributing guide.

AI assistance (Claude Code) was used to write this change, its tests and this description. The submitter reviews every changed line and has run the tests and benchmarks above. No other open PR runs these layers on the mono kernels; #60731 is the gfx942 port.

🤖 Generated with Claude Code

Fangzhou-Ai and others added 2 commits October 11, 2026 02:53
The first layer and the Engram layers take K1 without the fold; the index
sources run vLLM's compressor and indexer between K1 and K2, which builds
the key table itself.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Fangzhou Ai <fangzhou.ai@amd.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Fangzhou Ai <fangzhou.ai@amd.com>
@mergify mergify Bot added deepseek Related to DeepSeek models DSv4.1 Related to DeepSeek-V4.1 models rocm Related to AMD ROCm labels Oct 11, 2026
@github-project-automation github-project-automation Bot moved this to Todo in AMD Oct 11, 2026
@Fangzhou-Ai
Fangzhou-Ai marked this pull request as ready for review October 11, 2026 20:13

@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.

@Fangzhou-Ai Fangzhou-Ai added the ready ONLY add when PR is ready to merge/full CI is needed label Oct 11, 2026
@Fangzhou-Ai

Copy link
Copy Markdown
Collaborator Author

/ci run

@github-actions

Copy link
Copy Markdown

✅ Triggered Buildkite CI #94092 for commit 489c78edffa8.

)
return out

def ffn(

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.

Question: Would we be able to get rid of the "just ffn" part now? Not necessarily in this PR but in a future one

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.

Great catch! yes that's my next plan, but before getting rid of that part. I would like to evaluate if it can be reused by dsv4 pro or not.

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.

Excellent, yes makes sense!

I think this also relates to a broader design choice mentioned in the RFC that we might have to think about:

There are two layer modes:

i.e. when developing the abstractions for mono, should we simply allow only "whole layer" mode or should we also allow more fine grained ops to be treated as monokernels. I'm planning on drafting a first suggestion on what this might look like based on the RFC + some of the other PRs

Replace the VLLM_ROCM_MONO_DECODE environment variable with a KernelConfig
field, set by --monokernel / --no-monokernel (RFC vllm-project#60904). It also works
from --kernel-config and the Python API, and stays in the compile hash.

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

Signed-off-by: Fangzhou Ai <fangzhou.ai@amd.com>
@ChuanLi1101

Copy link
Copy Markdown
Collaborator

LGTM. With --monokernel, all 40 backbone layers run as K1 + K2. Layer 0 and an Engram layer hand K1 a residual that is already settled. An index source runs the compressor and indexer between the two launches, and K2 builds the key table. The switch off still takes the original path.

seungrokj added a commit to SemiAnalysisAI/InferenceX that referenced this pull request Oct 13, 2026
…the diff / 按 diff 重写 DSv4.1-Flash MI355X vLLM 重测的 changelog 条目

- Update the image from nightly-rocm100-7d0b4e57aac4c4323225b0eee9ae960ce75ffffe to nightly-rocm100-5555a2d8f7116b2b4877f66516f4128176cf722a, the 2026-10-13 ROCm 10.0 nightly, which contains vllm-project/vllm#59039 and #61082. Update model.container to match.
- No point changes: concurrency 1, 2, 4, 8, 16, 32 and 64 on TP2 and TP4 (14 points), all re-measured on the new image.
- Remove --no-swa-bounded-replay, which turns on decoder SWA bounded replay from vllm-project/vllm#59039: in eager prefill steps, layer 20 (the last KV source layer) writes its KV for every token, and the rest of layer 20 and layers 21-39 run on each request's last 128 tokens only. Prefix-cache SWA replay stays off, since vLLM still forces it off on ROCm (the window clamp it needs lives only in the FlashInfer and FlashMLA prefill kernels).
- Replace VLLM_ROCM_MONO_DECODE=1 with --monokernel. vllm-project/vllm#61082 moves the switch to KernelConfig.monokernel and removes the environment variable, so the old setting would leave the mono decode kernels off.
- vllm-project/vllm#61082 also runs all 40 backbone layers whole as two persistent launches. Before, 30 ran whole and the other 10 (layers 0 and 1 and the compressor / indexer layers 2, 8, 14, 20, 24, 28, 32 and 36) kept vLLM's attention plus the FFN launch. The step limit is unchanged at 48 rows, i.e. concurrency 1-8 with five DSpark drafts; larger steps take the regular path.
- No data-type or precision change to the DSpark draft. The checkpoint's bundled mtp.0-2 stages are stored like the target's layers: FP8 E4M3 weights with 32x32 UE8M0 block scales for the attention projections, shared experts and main_proj; MXFP4 routed experts; BF16 norms, router gate, Markov head and confidence head; F32 attention sinks and hc mixers. vLLM builds the draft with the checkpoint's own quantization config (get_draft_quant_config) and, with no kv_cache_dtype in speculative-config, the target's fp8_ds_mla KV cache, so it runs as shipped. The mono decode kernels skip the draft layers, and the draft load path is the same in 7d0b4e57 and 5555a2d8.

- 镜像从 nightly-rocm100-7d0b4e57aac4c4323225b0eee9ae960ce75ffffe 更新为 nightly-rocm100-5555a2d8f7116b2b4877f66516f4128176cf722a,即 2026-10-13 的 ROCm 10.0 nightly,包含 vllm-project/vllm#59039 与 #61082。model.container 同步更新。
- 测试点不变:TP2 与 TP4 上并发 1、2、4、8、16、32、64(共 14 个点),全部在新镜像上重测。
- 移除 --no-swa-bounded-replay,从而启用 vllm-project/vllm#59039 的 decoder SWA bounded replay:在 eager prefill 步中,第 20 层(最后一个 KV 源层)为每个 token 写入 KV,第 20 层其余部分及第 21-39 层只在每个请求的最后 128 个 token 上运行。前缀缓存 SWA replay 仍然关闭,因为 vLLM 在 ROCm 上仍强制关闭它(所需的窗口钳制只存在于 FlashInfer 与 FlashMLA 的 prefill 内核中)。
- 将 VLLM_ROCM_MONO_DECODE=1 替换为 --monokernel。vllm-project/vllm#61082 把开关改为 KernelConfig.monokernel 并移除了该环境变量,保留旧设置会让 mono decode 内核处于关闭状态。
- vllm-project/vllm#61082 还让全部 40 个主干层整层以两次持久化内核启动运行。此前 30 层整层运行,其余 10 层(第 0、1 层以及 compressor / indexer 层 2、8、14、20、24、28、32、36)保留 vLLM 的 attention 并只走 FFN 启动。步长上限仍为 48 行,即 5 个 DSpark 草稿 token 下的并发 1-8;更大的步走常规路径。
- DSpark 草稿模型的数据类型与精度不变。checkpoint 自带的 mtp.0-2 阶段与目标模型各层的存储方式相同:attention 投影、shared experts 与 main_proj 为带 32x32 UE8M0 块缩放的 FP8 E4M3 权重;routed experts 为 MXFP4;norm、router gate、Markov head 与 confidence head 为 BF16;attention sink 与 hc mixer 为 F32。vLLM 用 checkpoint 自身的量化配置(get_draft_quant_config)构建草稿模型;speculative-config 未设置 kv_cache_dtype,因此沿用目标模型的 fp8_ds_mla KV cache,按原样运行。mono decode 内核跳过草稿层,草稿加载路径在 7d0b4e57 与 5555a2d8 中相同。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
seungrokj added a commit to SemiAnalysisAI/InferenceX that referenced this pull request Oct 13, 2026
…the diff

- Update the image from nightly-rocm100-7d0b4e57aac4c4323225b0eee9ae960ce75ffffe to nightly-rocm100-5555a2d8f7116b2b4877f66516f4128176cf722a, the 2026-10-13 ROCm 10.0 nightly, which contains vllm-project/vllm#59039 and #61082. Update model.container to match.
- No point changes: concurrency 1, 2, 4, 8, 16, 32 and 64 on TP2 and TP4 (14 points), all re-measured on the new image.
- Remove --no-swa-bounded-replay, which turns on decoder SWA bounded replay from vllm-project/vllm#59039: in eager prefill steps, layer 20 (the last KV source layer) writes its KV for every token, and the rest of layer 20 and layers 21-39 run on each request's last 128 tokens only. Prefix-cache SWA replay stays off, since vLLM still forces it off on ROCm (the window clamp it needs lives only in the FlashInfer and FlashMLA prefill kernels).
- Replace VLLM_ROCM_MONO_DECODE=1 with --monokernel. vllm-project/vllm#61082 moves the switch to KernelConfig.monokernel and removes the environment variable, so the old setting would leave the mono decode kernels off.
- vllm-project/vllm#61082 also runs all 40 backbone layers whole as two persistent launches. Before, 30 ran whole and the other 10 (layers 0 and 1 and the compressor / indexer layers 2, 8, 14, 20, 24, 28, 32 and 36) kept vLLM's attention plus the FFN launch. The step limit is unchanged at 48 rows, i.e. concurrency 1-8 with five DSpark drafts; larger steps take the regular path.
- No data-type or precision change to the DSpark draft. The checkpoint's bundled mtp.0-2 stages are stored like the target's layers: FP8 E4M3 weights with 32x32 UE8M0 block scales for the attention projections, shared experts and main_proj; MXFP4 routed experts; BF16 norms, router gate, Markov head and confidence head; F32 attention sinks and hc mixers. vLLM builds the draft with the checkpoint's own quantization config (get_draft_quant_config) and, with no kv_cache_dtype in speculative-config, the target's fp8_ds_mla KV cache, so it runs as shipped. The mono decode kernels skip the draft layers, and the draft load path is the same in 7d0b4e57 and 5555a2d8.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
edwingao28 pushed a commit to SemiAnalysisAI/InferenceX that referenced this pull request Oct 13, 2026
… --monokernel on the latest ROCm 10.0 nightly / [AMD][MI355X] DSv4.1 Flash vLLM:在最新 ROCm 10.0 nightly 上启用 SWA bounded replay 与 --monokernel 并重测 (#3959)

* perf(amd): re-sweep DSv4.1-Flash MI355X vLLM AgentX with SWA bounded replay and --monokernel / DSv4.1-Flash MI355X vLLM AgentX 启用 SWA bounded replay 与 --monokernel 并重测

Bump the image to nightly-rocm100-5555a2d8f7116b2b4877f66516f4128176cf722a, which contains vllm-project/vllm#59039 and #61082. Drop --no-swa-bounded-replay and replace VLLM_ROCM_MONO_DECODE=1 with --monokernel.

镜像更新至 nightly-rocm100-5555a2d8f7116b2b4877f66516f4128176cf722a,包含 vllm-project/vllm#59039 与 #61082。移除 --no-swa-bounded-replay,并用 --monokernel 取代 VLLM_ROCM_MONO_DECODE=1。

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

* fix(changelog): point the perf-changelog entry at PR 3959 / 将 perf-changelog 条目指向 PR 3959

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

* docs(changelog): describe the DSv4.1-Flash MI355X vLLM re-sweep from the diff

- Update the image from nightly-rocm100-7d0b4e57aac4c4323225b0eee9ae960ce75ffffe to nightly-rocm100-5555a2d8f7116b2b4877f66516f4128176cf722a, the 2026-10-13 ROCm 10.0 nightly, which contains vllm-project/vllm#59039 and #61082. Update model.container to match.
- No point changes: concurrency 1, 2, 4, 8, 16, 32 and 64 on TP2 and TP4 (14 points), all re-measured on the new image.
- Remove --no-swa-bounded-replay, which turns on decoder SWA bounded replay from vllm-project/vllm#59039: in eager prefill steps, layer 20 (the last KV source layer) writes its KV for every token, and the rest of layer 20 and layers 21-39 run on each request's last 128 tokens only. Prefix-cache SWA replay stays off, since vLLM still forces it off on ROCm (the window clamp it needs lives only in the FlashInfer and FlashMLA prefill kernels).
- Replace VLLM_ROCM_MONO_DECODE=1 with --monokernel. vllm-project/vllm#61082 moves the switch to KernelConfig.monokernel and removes the environment variable, so the old setting would leave the mono decode kernels off.
- vllm-project/vllm#61082 also runs all 40 backbone layers whole as two persistent launches. Before, 30 ran whole and the other 10 (layers 0 and 1 and the compressor / indexer layers 2, 8, 14, 20, 24, 28, 32 and 36) kept vLLM's attention plus the FFN launch. The step limit is unchanged at 48 rows, i.e. concurrency 1-8 with five DSpark drafts; larger steps take the regular path.
- No data-type or precision change to the DSpark draft. The checkpoint's bundled mtp.0-2 stages are stored like the target's layers: FP8 E4M3 weights with 32x32 UE8M0 block scales for the attention projections, shared experts and main_proj; MXFP4 routed experts; BF16 norms, router gate, Markov head and confidence head; F32 attention sinks and hc mixers. vLLM builds the draft with the checkpoint's own quantization config (get_draft_quant_config) and, with no kv_cache_dtype in speculative-config, the target's fp8_ds_mla KV cache, so it runs as shipped. The mono decode kernels skip the draft layers, and the draft load path is the same in 7d0b4e57 and 5555a2d8.

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

---------

Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-authored-by: seungrokj <seungrok.jung@amd.com>
amd-sriram added a commit to amd-sriram/vllm that referenced this pull request Oct 14, 2026
Main replaced VLLM_ROCM_MONO_DECODE with KernelConfig.monokernel (vllm-project#61082),
so the shared runtime reads the switch from the config. The spec also
refuses a bf16 KDA recurrent state (--mamba-ssm-cache-dtype, vllm-project#59147): the
kernel keeps it in fp32.

Signed-off-by: Sriram Kumar <skishore@amd.com>
maeehart added a commit to maeehart/vllm that referenced this pull request Oct 14, 2026
With --monokernel on gfx942, DeepSeek-V4.1-Flash decode steps run the mono decode kernels of vllm-project#60397. gfx942 has no scaled FP4 or FP8 MFMA and uses FNUZ FP8, so the kernels compute the same layer with FNUZ FP8 MFMAs on their own copies of the dense weights (mono/weights942.py) and dequantize the FP4 experts in VALU. The copies are made when vLLM processes the weights at load, so they count as model memory when vLLM sizes the KV cache, and a reload writes into them in place.

A gfx942 workgroup has 64 KB of LDS, so a GEMV pass takes 6 tokens instead of 16 and the kernels take decode steps of up to 42 rows at TP 4, which is 7 requests with 5 DSpark drafts. A larger step, prefill and a mixed step run vLLM's path.

Every backbone layer runs whole, as on gfx950 since vllm-project#61082. The index layers use vLLM's FP8 indexer, because the MXFP4 indexer cache needs CDNA4. On gfx942 mono/keylist.py writes an index layer's keys between vLLM's indexer and K2, and K2 is the build without the key table. The 3 DSpark draft layers also take the FFN launch, built for the draft's 128 experts and top 3.

The gfx942 helper ops are in vllm/models/deepseek_v41/amd/ops/: the sparse indexer's decode top-512 (topk512_gfx942.cu, built with hipcc when the model is created) and its candidate logits, the SWA decode metadata and the top-k packing as one launch each, and DSpark's Markov sampling as one launch a draft step. Each helper leaves a call it cannot take to vLLM's own op. They run only with --monokernel on gfx942. The helpers run in forward passes, so the model records the flag when it is created.

Two changes apply without the flag. On gfx942 the wvSplitK skinny GEMM takes at most 4 rows, because at 5 rows it read the DSpark draft's lm_head shard at 1.1 TB/s. The padding loops of _prepare_dflash_inputs_kernel step 1024 entries at a time instead of the step's block size.

The kernel tests in tests/kernels/test_dsv41_gfx942_*.py and tests/kernels/test_dsv41_mono_gfx942.py run in a new MI300 job in .buildkite/test_areas/kernels.yaml. tests/models/test_dsv41_mono_decode.py covers gfx942 too.

Signed-off-by: Markus Hartikainen <markus.hartikainen@amd.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
amd-sriram added a commit to amd-sriram/vllm that referenced this pull request Oct 15, 2026
Main replaced VLLM_ROCM_MONO_DECODE with KernelConfig.monokernel (vllm-project#61082),
so the shared runtime reads the switch from the config. The spec also
refuses a bf16 KDA recurrent state (--mamba-ssm-cache-dtype, vllm-project#59147): the
kernel keeps it in fp32.

Signed-off-by: Sriram Kumar <skishore@amd.com>
AndreasKaratzas pushed a commit to AndreasKaratzas/vllm that referenced this pull request Oct 16, 2026
…t#61082)

Signed-off-by: Fangzhou Ai <fangzhou.ai@amd.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

Signed-off-by: Andreas Karatzas <AndreasKaratzas@users.noreply.github.com>
wsantos pushed a commit to wsantos/vllm-rdna that referenced this pull request Oct 16, 2026
…t#61082)

The generic MonoKernel switch from upstream cc2a6ee: the
KernelConfig.monokernel field, the --monokernel kernel-group flag and its
transfer in create_engine_config. Models that cannot run their MonoKernel
refuse at startup with ValueError("--monokernel <reason>.").

Co-authored-by: Fangzhou Ai <fangzhou.ai@amd.com>
wsantos pushed a commit to wsantos/vllm-rdna that referenced this pull request Oct 16, 2026
…e RDNA2 parts

Restructure the gfx1030 MonoKernel to match AMD's upstream MonoKernels
(RFC vllm-project#60904, vllm-project#61082, vllm-project#61325). No kernel behaviour change.

Switch
* --monokernel (KernelConfig.monokernel, backported) turns on every
  validated part with the validated defaults: k1 (<= 24 rows), k2 (<= 8
  rows), gdn (<= 64 rows), qsa. VLLM_ROCM_MONO_DECODE=1 is an alias, read in
  the API server by the ROCm platform and carried to the workers by the
  config.
* Per-part knobs move to --additional-config '{"rocm_mono_decode": {...}}',
  read only with the flag; unknown keys are an error. The rdna_mono_* keys
  are gone.
* Unsupported deployments refuse at startup with
  ValueError("--monokernel <reason>."): not gfx10x, not Qwen4Exp, MoE not
  symmetric W4A16 on the RDNA2 method, not Model Runner V2, PP > 1,
  missing _rocm_C ops. One startup line per rank lists the active parts.
* The scoped HW-queue budget from monokernel/fg1-skew: with the flag the
  engine raises GPU_MAX_HW_QUEUES to 4 for the workers if the launcher set
  less (hw_queues knob).

Layout
* vllm/models/qwen4_exp/amd/mono_decode_rdna2.py: entry point (switch,
  refusals, hook installation).
* vllm/models/qwen4_exp/amd/mono/rdna2/{k1,k2,gdn,qsa,layout,debug}.py from
  mono_ffn.py and the GDN / QSA hunks; shared files keep short hooks
  (qwen_gdn_linear_attn.MONO_GDN_HOOK, ops.qsa.MONO_QSA).
* Torch ops vllm::qwen4_exp_mono_{k1,k2,gdn,mark}_rdna2 (one GDN op; the
  splitting-op list follows). HIP ops _rocm_C::mono_k1_rdna2 (was
  mono_hc_rdna2), mono_k2_rdna2* (was mono_ffn_rdna2*), mono_k2_rdna2_e1a
  (was the compiled-out E1a mono_gdn_rdna2), mono_gdn_rdna2* (was
  gdn_fused_rdna2*), mono_qsa_decode_rdna2* (was qsa_decode_rdna2*), in
  csrc/rocm/mono_{k2,gdn,qsa_decode}_rdna2.cu.

Tests: tests/models/qwen4_exp/test_amd_mono_rdna2{,_kernels}.py (switch,
refusals, parameters; K1/K2, GDN, QSA vs today's ops). Tools move to
tools/rdna/mono/ (serve_2a.sh uses --monokernel); docs/rdna2/tuning.md
gains the switch, docs/rdna/monokernel/ stays as history.
michael-gpu pushed a commit to practical-inference/vllm-ampere-extended that referenced this pull request Oct 20, 2026
…t#61082)

Signed-off-by: Fangzhou Ai <fangzhou.ai@amd.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
amd-sriram added a commit to amd-sriram/vllm that referenced this pull request Oct 22, 2026
Main replaced VLLM_ROCM_MONO_DECODE with KernelConfig.monokernel (vllm-project#61082),
so the shared runtime reads the switch from the config. The spec also
refuses a bf16 KDA recurrent state (--mamba-ssm-cache-dtype, vllm-project#59147): the
kernel keeps it in fp32.

Signed-off-by: Sriram Kumar <skishore@amd.com>
amd-sriram added a commit to amd-sriram/vllm that referenced this pull request Oct 24, 2026
Main replaced VLLM_ROCM_MONO_DECODE with KernelConfig.monokernel (vllm-project#61082),
so the shared runtime reads the switch from the config. The spec also
refuses a bf16 KDA recurrent state (--mamba-ssm-cache-dtype, vllm-project#59147): the
kernel keeps it in fp32.

Signed-off-by: Sriram Kumar <skishore@amd.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

deepseek Related to DeepSeek models DSv4.1 Related to DeepSeek-V4.1 models ready ONLY add when PR is ready to merge/full CI is needed rocm Related to AMD ROCm

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

5 participants