From 561a3e04f6d9ca22baccbc323f970e3c84d24d48 Mon Sep 17 00:00:00 2001 From: yudian0504 <138860534+yudian0504@users.noreply.github.com> Date: Mon, 5 Jan 2026 13:02:07 +0800 Subject: [PATCH] remove redundant mamba_cache clearing actions (#16180) --- python/sglang/srt/mem_cache/memory_pool.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/python/sglang/srt/mem_cache/memory_pool.py b/python/sglang/srt/mem_cache/memory_pool.py index 9fb9b939b..65d562a27 100644 --- a/python/sglang/srt/mem_cache/memory_pool.py +++ b/python/sglang/srt/mem_cache/memory_pool.py @@ -271,12 +271,7 @@ class MambaPool: select_index = self.free_slots[:need_size] self.free_slots = self.free_slots[need_size:] - # clear at alloc time - for i in range(len(self.mamba_cache.conv)): - self.mamba_cache.conv[i][:, select_index] = 0 - self.mamba_cache.temporal[:, select_index] = 0 - - # fill allocated slots with zeros + # clear at alloc time, fill allocated slots with zeros for i in range(len(self.mamba_cache.conv)): self.mamba_cache.conv[i][:, select_index] = 0 self.mamba_cache.temporal[:, select_index] = 0