[DSv4 Perf] Adaptive topk width, 1.0% E2E throughput improvement - #50004
Merged
Conversation
Signed-off-by: yewentao256 <zhyanwentao@126.com>
yewentao256
requested review from
AndreasKaratzas,
WoosukKwon,
mgoin,
tlrmchlsmth and
zyongye
as code owners
July 27, 2026 15:32
There was a problem hiding this comment.
Claude Code Review
This repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.
Tip: disable this comment in your organization's Code Review settings.
21 tasks
sfeng33
approved these changes
Jul 27, 2026
allenh1
pushed a commit
to allenh1/vllm
that referenced
this pull request
Aug 5, 2026
Conflicts in 13 files. Substantive resolutions: - sparse_mla C128A metadata: adopt upstream's adaptive topk width (vllm-project#50004, next_power_of_2 + tightly packed views) and drop our 128-aligned _c128a_effective_topk_width and its test. Upstream already avoids the device sync we were guarding against, and packed views make our fill_(-1) pre-init unnecessary. PR jasl#27's shared decode/prefill buffer is orthogonal and kept, so upstream's new packed-buffer test is adapted to the single buffer and gains a non-aliasing assertion. - _mtp_hidden_buffer: keep our narrow predicate, not upstream's use_eagle() or uses_draft_model(). Both readers of get_mtp_target_hidden_states() are gated on method == "mtp", and the DFlash speculator consumes aux hidden states instead, so upstream's predicate reserves ~470 MiB for drafters that never read it. - combine_topk_swa_indices: adopt upstream's out=(indices, lens) signature, keep our validation and fill_(-1). Upstream's own no-out path uses torch.full(-1) precisely because the kernel does not write every column, so its out path leaks stale rows into a caller-supplied buffer. - DSpark naming: adopt upstream's rename wholesale (DeepSeekV4DSparkModel -> DSparkDraftModel, DeepSeekV4DSpark -> DSparkDeepseekV4ForCausalLM) across registry, package __init__ and speculative config. The merge had silently left AMD/XPU on upstream's new class name and NVIDIA on ours, with __init__ importing only the latter -- no conflict markers, still broken on ROCm/XPU. Our only retained delta is defaulting dspark num_speculative_tokens from dspark_block_size. - config/vllm: take upstream's PCP-implies-V2 rule; do NOT take its force-routing of DSpark to V2 (V1 has correct long-context recall on our stack, V2 collapses under concurrency) and keep DeepSeek-V4 out of the breakable-cudagraph auto-enable set (measured 1.5-3.8x slower MTP decode). Upstream's new KimiK3/KimiLinear architectures are added to that set so they are not collaterally excluded. - warmup: rebase kernel_warmup.py onto upstream's per-concern module split and move our 11 DSv4 passes into a new deepseek_v4_sm12x_warmup module. Retires our _attention_backend_name / _clamp_warmup_tokens / _has_deepseek_v4_sparse_mla_backend in favour of upstream's now-identical ones. Our sparse-MLA pass is a superset of upstream's (adds prefill and MTP uniform-decode shapes), so both run. - kv_offload spec/config and flashmla: keep our compact-offload and Triton indexed-D512 prefill paths, adopt upstream's cache_policy_module_path, SharedOffloadRegion mmap path and AttentionSpec dcp guard. 837 changed .py files compile; all 11 fork mechanisms present. Not yet built or gated.
zyongye
pushed a commit
that referenced
this pull request
Aug 21, 2026
khushali9
pushed a commit
to khushali9/vllm
that referenced
this pull request
Aug 29, 2026
…ack (vllm-project#52823) Signed-off-by: yewentao256 <zhyanwentao@126.com> Signed-off-by: khushali9 <khushali.desai9@gmail.com>
am-cohere
pushed a commit
to am-cohere/vllm
that referenced
this pull request
Sep 1, 2026
…ack (vllm-project#52823) Signed-off-by: yewentao256 <zhyanwentao@126.com>
mikeshawcode
pushed a commit
to mikeshawcode/vllm
that referenced
this pull request
Sep 1, 2026
…ack (vllm-project#52823) Signed-off-by: yewentao256 <zhyanwentao@126.com> Signed-off-by: mikeshawcode <michaelwshaw2@gmail.com>
mikeshawcode
pushed a commit
to mikeshawcode/vllm
that referenced
this pull request
Sep 1, 2026
…ack (vllm-project#52823) Signed-off-by: yewentao256 <zhyanwentao@126.com> Signed-off-by: mikeshawcode <michaelwshaw2@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
Let's assume token num = 2
Originally: Always use maximum length
Now based on current context
Test
Acc
Perf
vllm bench serve \ --backend openai \ --base-url http://127.0.0.1:8000 \ --endpoint /v1/completions \ --model "$MODEL" \ --served-model-name dsv4-pro \ --dataset-name random \ --random-input-len 8192 \ --random-output-len 1 \ --random-range-ratio 0 \ --num-prompts 32 \ --num-warmups 4 \ --request-rate inf \ --max-concurrency 1 \ --ignore-eos \