Skip to content

[Feature][DSv4.1] Enable PCP with PP or DP - #63098

Merged
LucasWilkinson merged 4 commits into
vllm-project:mainfrom
wangyicong52:feat/dsv41-pp-with-pcp
Oct 31, 2026
Merged

LucasWilkinson merged 4 commits into
vllm-project:mainfrom
wangyicong52:feat/dsv41-pp-with-pcp

Conversation

@wangyicong52

@wangyicong52 wangyicong52 commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Overview

Relax the model-level PCP compatibility checks for text-only DeepSeek-V4.1-Flash on NVIDIA CUDA to enable the existing PCP + PP and PCP + DP execution paths. The underlying MRV2 implementations are already provided by #59139 (PP) and #57075 (DP). No other open PR was found enabling these model-specific combinations; #49246's generic DP approach was superseded by #57075, while #63106 addresses cross-stage cache relay with PCP=1.

Claims

  • Remove the blanket PP=DP=1 restriction when PCP is enabled, allowing the existing PP or DP execution paths. Combining PP + DP is allowed when TP=1 or expert parallelism is disabled; DCP must remain 1.
  • Add PP2 + PCP2 and DP2 + PCP2 cases to the existing tests/models/test_deepseek_v41_pcp.py, using real-weight serving and generation.

Validation

Hardware: 1 node with 8 H20(96G) GPUs.

Image: vllm/vllm-openai:nightly-df3bd094aeea829f27baa0a5282830464f601d9f

Startup Command:

PP+PCP(VLLM_PP_LAYER_PARTITION=14,26οΌ‰οΌš

VLLM_PP_LAYER_PARTITION=14,26 vllm serve /models/DeepSeek-V4.1-Flash-1017 \
  --host 0.0.0.0 --port 18001 --served-model-name deepseek-v4.1-flash \
  --language-model-only --tokenizer-mode deepseek_v41 --distributed-executor-backend mp \
  --attention-backend FLASHMLA_SPARSE_DSV41 --kv-cache-dtype fp8_ds_mla --block-size 64 \
  --tensor-parallel-size 2 --pipeline-parallel-size 2 --data-parallel-size 1 \
  --decode-context-parallel-size 1 --prefill-context-parallel-size 2 \
  --enable-expert-parallel --all2all-backend allgather_reducescatter \
  --engram-config '{"cpu_offload":true}' --moe-backend humming --max-model-len 131072 \
  --max-num-batched-tokens 4096 --max-num-seqs 64 --gpu-memory-utilization 0.90 \
  --enable-chunked-prefill --enable-prefix-caching --swa-bounded-replay \
  --enforce-eager --no-async-scheduling --disable-uvicorn-access-log

DP+PCP:

vllm serve /models/DeepSeek-V4.1-Flash-1017 \
  --host 0.0.0.0 --port 18001 --served-model-name deepseek-v4.1-flash \
  --language-model-only --tokenizer-mode deepseek_v41 --distributed-executor-backend mp \
  --attention-backend FLASHMLA_SPARSE_DSV41 --kv-cache-dtype fp8_ds_mla --block-size 64 \
  --tensor-parallel-size 2 --pipeline-parallel-size 1 --data-parallel-size 2 \
  --decode-context-parallel-size 1 --prefill-context-parallel-size 2 \
  --enable-expert-parallel --all2all-backend allgather_reducescatter \
  --engram-config '{"cpu_offload":true}' --moe-backend humming --max-model-len 131072 \
  --max-num-batched-tokens 4096 --max-num-seqs 64 --gpu-memory-utilization 0.90 \
  --enable-chunked-prefill --enable-prefix-caching --swa-bounded-replay \
  --enforce-eager --no-async-scheduling --disable-uvicorn-access-log
  1. GSM8K
    • EvalScope 1.11.1,GSM8K full 1319,4-shot,batch 64,temperature 0,top_p 1,seed 42,max_tokens 8192。
    • PP+PCP:1286/1319 = 97.50%,0 API error。
    • DP+PCP:1282/1319 = 97.19%,0 API error。

Details

The runtime change is confined to the NVIDIA model's compatibility checks. PP/PCP execution, stage-entry Engram handling, and DP/EP communication reuse their existing implementations. The existing PCP test file adds generation cases for the newly enabled combinations: the PP case uses Flash's 14,26 partition, and the DP case sends a request to each replica.

With PCP enabled, PP>1 and DP>1 are rejected only when TP>1 and expert parallelism is enabled: PP currently disables the model's sequence-parallel path required by DP+PCP AgRs MoE communication in that topology. TP=1 or disabled expert parallelism passes this combined-topology gate; these additional combinations still require GPU validation. DCP must remain 1; KV transfer, microbatching, and MegaMoE remain disabled. Preserve main's fixed-length DSpark support with PP=1 and the existing PR's exclusion of speculative decoding with PCP + PP. Prefix caching still requires SWA bounded replay.

AI assistance was used to prepare this change. The human submitter remains responsible for line-by-line review; validation beyond the two configurations reported above remains pending.


Pull Request Checklist
  • I used vLLM's /pr-checklist skill. (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.

BEFORE SUBMITTING, PLEASE READ https://docs.vllm.ai/en/latest/contributing (anything written below this line will be removed by GitHub Actions)

@mergify

mergify Bot commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

Documentation preview: https://vllm--63098.org.readthedocs.build/en/63098/

@mergify mergify Bot added documentation Improvements or additions to documentation ci/build deepseek Related to DeepSeek models DSv4.1 Related to DeepSeek-V4.1 models kv-cache-manager labels Oct 22, 2026
@wangyicong52
wangyicong52 force-pushed the feat/dsv41-pp-with-pcp branch from 6b005fd to 6fde1ba Compare October 22, 2026 11:03
@wangyicong52
wangyicong52 force-pushed the feat/dsv41-pp-with-pcp branch from 6fde1ba to 1020d59 Compare October 22, 2026 11:28
@mergify

mergify Bot commented Oct 26, 2026

Copy link
Copy Markdown
Contributor

This pull request has merge conflicts that must be resolved before it can be
merged. Please rebase the PR, @wangyicong52.

https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork

@mergify mergify Bot added the needs-rebase label Oct 26, 2026
@wangyicong52
wangyicong52 force-pushed the feat/dsv41-pp-with-pcp branch from 324b006 to 33d1fb7 Compare October 27, 2026 02:50
@wangyicong52 wangyicong52 changed the title [Feature][DSv4.1] Support PP with PCP [Feature][DSv4.1] Support PCP with PP or DP Oct 27, 2026
@mergify

mergify Bot commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

Documentation preview: https://vllm--63098.org.readthedocs.build/en/63098/

@mergify mergify Bot removed the needs-rebase label Oct 27, 2026
@wangyicong52
wangyicong52 force-pushed the feat/dsv41-pp-with-pcp branch from 33d1fb7 to e567383 Compare October 27, 2026 03:02
Co-authored-by: Codex <noreply@openai.com>

Signed-off-by: wangyicong <wangyicong@bytedance.com>
@wangyicong52
wangyicong52 force-pushed the feat/dsv41-pp-with-pcp branch from e567383 to 2fbadce Compare October 27, 2026 03:27
@wangyicong52
wangyicong52 marked this pull request as ready for review October 27, 2026 06:33

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This pull request is from a fork β€” automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

@wangyicong52 wangyicong52 changed the title [Feature][DSv4.1] Support PCP with PP or DP [Feature][DSv4.1] Enable PCP with PP or DP Oct 27, 2026
and self.parallel_config.data_parallel_size > 1
and self.parallel_config.tensor_parallel_size > 1
and self.parallel_config.enable_expert_parallel
)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this whole if seems really complicated? can we simplify it / make it more readable? a 22 line condition is kinda crazy haha

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @LucasWilkinson, thanks for the feedback!

