[Model Runner V2][Spec Decode] Reduce TP communication for draft token generation - #46448
Merged
vllm-bot merged 4 commits intoJun 26, 2026
Merged
Conversation
Signed-off-by: EanWang211123 <wangyiheng@sangfor.com.cn>
EanWang211123
requested review from
WoosukKwon,
njhill and
yewentao256
as code owners
June 23, 2026 06:41
benchislett
enabled auto-merge (squash)
June 25, 2026 00:55
mgoin
approved these changes
Jun 26, 2026
wincent8
pushed a commit
to wincent8/vllm
that referenced
this pull request
Jun 29, 2026
…n generation (vllm-project#46448) Signed-off-by: EanWang211123 <wangyiheng@sangfor.com.cn> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
philippesic
pushed a commit
to philippesic/vllm-semantic-cache
that referenced
this pull request
Jul 19, 2026
…n generation (vllm-project#46448) Signed-off-by: EanWang211123 <wangyiheng@sangfor.com.cn> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.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
use_local_argmax_reductionis already supported in the V1 speculative decoding path (SpecDecodeBaseProposer), but Model Runner V2 draft sampling inDraftModelSpeculatorstill always callscompute_logits()and all-gathers full vocabulary logits before argmax. This PR wires the existing config flag into the MR V2 greedy draft path viaget_top_tokens(), reducing TP communication from O(vocab_size) to O(2 × tp_size) per token. All MR V2 speculators that inheritDraftModelSpeculator(DFlash, Eagle, MTP, Gemma4 MTP, etc.) benefit from this single change.Summary of Changes
File:
vllm/v1/worker/gpu/spec_decode/speculator.pyonly.Read
use_local_argmax_reductionfromspeculative_configinDraftModelSpeculator.__init__.Add
_validate_local_argmax_reduction()(called fromload_model):draft_sample_method='probabilistic'.get_top_tokens().Add
_greedy_sample_draft()and route greedy sampling throughget_top_tokens()when the flag is enabled; otherwise keepcompute_logits().argmax().Refactor
sample_draft(): probabilistic path unchanged; greedy path uses_greedy_sample_draft().All MR V2 speculators inheriting
DraftModelSpeculator(DFlash, Eagle, MTP, Gemma4 MTP, etc.) pick up this change with no subclass edits. Default remains off (no behavior change).Test
Environment
Models
Qwen3-8BQwen3-8B-DFlash-b16(method=dflash,num_speculative_tokens=15)Benchmark
openai_human_eval)Commands
Baseline (default,
use_local_argmax_reduction=false):CUDA_VISIBLE_DEVICES=4,5 vllm serve /nfs_models/Qwen/Qwen3-8B \ --host 0.0.0.0 --port 8000 --served-model-name Qwen3-8B \ --tensor-parallel-size 2 --trust-remote-code --dtype auto \ --max-model-len 8192 --max-num-seqs 64 --max-num-batched-tokens 8192 \ --gpu-memory-utilization 0.90 \ --speculative-config '{"method":"dflash","model":"/nfs_models/z-lab/Qwen3-8B-DFlash-b16/","num_speculative_tokens":15}'With local argmax:
CUDA_VISIBLE_DEVICES=4,5 vllm serve /nfs_models/Qwen/Qwen3-8B \ ... \ --speculative-config '{"use_local_argmax_reduction":true,"method":"dflash","model":"/nfs_models/z-lab/Qwen3-8B-DFlash-b16/","num_speculative_tokens":15}'Results
use_local_argmax_reduction=true~+7.8% throughput, ~−8.3% TPOT on 4090×2 TP=2.
Essential Elements of an Effective PR Description Checklist
supported_models.mdandexamplesfor a new model.cc @benchislett