Repository navigation
[Feature][PCP] Support APC and encoder-side SWA bounded replay for DeepSeek-V4.1-Flash - #62183
Merged
DarkLight1337 merged 2 commits intoOct 19, 2026
Conversation
Contributor
|
Documentation preview: https://vllm--62183.org.readthedocs.build/en/62183/ |
Enable prefix caching with bounded encoder replay on the standalone PCP path. Preserve gathered cache writes across replay while keeping decoder trimming disabled. Co-authored-by: OpenAI Codex <noreply@openai.com> Signed-off-by: wangyicong <wangyicong@bytedance.com>
wangyicong52
force-pushed
the
feat/support-encoder-replay-with-pcp
branch
from
October 17, 2026 12:38
ffa382f to
195ee5e
Compare
wangyicong52
marked this pull request as ready for review
October 17, 2026 15:28
wangyicong52
requested review from
AndreasKaratzas,
DarkLight1337 and
ywang96
as code owners
October 17, 2026 15:28
Contributor
Author
|
@LucasWilkinson and @ivanium, could you please take a look at this PR when you have time? It brings together the PCP and SWA bounded replay work that you’re leading, which I think is an important step toward improving dsv4.1 prefill performance when PCP is enabled. Thanks a lot! |
6 tasks done
Contributor
|
/ci run |
|
✅ @wangyicong52, CI is now available for this PR.
|
|
✅ Triggered Buildkite CI #95781 for commit |
Merged
6 tasks done
bantianyue
pushed a commit
to bantianyue/vllm
that referenced
this pull request
Oct 28, 2026
…epSeek-V4.1-Flash (vllm-project#62183) Signed-off-by: wangyicong <wangyicong@bytedance.com> Co-authored-by: OpenAI Codex <noreply@openai.com> Co-authored-by: Lucas Wilkinson <LucasWilkinson@users.noreply.github.com>
4 of 6 tasks
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.
Overview
Follow up on #59857 to enable automatic prefix caching (APC) together with encoder-side SWA bounded replay for DeepSeek-V4.1-Flash under PCP in a colocated model instance. The initial PCP implementation rejected APC; this change enables the PCP + APC + encoder-side replay combination.
Claims
Validation
Environment
vllm/vllm-openai:nightly-49cb2bbf71cfd36ee5aa33d1e184b1cddff55294Candidate launch command:
python -m vllm.entrypoints.cli.main serve /models/DeepSeek-V4.1-Flash \ --host 0.0.0.0 \ --port 18001 \ --served-model-name deepseek-v4.1-flash \ --language-model-only \ --tokenizer-mode deepseek_v41 \ --attention-backend FLASHMLA_SPARSE_DSV41 \ --kv-cache-dtype fp8_ds_mla \ --block-size 64 \ --tensor-parallel-size 2 \ --pipeline-parallel-size 1 \ --decode-context-parallel-size 1 \ --prefill-context-parallel-size 4 \ --enable-expert-parallel \ --all2all-backend allgather_reducescatter \ --engram-config '{"cpu_offload":true}' \ --moe-backend humming \ --max-model-len auto \ --max-num-batched-tokens 4096 \ --max-num-seqs 64 \ --gpu-memory-utilization 0.9 \ --enable-prefix-caching \ --swa-bounded-replay \ --enforce-eager \ --no-async-schedulingBaseline used the same command except:
Prefix-repetition performance
Both arms ran concurrently with byte-identical deterministic inputs:
Every measured request had exactly 1,152 input tokens and one output token. There were no failed requests or Pod restarts.
Full GSM8K
Both arms ran the same full 1,319-sample ModelScope test split:
EvalScope version: 1.11.1.
Paired outcomes were 1,277 both correct, 33 both wrong, 7 candidate-only correct, and 2 baseline-only correct. The exact two-sided McNemar p-value was
0.1797, so the observed+0.38 ppaccuracy difference is not statistically significant. Candidate GSM8K traffic recorded 674,816/803,206 local prefix-cache hit tokens (84.02%).Details
Reuse the existing scheduler replay boundary and padding kernel, stage replay starts per local PCP segment, mask each rank's own cacheable slots, and gather those slots back in the same rank-major order as KV publication. All ranks participate even when a peer has no replay rows; SWA and compressor scratch mappings stay unchanged. The additional slot metadata collective applies only to PCP batches with encoder replay enabled. Production changes are confined to DeepSeek-V4.1 files, with the existing non-PCP path and other PCP restrictions retained.
This does not duplicate #61554, which targets cold-prefill decoder trimming with prefix caching disabled. Enable APC and encoder-side replay with
--enable-prefix-caching --swa-bounded-replay. The supported scope is NVIDIA CUDA, MRV2, eager execution, synchronous scheduling and PP=DP=DCP=1. KV connectors, speculative decoding, microbatching and MegaMoE remain unsupported with PCP. AI assistance was used for implementation and Codex CLI review; human line-by-line review remains pending, while GPU/model validation is documented above.Pull Request Checklist
I used vLLM's
/pr-checklistskill. (Mandatory for agents, optional for humans).AI assistance was used during the creation of this PR.
Design Fit: Minimizes impact on core components, reuses existing functionality, and justifies added complexity.
Testing and Validation: Validates the change and ensures any added tests are meaningful and reliable, with CI coverage or documented CI resource constraints and validation performed outside CI.
Code Quality and Style: Keeps code and comments clear and concise, and updates relevant documentation and examples.
Pull Request Contents: Includes a brief summary and relevant links, supports claims with evidence, explains root causes and implementation trade-offs, and follows the contributing guide.