[PD] Allow decode radix cache and HiCache L1/L2 with DCP (#40263)
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -63,16 +63,6 @@ def handle_pd_disaggregation(server_args: ServerArgs) -> None:
|
|||||||
"mooncake, nixl, or fake for synthetic benchmarking, got "
|
"mooncake, nixl, or fake for synthetic benchmarking, got "
|
||||||
f"{cfg.disaggregation_transfer_backend!r}."
|
f"{cfg.disaggregation_transfer_backend!r}."
|
||||||
)
|
)
|
||||||
if cfg.disaggregation_decode_enable_radix_cache:
|
|
||||||
raise ValueError(
|
|
||||||
"PD decode DCP currently requires chunk cache; "
|
|
||||||
"--disaggregation-decode-enable-radix-cache is not supported."
|
|
||||||
)
|
|
||||||
if cfg.enable_hierarchical_cache:
|
|
||||||
raise ValueError(
|
|
||||||
"PD decode DCP currently requires chunk cache; "
|
|
||||||
"--enable-hierarchical-cache is not supported."
|
|
||||||
)
|
|
||||||
|
|
||||||
if cfg.disaggregation_mode == "decode":
|
if cfg.disaggregation_mode == "decode":
|
||||||
if cfg.disaggregation_decode_enable_radix_cache:
|
if cfg.disaggregation_decode_enable_radix_cache:
|
||||||
@@ -86,7 +76,7 @@ def handle_pd_disaggregation(server_args: ServerArgs) -> None:
|
|||||||
"--disaggregation-decode-enable-radix-cache is incompatible "
|
"--disaggregation-decode-enable-radix-cache is incompatible "
|
||||||
"with --disaggregation-transfer-backend fake"
|
"with --disaggregation-transfer-backend fake"
|
||||||
)
|
)
|
||||||
if cfg.speculative_algorithm is not None:
|
if cfg.speculative_algorithm not in (None, "DSPARK"):
|
||||||
raise ValueError(
|
raise ValueError(
|
||||||
"--disaggregation-decode-enable-radix-cache is incompatible "
|
"--disaggregation-decode-enable-radix-cache is incompatible "
|
||||||
"with speculative decoding "
|
"with speculative decoding "
|
||||||
|
|||||||
@@ -257,8 +257,8 @@ def build_kv_cache(
|
|||||||
|
|
||||||
# Decode-side radix cache supports SWA only through the unified tree, whose
|
# Decode-side radix cache supports SWA only through the unified tree, whose
|
||||||
# component pools preserve the full-attention prefix while transferring the
|
# component pools preserve the full-attention prefix while transferring the
|
||||||
# SWA window fresh. The legacy SWA cache and hybrid SSM pools remain
|
# SWA window fresh. Hybrid SSM/KDA uses UnifiedRadixCache's Mamba
|
||||||
# incompatible with the prefix-match-and-lock allocation path.
|
# component (match + lock + CoW), the same path as colocated serving.
|
||||||
if (
|
if (
|
||||||
get_disagg().disaggregation_decode_enable_radix_cache
|
get_disagg().disaggregation_decode_enable_radix_cache
|
||||||
and get_disagg().disaggregation_mode == "decode"
|
and get_disagg().disaggregation_mode == "decode"
|
||||||
@@ -287,11 +287,6 @@ def build_kv_cache(
|
|||||||
"--disaggregation-decode-enable-radix-cache does not support "
|
"--disaggregation-decode-enable-radix-cache does not support "
|
||||||
"SWA-compress models (e.g. Gemma4 / MiMo-V2) yet."
|
"SWA-compress models (e.g. Gemma4 / MiMo-V2) yet."
|
||||||
)
|
)
|
||||||
if is_hybrid_ssm:
|
|
||||||
raise ValueError(
|
|
||||||
"--disaggregation-decode-enable-radix-cache is incompatible "
|
|
||||||
"with Mamba/SSM models"
|
|
||||||
)
|
|
||||||
|
|
||||||
effective_chunked_prefill_size = get_schedule().chunked_prefill_size
|
effective_chunked_prefill_size = get_schedule().chunked_prefill_size
|
||||||
if model_config.is_multimodal and uses_transformers_backend:
|
if model_config.is_multimodal and uses_transformers_backend:
|
||||||
|
|||||||
@@ -1039,28 +1039,6 @@ class TestLoadBalanceMethod(unittest.TestCase):
|
|||||||
)
|
)
|
||||||
self.assertTrue(resolution_result(server_args, "disable_radix_cache"))
|
self.assertTrue(resolution_result(server_args, "disable_radix_cache"))
|
||||||
|
|
||||||
def test_pd_decode_dcp_rejects_radix_cache(self):
|
|
||||||
server_args = ServerArgs(
|
|
||||||
model_path="dummy",
|
|
||||||
disaggregation_mode="decode",
|
|
||||||
disaggregation_transfer_backend="nixl",
|
|
||||||
disaggregation_decode_enable_radix_cache=True,
|
|
||||||
dcp_size=4,
|
|
||||||
)
|
|
||||||
with self.assertRaisesRegex(ValueError, "currently requires chunk cache"):
|
|
||||||
handle_pd_disaggregation(server_args)
|
|
||||||
|
|
||||||
def test_pd_decode_dcp_rejects_hierarchical_cache(self):
|
|
||||||
server_args = ServerArgs(
|
|
||||||
model_path="dummy",
|
|
||||||
disaggregation_mode="decode",
|
|
||||||
disaggregation_transfer_backend="nixl",
|
|
||||||
enable_hierarchical_cache=True,
|
|
||||||
dcp_size=4,
|
|
||||||
)
|
|
||||||
with self.assertRaisesRegex(ValueError, "--enable-hierarchical-cache"):
|
|
||||||
handle_pd_disaggregation(server_args)
|
|
||||||
|
|
||||||
def test_pd_decode_radix_cache_rejects_hisparse(self):
|
def test_pd_decode_radix_cache_rejects_hisparse(self):
|
||||||
server_args = ServerArgs(
|
server_args = ServerArgs(
|
||||||
model_path="dummy",
|
model_path="dummy",
|
||||||
|
|||||||
Reference in New Issue
Block a user