From 56402e77a8d93d67172f63921a5987a0e00bc095 Mon Sep 17 00:00:00 2001 From: ispobock Date: Fri, 14 Aug 2026 13:56:54 +0800 Subject: [PATCH] skip oow slot freeing under eagle --- python/sglang/srt/mem_cache/unified_radix_cache.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/python/sglang/srt/mem_cache/unified_radix_cache.py b/python/sglang/srt/mem_cache/unified_radix_cache.py index 597de340da4d..7483d0d8f42d 100644 --- a/python/sglang/srt/mem_cache/unified_radix_cache.py +++ b/python/sglang/srt/mem_cache/unified_radix_cache.py @@ -773,7 +773,12 @@ def cache_unfinished_req(self, req: Req, chunked: bool = False, **kwargs) -> Non if cl is not None: effective_cache_len = min(effective_cache_len, cl) - if envs.SGLANG_OPT_UNIFIED_CACHE_FREE_OUT_OF_WINDOW_SLOTS.get(): + # swa_evicted_seqlen is a raw-token length, but under EAGLE the insert key is + # bigram-indexed, so SWA would carve tombstones at the wrong offset (#34653). + if ( + envs.SGLANG_OPT_UNIFIED_CACHE_FREE_OUT_OF_WINDOW_SLOTS.get() + and not self.tree_core.is_eagle + ): for comp in self._components_tuple: comp.free_out_of_window_slots( req, effective_cache_len - 1, insert_params