test: enforce early CP HiCache storage rejection

This commit is contained in:
2026-05-08 00:50:52 +08:00
parent ffcbf904e4
commit 54f8cab7e7
2 changed files with 40 additions and 19 deletions
@@ -383,22 +383,39 @@ class TestHiCacheArgs(CustomTestCase):
hicache_storage_backend="mooncake",
tp_size=8,
)
pre_call_state = (
args.enable_dp_attention,
args.moe_dense_tp_size,
args.moe_a2a_backend,
args.ep_size,
args.attn_cp_size,
args.page_size,
)
with self.assertRaisesRegex(
AssertionError,
"enable_nsa_prefill_cp_shared_kv.*hicache_storage_backend",
with (
self.assertRaisesRegex(
AssertionError,
"enable_nsa_prefill_cp_shared_kv.*hicache_storage_backend",
),
patch.object(
args,
"get_model_config",
side_effect=AssertionError("get_model_config should not be called"),
),
):
model_config = MagicMock()
model_config.hf_config.architectures = ["DeepseekV3ForCausalLM"]
with (
patch.object(args, "get_model_config", return_value=model_config),
patch(
"sglang.srt.configs.model_config.is_deepseek_nsa",
return_value=True,
),
patch("torch.cuda.get_device_capability", return_value=(9, 0)),
):
args._handle_model_specific_adjustments()
args._handle_model_specific_adjustments()
self.assertEqual(
pre_call_state,
(
args.enable_dp_attention,
args.moe_dense_tp_size,
args.moe_a2a_backend,
args.ep_size,
args.attn_cp_size,
args.page_size,
),
)
def test_hicache_io_backend_and_mem_layout_compatibility(self):
cases = [