[PD] Remove outdated backend whitelist for decode radix cache (#28238)

Signed-off-by: Shangming Cai <csmthu@gmail.com>
This commit is contained in:
Shangming Cai
2026-06-15 22:36:05 +08:00
committed by GitHub
parent 20f4272109
commit 378e66d248
3 changed files with 31 additions and 13 deletions
@@ -31,16 +31,10 @@ def handle_pd_disaggregation(server_args: "ServerArgs") -> None:
"--disaggregation-decode-enable-radix-cache is incompatible " "--disaggregation-decode-enable-radix-cache is incompatible "
"with --enable-hisparse" "with --enable-hisparse"
) )
if server_args.disaggregation_transfer_backend not in ( if server_args.disaggregation_transfer_backend == "fake":
"nixl",
"mooncake",
"mori",
):
raise ValueError( raise ValueError(
"--disaggregation-decode-enable-radix-cache currently " "--disaggregation-decode-enable-radix-cache is incompatible "
"requires --disaggregation-transfer-backend in " "with --disaggregation-transfer-backend fake"
"('nixl', 'mooncake', 'mori'), but got "
f"{server_args.disaggregation_transfer_backend!r}"
) )
if server_args.speculative_algorithm is not None: if server_args.speculative_algorithm is not None:
raise ValueError( raise ValueError(
+1 -1
View File
@@ -7387,7 +7387,7 @@ class ServerArgs:
parser.add_argument( parser.add_argument(
"--disaggregation-decode-enable-radix-cache", "--disaggregation-decode-enable-radix-cache",
action="store_true", action="store_true",
help="Enable radix cache on decode server (PD mode). Caches KV prefixes to avoid redundant transfers. Requires --disaggregation-transfer-backend nixl, mooncake or mori and is incompatible with --enable-hisparse.", help="Enable radix cache on decode server (PD mode). Caches KV prefixes to avoid redundant transfers. Incompatible with --enable-hisparse, speculative decoding, and --disaggregation-transfer-backend fake.",
) )
parser.add_argument( parser.add_argument(
"--disaggregation-decode-enable-offload-kvcache", "--disaggregation-decode-enable-offload-kvcache",
@@ -109,7 +109,7 @@ class TestLoadBalanceMethod(unittest.TestCase):
self.assertFalse(server_args.disable_radix_cache) self.assertFalse(server_args.disable_radix_cache)
def test_pd_decode_radix_cache_rejects_unknown_backend(self): def test_pd_decode_radix_cache_rejects_fake_backend(self):
with self.assertRaises(ValueError) as context: with self.assertRaises(ValueError) as context:
ServerArgs( ServerArgs(
model_path="dummy", model_path="dummy",
@@ -118,8 +118,32 @@ class TestLoadBalanceMethod(unittest.TestCase):
disaggregation_transfer_backend="fake", disaggregation_transfer_backend="fake",
) )
self.assertIn("('nixl', 'mooncake', 'mori')", str(context.exception)) self.assertIn(
self.assertIn("'fake'", str(context.exception)) "--disaggregation-decode-enable-radix-cache is incompatible "
"with --disaggregation-transfer-backend fake",
str(context.exception),
)
def test_pd_decode_radix_cache_allows_ascend(self):
server_args = ServerArgs(
model_path="dummy",
disaggregation_mode="decode",
disaggregation_decode_enable_radix_cache=True,
disaggregation_transfer_backend="ascend",
)
self.assertFalse(server_args.disable_radix_cache)
def test_pd_decode_radix_cache_allows_mooncake_tcp(self):
server_args = ServerArgs(
model_path="dummy",
disaggregation_mode="decode",
disaggregation_decode_enable_radix_cache=True,
disaggregation_transfer_backend="mooncake_tcp",
)
self.assertFalse(server_args.disable_radix_cache)
self.assertEqual(server_args.disaggregation_transfer_backend, "mooncake")
class TestContextParallelServerArgs(CustomTestCase): class TestContextParallelServerArgs(CustomTestCase):