fix: fail fast for CP HiCache storage args

This commit is contained in:
2026-05-08 00:55:35 +08:00
parent 54f8cab7e7
commit da4994ec26
2 changed files with 25 additions and 43 deletions

View File

@@ -751,6 +751,9 @@ class ServerArgs:
# Validate SSL arguments early (before dummy-model short-circuit).
self._handle_ssl_validation()
# Validate CP shared KV constraints early (before dummy-model short-circuit).
self._handle_cp_shared_kv_validation()
if self.model_path.lower() in ["none", "dummy"]:
# Skip for dummy models
return
@@ -904,6 +907,16 @@ class ServerArgs:
"to be specified."
)
def _handle_cp_shared_kv_validation(self):
assert not (
self.enable_nsa_prefill_cp_shared_kv
and self.hicache_storage_backend is not None
), (
"enable_nsa_prefill_cp_shared_kv does not support "
"hicache_storage_backend in the host-only CP HiCache stage. "
"Disable hicache_storage_backend or disable CP shared KV."
)
def _handle_deprecated_args(self):
# Handle deprecated tool call parsers
deprecated_tool_call_parsers = {"qwen25": "qwen", "glm45": "glm"}
@@ -1457,15 +1470,6 @@ class ServerArgs:
def _handle_model_specific_adjustments(self):
from sglang.srt.configs.model_config import is_deepseek_nsa
assert not (
self.enable_nsa_prefill_cp_shared_kv
and self.hicache_storage_backend is not None
), (
"enable_nsa_prefill_cp_shared_kv does not support "
"hicache_storage_backend in the host-only CP HiCache stage. "
"Disable hicache_storage_backend or disable CP shared KV."
)
if parse_connector_type(self.model_path) == ConnectorType.INSTANCE:
return