From 16802fb6b2166e2d1042b355322b934f9978e475 Mon Sep 17 00:00:00 2001 From: GuoweiWangU Date: Tue, 20 Jan 2026 23:59:05 +0800 Subject: [PATCH] [FIX] fix mambaish model pp kv cache compute (#17334) --- .../srt/model_executor/model_runner_kv_cache_mixin.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/python/sglang/srt/model_executor/model_runner_kv_cache_mixin.py b/python/sglang/srt/model_executor/model_runner_kv_cache_mixin.py index 5cd65ab16..7a89012f2 100644 --- a/python/sglang/srt/model_executor/model_runner_kv_cache_mixin.py +++ b/python/sglang/srt/model_executor/model_runner_kv_cache_mixin.py @@ -124,7 +124,12 @@ class ModelRunnerKVCacheMixin: self.num_effective_layers, ) elif mambaish := self.mambaish_config: - num_layers = len(mambaish.full_attention_layer_ids) + effective_layer_ids = [ + i + for i in mambaish.full_attention_layer_ids + if self.start_layer <= i < self.end_layer + ] + num_layers = len(effective_layer_ids) else: num_layers = self.num_effective_layers