[PCP][DCP] Support DCP target model with non-DCP Dspark (#56723)
Signed-off-by: Lucas Wilkinson <lwilkins@redhat.com> Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com> Co-authored-by: Codex <noreply@openai.com>
This commit is contained in:
co-authored by
Claude Opus 5
Codex
parent
77871126f9
commit
927c87b347
@@ -59,7 +59,6 @@ from vllm.platforms import current_platform
|
||||
from vllm.utils.math_utils import cdiv
|
||||
from vllm.v1.attention.backend import AttentionMetadata
|
||||
from vllm.v1.core.kv_cache_utils import (
|
||||
dcp_world_size_for_kv_cache_spec,
|
||||
resolve_dcp_kv_block_size,
|
||||
)
|
||||
from vllm.v1.kv_cache_interface import (
|
||||
@@ -259,13 +258,7 @@ class DecodeBenchConnectorScheduler:
|
||||
dcp_world_size = vllm_config.parallel_config.decode_context_parallel_size
|
||||
self.kv_cache_groups = kv_cache_config.kv_cache_groups
|
||||
self.group_block_sizes = tuple(
|
||||
resolve_dcp_kv_block_size(
|
||||
group.kv_cache_spec,
|
||||
dcp_world_size_for_kv_cache_spec(
|
||||
group.kv_cache_spec,
|
||||
dcp_world_size,
|
||||
),
|
||||
)
|
||||
resolve_dcp_kv_block_size(group.kv_cache_spec, dcp_world_size)
|
||||
for group in self.kv_cache_groups
|
||||
)
|
||||
|
||||
|
||||
@@ -1583,6 +1583,14 @@ def get_dcp_group() -> GroupCoordinator:
|
||||
return _DCP
|
||||
|
||||
|
||||
def get_dcp_world_size_and_rank(enabled: bool = True) -> tuple[int, int]:
|
||||
"""Return ``(world_size, rank)`` in the DCP group, or ``(1, 0)`` when disabled
|
||||
(e.g. a replicated draft cache) or the group is uninitialized (unit tests)."""
|
||||
if not enabled or _DCP is None:
|
||||
return 1, 0
|
||||
return _DCP.world_size, _DCP.rank_in_group
|
||||
|
||||
|
||||
_PP: GroupCoordinator | None = None
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user