[CPU] Remove speculative decoding stream overrides from CPUModelRunner#47162
Merged
bigPYJ1151 merged 2 commits intoJul 1, 2026
Merged
Conversation
Remove 4 CPU-specific method overrides (_copy_draft_token_ids_to_cpu, _get_draft_token_ids_cpu, _copy_valid_sampled_token_count, _get_valid_sampled_token_count) that are no longer needed thanks to the monkey patches in shm.py. The GPU code path now works correctly on CPU with _StreamPlaceholder and _EventPlaceholder handling all CUDA stream/event operations as no-ops. Also adds `device` and `wait_stream` attributes to _StreamPlaceholder in both shm.py and _torch_cuda_wrapper to satisfy torch.cuda.stream() context manager requirements. Reduces maintenance burden — CPU backend automatically inherits future GPU speculative decoding improvements without manual overrides. Signed-off-by: jmamou <[email protected]>
jmamou
marked this pull request as ready for review
June 30, 2026 13:40
bigPYJ1151
enabled auto-merge (squash)
July 1, 2026 04:26
jakki-amd
pushed a commit
to jakki-amd/vllm
that referenced
this pull request
Jul 6, 2026
lkk12014402
pushed a commit
to lkk12014402/vllm
that referenced
this pull request
Jul 8, 2026
mayuyuace
pushed a commit
to mayuyuace/vllm
that referenced
this pull request
Jul 9, 2026
vllm-project#47162) Signed-off-by: jmamou <[email protected]> Signed-off-by: mayuyuace <[email protected]>
noooop
pushed a commit
to noooop/vllm
that referenced
this pull request
Jul 9, 2026
vllm-project#47162) Signed-off-by: jmamou <[email protected]> Signed-off-by: wang.yuqi <[email protected]>
philippesic
pushed a commit
to philippesic/vllm-semantic-cache
that referenced
this pull request
Jul 19, 2026
plasticchris
pushed a commit
to plasticchris/vllm
that referenced
this pull request
Jul 20, 2026
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.
Summary
_copy_draft_token_ids_to_cpu,_get_draft_token_ids_cpu,_copy_valid_sampled_token_count,_get_valid_sampled_token_count) fromCPUModelRunnerthat are no longer needed thanks to the monkey patches invllm/v1/worker/cpu/shm.py_StreamPlaceholderand_EventPlaceholderdeviceandwait_streamattributes to_StreamPlaceholder(in bothshm.pyand_torch_cuda_wrapper) to satisfytorch.cuda.stream()context manager andstream.wait_stream()callsThis reduces maintenance burden and improves feature stability — the CPU backend now automatically inherits any future improvements to the GPU speculative decoding path without needing manual overrides.
Performance
No regression — TPOT is identical within noise (Xeon 8580, 120 cores, Llama-3.1-8B + Llama-3.2-1B draft, K=7):
Test plan
@bigPYJ1151