From b32231b1a199b77e6f34ba483e7eecfa71b0671e Mon Sep 17 00:00:00 2001 From: Matej Sirovatka Date: Fri, 12 Jun 2026 14:15:45 +0000 Subject: [PATCH] Relax routed_experts capture KV-connector check to a warning for P/D --enable-return-routed-experts currently hard-rejects any KV-transfer instance. That blocks P/D disaggregation, where the routing captured on the prefill replica simply needs to be spliced into the decode response by the router/proxy (the decode replica pulls the prompt KV and never forwards the prompt, so its prompt-region rows are invalid). Routers/proxies can and now do perform this merge, so for a P/D setup this is a deployment concern, not a hard error. Replace the ValueError for KV-transfer instances with a warning: 'You are using P/D disaggregation with routed_experts capture, for this to work your router/proxy needs to support it'. The PP>1 incompatibility is unchanged. Note: kv_role alone cannot distinguish P/D transfer from single-instance KV offload (NixlConnector P/D itself runs as kv_both), which is why this is a warning rather than a role-gated error. Signed-off-by: Matej Sirovatka --- vllm/config/vllm.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/vllm/config/vllm.py b/vllm/config/vllm.py index 890d2b72e317..b18d622ed1a3 100644 --- a/vllm/config/vllm.py +++ b/vllm/config/vllm.py @@ -868,18 +868,19 @@ def __post_init__(self): "pipeline parallelism (PP > 1)." ) - # Incompatible with any KV connector — covers both PD disaggregation - # (kv_producer/kv_consumer: routing captured on P can't reach D) and - # single-instance KV offload/sharing (kv_both: slot_mapping semantics - # change when KV blocks live outside local GPU memory, breaking the - # slot-indexed routed_experts buffer). + # KV connectors for P/D disaggregation are allowed: the decode + # replica pulls the prompt KV and never forwards the prompt, so its + # prompt-region routing is invalid, but a P/D-aware router/proxy can + # splice the prefill replica's routing back in. kv_role cannot tell + # P/D transfer from single-instance KV offload (NixlConnector P/D + # runs as kv_both), so this is a warning rather than an error. if ( self.kv_transfer_config is not None and self.kv_transfer_config.is_kv_transfer_instance ): - raise ValueError( - "--enable-return-routed-experts is incompatible with KV " - "connectors (PD disaggregation, KV cache offload)." + logger.warning( + "You are using P/D disaggregation with routed_experts capture, " + "for this to work your router/proxy needs to support it" ) if self.lora_config is not None: