Revert DSv4 eager workspace reuse - #52836
Merged
Merged
Conversation
WoosukKwon
marked this pull request as ready for review
August 18, 2026 21:43
WoosukKwon
requested review from
AndreasKaratzas,
mgoin,
tlrmchlsmth,
yewentao256 and
zyongye
as code owners
August 18, 2026 21:43
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.
Contributor
|
Hi @WoosukKwon, the pre-commit checks have failed. Please run: uv pip install pre-commit>=4.5.1
pre-commit install
pre-commit run --all-filesThen, commit the changes and push to your branch. For future commits, |
Collaborator
Author
|
/ci run |
|
✅ Triggered Buildkite CI #84486 for commit |
wenhuach21
pushed a commit
to wenhuach21/vllm
that referenced
this pull request
Aug 19, 2026
Signed-off-by: Woosuk Kwon <woosuk@inferact.ai> Co-authored-by: OpenAI Codex <codex@openai.com> Signed-off-by: Wenhua Cheng <wenhua.cheng@intel.com>
randomvariable
added a commit
to randomvariable/vllm
that referenced
this pull request
Aug 19, 2026
…-applied Pair B crash-looped on model load with AttributeError: 'DeepseekV4Model' object has no attribute 'eager_scratch_pool' Upstream f1178f3 ("Revert DSv4 eager workspace reuse", vllm-project#52836) removed the pool: its construction in DeepseekV4Model, the parameters that threaded it down to the decoder layer, attention, indexer and compressor, the `*_out` kernel variants that wrote into it, and eager_scratch.py itself. The rebase took the half that deletes the construction and the C++ ops, and kept the half that still reads `self.eager_scratch_pool` and passes it down -- so the very first `make_layers` lambda dereferenced an attribute nothing assigns. Nothing in the CPU suites constructs DeepseekV4Model, so the reference only failed on a GPU worker, i.e. as a crash-looping serving pod. Completing the revert rather than restoring the pool: the kernels it fed are gone from csrc (`fused_deepseek_v4_qnorm_rope_kv_rope_quant_insert_out` and the `output_buffers` paths in `compute_global_topk_indices_and_lens`), so reinstating the Python side would only fail later, at the op lookup. Removed the dangling `eager_scratch_pool` parameters and the branches guarded on them, the orphaned `output_buffers` handling left in `fused_indexer_q_rope_quant`, and eager_scratch.py, whose last consumer this was. Co-authored-by: OMP Agent <noreply@omp.local> Signed-off-by: Naadir Jeewa <naadir@randomvariable.co.uk>
zyp2014
pushed a commit
to zyp2014/vllm
that referenced
this pull request
Aug 21, 2026
Signed-off-by: Woosuk Kwon <woosuk@inferact.ai> Co-authored-by: OpenAI Codex <codex@openai.com>
wyettzeng
pushed a commit
to wyettzeng/vllm
that referenced
this pull request
Aug 21, 2026
Signed-off-by: Woosuk Kwon <woosuk@inferact.ai> Co-authored-by: OpenAI Codex <codex@openai.com> Signed-off-by: Wyett <wyettzeng@gmail.com>
This was referenced Aug 23, 2026
randomvariable
added a commit
to randomvariable/vllm
that referenced
this pull request
Aug 23, 2026
…-applied Pair B crash-looped on model load with AttributeError: 'DeepseekV4Model' object has no attribute 'eager_scratch_pool' Upstream f1178f3 ("Revert DSv4 eager workspace reuse", vllm-project#52836) removed the pool: its construction in DeepseekV4Model, the parameters that threaded it down to the decoder layer, attention, indexer and compressor, the `*_out` kernel variants that wrote into it, and eager_scratch.py itself. The rebase took the half that deletes the construction and the C++ ops, and kept the half that still reads `self.eager_scratch_pool` and passes it down -- so the very first `make_layers` lambda dereferenced an attribute nothing assigns. Nothing in the CPU suites constructs DeepseekV4Model, so the reference only failed on a GPU worker, i.e. as a crash-looping serving pod. Completing the revert rather than restoring the pool: the kernels it fed are gone from csrc (`fused_deepseek_v4_qnorm_rope_kv_rope_quant_insert_out` and the `output_buffers` paths in `compute_global_topk_indices_and_lens`), so reinstating the Python side would only fail later, at the op lookup. Removed the dangling `eager_scratch_pool` parameters and the branches guarded on them, the orphaned `output_buffers` handling left in `fused_indexer_q_rope_quant`, and eager_scratch.py, whose last consumer this was. Co-authored-by: OMP Agent <noreply@omp.local> Signed-off-by: Naadir Jeewa <naadir@randomvariable.co.uk>
zufangzhu
pushed a commit
to zufangzhu/vllm
that referenced
this pull request
Aug 24, 2026
Signed-off-by: Woosuk Kwon <woosuk@inferact.ai> Co-authored-by: OpenAI Codex <codex@openai.com> Signed-off-by: Zhu, Zufang <zufang.zhu@intel.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.
Summary
Revert #49236 and restore allocator-backed temporary buffers in the DeepSeek V4 attention input-preparation path.
This removes the model-wide
DeepseekV4EagerScratchPool, its output-buffer plumbing, and the out-parameter fused op added by #49236. Later changes onmainare preserved.Why
The model-wide scratch pool can reuse storage across layers and CUDA streams without the caching allocator's stream/event lifetime tracking. That allows a producer to overwrite shared workspace while a previous consumer may still be using it. Reverting restores the pre-#49236 allocation lifetime behavior until safe cross-stream synchronization is implemented.
Impact
#51430 moved Q projection/KV insertion, indexer preparation, and compressor preparation out of the narrow eager break and into the captured region. The allocator calls restored by this revert are therefore captured on the Model Runner V2 path, so this revert is not expected to give up the 3.9% TTFT improvement originally reported by #49236 there.
#52401 subsequently restored the wide eager region for Model Runner V1 because the narrow region corrupted V1 output. The allocation overhead remains eager on that path, so its TTFT impact is runner-dependent and has not been measured on the current tree.
Duplicate-work check
This is not duplicating an existing revert. I checked issue #45861 and searched open PRs for references to #49236 and for DeepSeek V4 workspace/eager-scratch reuse. No open PR is dedicated to reverting #49236.
Validation
git diff --cached --check— passed before commitgit diff --cached --name-only --diff-filter=ACMR -z | xargs -0 .venv/bin/pre-commit run --files— passed.venv/bin/python -m pytest tests/kernels/test_compressor_kv_cache.py tests/kernels/test_fused_deepseek_v4_qnorm_rope_kv_insert.py tests/kernels/test_fused_indexer_q_rope_quant.py -v— 240 passed, 11 skippedModel evaluation
Not run: the DeepSeek V4 checkpoint is not available in the local Hugging Face cache. This PR remains a draft; DeepSeek-V4-Flash TP4 serving and GSM8K evaluation should be completed before it is marked ready.
AI assistance
OpenAI Codex was used to prepare the revert, resolve conflicts with later
mainchanges, run validation, and draft this description. The human submitter must review every changed line and understand and defend the change end-to-end before marking the PR ready.