The corner case here is DP+PP+PCP with TP>1 and EP enabled. DP+TP+EP normally enables SP, but this model currently disables SP when PP is enabled. Although this may be an uncommon setup (actually no one wants such weird settings!), we should still reject it explicitly. I try to simplify the logic here but it still looks complex.

I think a cleaner solution might be to support PP+SP with a tiny change (see this draft). That would let us remove this complex check altogether. What do you think of that approach?

Restore TP-replicated hidden states and pre-mix at PP stage exits, and shard the incoming pre-mix with the next stage inputs.

Co-authored-by: Codex <noreply@openai.com>
Signed-off-by: wangyicong <wangyicong@bytedance.com>
Remove the combined PP/DP/TP/EP rejection now that PP boundaries preserve sequence-parallel inputs.

Co-authored-by: Codex <noreply@openai.com>
Signed-off-by: wangyicong <wangyicong@bytedance.com>
@wangyicong52

wangyicong52 commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor Author

Validation update (head: 3264c91):

  • Image: vllm/vllm-openai:nightly-edad8b03c5285a1c12e7e4f83c1af709b319a01b
  • Hardware: 2 nodes, 8x NVIDIA H20 (96 GB) per node
  • Parallelism: DP2 / PP2 / TP2 / PCP2 / EP, DCP1 (16 GPUs total)
  • GSM8K (full 1,319 samples, 4-shot, seed 42, temperature 0, top_p 1, max_tokens 8192): 1278/1319 = 96.89%, 0 API errors, exit code 0.

Hey @LucasWilkinson, could you take another look when you have a chance? Since PCP now supports nearly all parallelism combinations (except for dcp), the if check can be simplified.

@LucasWilkinson LucasWilkinson left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@LucasWilkinson

Copy link
Copy Markdown
Contributor

/ci run

@github-actions

Copy link
Copy Markdown

βœ… Triggered Buildkite CI #98798 for commit 042667066351.

@LucasWilkinson
LucasWilkinson merged commit 2b009fc into vllm-project:main Oct 31, 2026
73 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci/build deepseek Related to DeepSeek models documentation Improvements or additions to documentation DSv4.1 Related to DeepSeek-V4.1 models kv-cache-manager

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants