[Nixl][PD] DCP support for MLA models - #50611
Conversation
|
This pull request has merge conflicts that must be resolved before it can be |
c2f3f6b to
e4d32ec
Compare
|
/ci run |
|
✅ Triggered Buildkite CI #82667 for commit |
|
/ci retry |
|
✅ Triggered Buildkite CI #85980 for commit |
|
/ci retry |
|
✅ The previous CI build is still running: https://buildkite.com/vllm/ci/builds/85980 |
|
/ci run |
|
✅ Triggered Buildkite CI #86145 for commit |
| 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, | ||
| ) |
There was a problem hiding this comment.
I think this conflicts with DCP + CPU offloading usecase, the previously working deployment now raises at
vllm/vllm/v1/attention/backends/mla/indexer.py
Lines 543 to 548 in e79961c
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?
There was a problem hiding this comment.
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.
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>
Signed-off-by: NickLucche <nicolo.lucchesi@mistral.ai>
Signed-off-by: NickLucche <nicolo.lucchesi@mistral.ai> Signed-off-by: Leoyzen <leoyzen@gmail.com>
This reverts commit c1cb7d3.
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)
Signed-off-by: NickLucche <nicolo.lucchesi@mistral.ai>
Signed-off-by: NickLucche <nicolo.lucchesi@mistral.ai> (cherry picked from commit 7f4793e)
Squash the validated upstream PR into one provenance commit.
Squash the validated upstream PR into one provenance commit.
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.
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:
cp_kv_cache_interleave_sizepinned 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