From c224a4c6cc466c70694ce2ba29f1b7ff777392cc Mon Sep 17 00:00:00 2001 From: Baizhou Zhang Date: Tue, 14 Oct 2025 11:49:33 -0700 Subject: [PATCH] Fix log for chunked prefix cache (#11624) --- python/sglang/srt/model_executor/model_runner.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/python/sglang/srt/model_executor/model_runner.py b/python/sglang/srt/model_executor/model_runner.py index 10bc0f866..aceb572c9 100644 --- a/python/sglang/srt/model_executor/model_runner.py +++ b/python/sglang/srt/model_executor/model_runner.py @@ -174,6 +174,15 @@ MLA_ATTENTION_BACKENDS = [ "nsa", ] +CHUNKED_PREFIX_CACHE_SUPPORTED_ATTENTION_BACKENDS = [ + "flashinfer", + "fa3", + "fa4", + "flashmla", + "cutlass_mla", + "trtllm_mla", +] + def add_mla_attention_backend(backend_name): if backend_name not in MLA_ATTENTION_BACKENDS: @@ -604,7 +613,11 @@ class ModelRunner: f"{self.model_config.hf_config.model_type}" ) - if not self.use_mla_backend: + if ( + not self.use_mla_backend + or server_args.attention_backend + not in CHUNKED_PREFIX_CACHE_SUPPORTED_ATTENTION_BACKENDS + ): server_args.disable_chunked_prefix_cache = True if not server_args.disable_chunked_prefix_cache: