From 7f0434e4af02fbba37dee81c95f0efa7a0bd6a7b Mon Sep 17 00:00:00 2001 From: Mohammad Miadh Angkad <176301910+mmangkad@users.noreply.github.com> Date: Wed, 14 Oct 2026 10:31:02 +0800 Subject: [PATCH] [GLM-5.3-Flash] Drop the NextN layer from the KDA state pool (#44098) Co-authored-by: Mohammad Angkad --- python/sglang/srt/configs/glm5_next.py | 5 ----- python/sglang/srt/mem_cache/kv_cache_configurator.py | 9 +++------ 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/python/sglang/srt/configs/glm5_next.py b/python/sglang/srt/configs/glm5_next.py index e908152447..be3a213757 100644 --- a/python/sglang/srt/configs/glm5_next.py +++ b/python/sglang/srt/configs/glm5_next.py @@ -250,11 +250,6 @@ class Glm5NextTextConfig(PretrainedConfig): def linear_layer_ids(self): return [i for i in range(self.num_hidden_layers) if self.is_kda_layer(i)] - @property - def nextn_layer_ids(self): - num_nextn_layers = self.num_nextn_predict_layers or 0 - return [self.num_hidden_layers + i for i in range(num_nextn_layers)] - @property def full_attention_layer_ids(self): return [i for i in range(self.num_hidden_layers) if not self.is_kda_layer(i)] diff --git a/python/sglang/srt/mem_cache/kv_cache_configurator.py b/python/sglang/srt/mem_cache/kv_cache_configurator.py index f49dd58f7e..874137136e 100644 --- a/python/sglang/srt/mem_cache/kv_cache_configurator.py +++ b/python/sglang/srt/mem_cache/kv_cache_configurator.py @@ -1438,16 +1438,13 @@ class KVCacheConfigurator: ) def _get_mamba_layer_ids_for_req_pool(self) -> list: - mamba_layer_ids = [ + # Target layers on this rank only; a draft holding linear state gets its own + # pool via clone_with_new_mamba. + return [ i for i in self.mambaish_config.mamba2_cache_params.layers if self.layer_info.start_layer <= i < self.layer_info.end_layer ] - if max_speculative_num_draft_tokens(): - for layer_id in getattr(self.mambaish_config, "nextn_layer_ids", []): - if layer_id not in mamba_layer_ids: - mamba_layer_ids.append(layer_id) - return mamba_layer_ids def _get_ple_req_pool_kwargs(self) -> dict[str, Any]: from sglang.srt.configs.qwen4_exp import Qwen4ExpTextConfig