Skip to content

[Nixl][PD] DCP support for MLA models - #50611

Merged
NickLucche merged 8 commits into
vllm-project:mainfrom
NickLucche:dcp/nixl-tpmapping
Aug 29, 2026
Merged

NickLucche merged 8 commits into
vllm-project:mainfrom
NickLucche:dcp/nixl-tpmapping

Conversation

@NickLucche

@NickLucche NickLucche commented Jul 31, 2026

Copy link
Copy Markdown
Member

Alternative to #38433 as we iterate on the design with @pisceskkk .

I feel this version is much closer to the changes we should see to the core files in terms of code structure and modifications to the workflow - it should result closer to injecting DCP login into current abstraction, rather than building something on the side.
However, it makes some significant assumptions to do that, described below.


NIXL P/D disaggregation assumed MLA's KV cache is fully duplicated across TP, so a remote rank only needs to be read once. Decode Context Parallel (DCP) breaks that: it shards KV by block across ranks.

  Producer  (dcp_size=4) -- KV sharded into 4 slices, one per rank
  +------+------+------+------+
  |  P0  |  P1  |  P2  |  P3  |
  +--+---+--+---+--+---+--+---+
     |      |      |      |
     v      v      v      v
  +------+------+------+------+
  |  D0  |  D1  |  D0  |  D1  |   <-  remote_rank % local_dcp_size == local_dcp_rank
  +------+------+------+------+
  Decoder   (dcp_size=2) -- each rank owns 2x the slice, reads 2 remote ranks

    D0 reads {P0, P2}   D1 reads {P1, P3}

Note

Key simplifying assumption: per side, dcp_size is either 1 (fully replicated, unchanged pre-existing behavior) or tp_size (fully sharded, disjoint 1/dcp_size slice per rank) — never partial (1 < dcp_size < tp_size).

This means DCP sharding and the old "multiple TP replicas, pick one canonically" logic never have to compose on the same side, which is what keeps the routing logic to three flat cases (both replicated / one-replicated-one-sharded / both-sharded) instead of a general partial-overlap solver.

Two supporting assumptions that follow from it:

  • DCP sizes across sides always divide one another (real deployments use power-of-two/highly-composite degrees) — avoids needing gcd/lcm logic, plain modulo suffices.
  • DCP shards at block granularity when a KV connector is attached (cp_kv_cache_interleave_size pinned to block_size) — this is quite fundamental. However I had to update a few attn backends to make sure they get the updated value.

Sweep

