[Model Runner V2][MTP] Share topk index buffer between draft steps - #47352
Merged
WoosukKwon merged 2 commits intoAug 10, 2026
Merged
Conversation
TheEpicDolphin
force-pushed
the
mrv2-mtp-topk-index-sharing
branch
4 times, most recently
from
July 2, 2026 20:20
c3be20b to
6aa8615
Compare
TheEpicDolphin
marked this pull request as ready for review
July 2, 2026 20:41
TheEpicDolphin
requested review from
WoosukKwon,
njhill and
yewentao256
as code owners
July 2, 2026 20:41
TheEpicDolphin
force-pushed
the
mrv2-mtp-topk-index-sharing
branch
from
August 7, 2026 23:48
974e9f6 to
80c510e
Compare
Signed-off-by: Giancarlo Delfin <gdelfin@inferact.ai>
TheEpicDolphin
force-pushed
the
mrv2-mtp-topk-index-sharing
branch
from
August 7, 2026 23:56
80c510e to
bbdcdb5
Compare
Collaborator
|
/ci run |
|
✅ Triggered Buildkite CI #83222 for commit |
WoosukKwon
approved these changes
Aug 10, 2026
justtestingthingsx
pushed a commit
to meandmyboiclaude/vllm
that referenced
this pull request
Aug 22, 2026
…re-pads an already-padded layer to the shared page (boot AssertionError class); commensurate per-token-bytes zero guard; AR speculator draft-prefill dispatches on num_tokens_padded (restores upstream vllm-project#47352, reverted by carried vllm-project#48244 pick); gemma4_dspark + laguna_dflash fused-KV dtype derived from norm weight + bias cast (fp16 drafters); unpadded() propagates mm_req_doc_ranges; V1 runner zeroes padded-row num_prompt_tokens_cpu (stale-length dummy-row class); fused_recurrent + fused_sigmoid_gating INPLACE_FINAL_STATE load masked to the row (SM-fault class, mirrors vllm-project#50021's sibling bound); profile_cudagraph_memory empty-sample guard; TQ spec head_size_v; packed-codec (kvarn_/turboquant_) branch in _validate_cache_dtype logging; max_page_block_lcm includes padded-to-max layers (PR vllm-project#52804 intent) Co-Authored-By: Claude Fable 5 <noreply@anthropic.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.
Context
Deepseek-style topk index selection for MTP has a bug during proposal stage when the topk indices are shared among all MTP draft step forward passes. After the first draft step,
set_skip_topkis called on the MTP model to force the remaining draft steps to reuse the same topk indices values (held withintopk_indices_bufferof the attention module).This feature was introduce in #44420 for Model Runner V1.
This PR
Enable this feature for Model Runner V2. I didn't want to leak model-specific optimizations into
AutoRegressiveSpeculator, so i introduced a callback pattern. New optimizations/features that need to run at specific points during theproposeoperation can inherit from this class and override whatever methods are needed.The topk indexer sharing feature registers itself after
MTPSpeculatorloads its draft model. After determining whether the draft model is a MTP model that can do index sharing AND index sharing is enabled, it is added to the list of callback classes for the auto regressive speculator to call during prefill begin/end and multi step decode begin/end.Benchmarks
Server
Bench
Results