[PCP][Spec Decode] Adds PCP support for single-module MTP and replicated DSpark. (#56107)

Signed-off-by: Summer Yang <girasoleyang@gmail.com>
Signed-off-by: Lucas Wilkinson <lwilkins@redhat.com>
Co-authored-by: Summer Yang <girasoleyang@gmail.com>
Co-authored-by: OpenAI Codex <codex@openai.com>
Co-authored-by: OpenAI Codex <noreply@openai.com>
This commit is contained in:
Lucas Wilkinson
2026-09-10 22:07:53 -07:00
committed by GitHub
co-authored by Summer Yang OpenAI Codex OpenAI Codex
parent e7edf17cea
commit 980c16c8e4
11 changed files with 159 additions and 79 deletions
+7 -3
View File
@@ -18,16 +18,20 @@ else:
logger = init_logger(__name__)
def check_attention_cp_compatibility(vllm_config: VllmConfig) -> None:
def check_attention_cp_compatibility(
vllm_config: VllmConfig,
target_layer_names: set[str] | None = None,
) -> None:
pcp_size = vllm_config.parallel_config.prefill_context_parallel_size
dcp_size = vllm_config.parallel_config.decode_context_parallel_size
interleave_size = vllm_config.parallel_config.cp_kv_cache_interleave_size
if pcp_size * dcp_size > 1:
layer_type = cast(type[Any], AttentionLayerBase)
layers = get_layers_from_vllm_config(vllm_config, layer_type)
for layer in layers.values():
for layer_name, layer in layers.items():
check_pcp = target_layer_names is None or layer_name in target_layer_names
get_attn_backend = getattr(layer, "get_attn_backend", None)
if pcp_size > 1 and get_attn_backend is not None:
if pcp_size > 1 and check_pcp and get_attn_backend is not None:
backend = get_attn_backend()
assert backend.supports_pcp(), (
"PCP requires attention backend support, "