gsm8k eval sweep, ran at block_size=64 (128 needs this fix #51031) on deepseek-ai/DeepSeek-V2-Lite-Chat

Configuration Status Strict match
P TP4/DCP1 → D TP4/DCP1 PASS 0.6535253980288097
P TP2/DCP1 → D TP4/DCP1 PASS 0.6489764973464746
P TP4/DCP4 → D TP4/DCP4 PASS 0.6588324488248674
P TP4/DCP1 → D TP4/DCP4 PASS 0.6648976497346475
P TP4/DCP4 → D TP4/DCP1 PASS 0.6595905989385898
P TP2/DCP2 → D TP4/DCP4 PASS 0.6573161485974223
P TP2/DCP1 → D TP4/DCP4 PASS 0.6542835481425322

@mergify mergify Bot added the kv-connector label Jul 31, 2026
@mergify

mergify Bot commented Aug 4, 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, @NickLucche.

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

@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.

@NickLucche NickLucche added the ready ONLY add when PR is ready to merge/full CI is needed label Aug 6, 2026
@NickLucche

Copy link
Copy Markdown
Member Author

/ci run

@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown

✅ Triggered Buildkite CI #82667 for commit e4d32ec81fe9.

@NickLucche

Copy link
Copy Markdown
Member Author

/ci retry

@github-actions

Copy link
Copy Markdown

✅ Triggered Buildkite CI #85980 for commit 7a79d4664f70.

Signed-off-by: NickLucche <nicolo.lucchesi@mistral.ai>
@NickLucche

Copy link
Copy Markdown
Member Author

/ci retry

@github-actions

Copy link
Copy Markdown

✅ The previous CI build is still running: https://buildkite.com/vllm/ci/builds/85980

@NickLucche

Copy link
Copy Markdown
Member Author

/ci run

@github-actions

Copy link
Copy Markdown

✅ Triggered Buildkite CI #86145 for commit 86244e386bed.

@NickLucche
NickLucche merged commit 7f4793e into vllm-project:main Aug 29, 2026
162 checks passed
@github-project-automation github-project-automation Bot moved this from Ready to Done in NVIDIA Aug 29, 2026
Comment thread vllm/config/vllm.py
Comment on lines +2652 to +2667
if (
self.kv_transfer_config is not None
and self.kv_transfer_config.kv_connector is not None
and self.parallel_config.cp_kv_cache_interleave_size != local_block_size
):
interleave = self.parallel_config.cp_kv_cache_interleave_size
self.parallel_config.cp_kv_cache_interleave_size = local_block_size
logger.info_once(
"When using PD disaggregation with DCP "
"(decode_context_parallel_size=%d), "
"cp_kv_cache_interleave_size is automatically adjusted "
"from %d to block_size %d for block-level alignment.",
dcp_size,
interleave,
local_block_size,
)

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.

I think this conflicts with DCP + CPU offloading usecase, the previously working deployment now raises at

if self.dcp_world_size > 1 and self.cp_kv_cache_interleave_size > 1:
raise NotImplementedError(
"DCP sparse indexer currently supports only "
f"cp_kv_cache_interleave_size=1 (got "
f"{self.cp_kv_cache_interleave_size})."
)
due to cp_kv_cache_interleave_size guard.

I don't think either that adjustment here should be applied to "local" kv connectors like CPUOffloadingConnector, could we reduce the effective radius to only the NIXL case?

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.

Hotfix at #54457, although I haven't fully opt-out the cp_kv_cache_interleave_size for other connectors (haven't validated the accuracy for them), just CPU offloaders.

LucasWilkinson pushed a commit to neuralmagic/vllm that referenced this pull request Aug 31, 2026
Squash the four commits from vllm-project#50611.

Co-authored-by: QiuChunshuo <qiuchunshuo@huawei.com>

Signed-off-by: Nick Lucchesi <nicolo.lucchesi@mistral.ai>
Signed-off-by: Lucas Wilkinson <lwilkinson@neuralmagic.com>
am-cohere pushed a commit to am-cohere/vllm that referenced this pull request Sep 1, 2026
Signed-off-by: NickLucche <nicolo.lucchesi@mistral.ai>
Leoyzen pushed a commit to Leoyzen/vllm that referenced this pull request Sep 1, 2026
Signed-off-by: NickLucche <nicolo.lucchesi@mistral.ai>

Signed-off-by: Leoyzen <leoyzen@gmail.com>
Leoyzen added a commit to Leoyzen/vllm that referenced this pull request Sep 1, 2026
LopezCastroRoberto pushed a commit to LopezCastroRoberto/vllm that referenced this pull request Sep 1, 2026
Squash the four commits from vllm-project#50611.

Co-authored-by: QiuChunshuo <qiuchunshuo@huawei.com>

Signed-off-by: Nick Lucchesi <nicolo.lucchesi@mistral.ai>
Signed-off-by: Lucas Wilkinson <lwilkinson@neuralmagic.com>
(cherry picked from commit b133117)
mylibrar pushed a commit to tanyuqian/vllm that referenced this pull request Sep 3, 2026
Signed-off-by: NickLucche <nicolo.lucchesi@mistral.ai>
D-G-Dimitrov pushed a commit to D-G-Dimitrov/vllm that referenced this pull request Sep 5, 2026
Signed-off-by: NickLucche <nicolo.lucchesi@mistral.ai>
(cherry picked from commit 7f4793e)
LopezCastroRoberto pushed a commit to LopezCastroRoberto/vllm that referenced this pull request Sep 7, 2026
Squash the validated upstream PR into one provenance commit.
LucasWilkinson pushed a commit to LucasWilkinson/vllm that referenced this pull request Sep 8, 2026
Squash the validated upstream PR into one provenance commit.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kv-connector mrv2 Model Runner V2 specific nvidia ready ONLY add when PR is ready to merge/full CI is needed

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants