[PR #49] fix(swa): port tombstone-aware eviction + dec_swa_lock_only from upsream #23882 #49

Open
opened 2026-10-29 21:06:45 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/kvcache-ai/sglang/pull/49
Author: @yyj6666667
Created: 5/11/2026
Status: 🔄 Open

Base: main ← Head: fix/swa-tombstone-eviction


📝 Commits (1)

  • f85f6c6 fix(swa): port tombstone-aware eviction + dec_swa_lock_only from upstream #23882

📊 Changes

10 files changed (+202 additions, -73 deletions)

View changed files

📝 python/sglang/srt/environ.py (+2 -0)
📝 python/sglang/srt/managers/schedule_batch.py (+29 -11)
📝 python/sglang/srt/managers/schedule_policy.py (+8 -9)
📝 python/sglang/srt/mem_cache/base_prefix_cache.py (+21 -3)
📝 python/sglang/srt/mem_cache/chunk_cache.py (+9 -4)
📝 python/sglang/srt/mem_cache/hiradix_cache.py (+13 -7)
📝 python/sglang/srt/mem_cache/mamba_radix_cache.py (+11 -5)
📝 python/sglang/srt/mem_cache/radix_cache.py (+11 -6)
📝 python/sglang/srt/mem_cache/radix_cache_cpp.py (+10 -13)
📝 python/sglang/srt/mem_cache/swa_radix_cache.py (+88 -15)

📄 Description

SWA-only eviction crashed on leaf nodes with full_lock_ref > 0, swa_lock_ref == 0 (beyond sliding window). Adds tombstone branch to free SWA without asserting, plus dec_swa_lock_only for early SWA lock release during decode. Unifies inc/dec_lock_ref return types across all cache implementations.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/kvcache-ai/sglang/pull/49 **Author:** [@yyj6666667](https://github.com/yyj6666667) **Created:** 5/11/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix/swa-tombstone-eviction` --- ### 📝 Commits (1) - [`f85f6c6`](https://github.com/kvcache-ai/sglang/commit/f85f6c6c2971cc42615a04ede8edb283de307977) fix(swa): port tombstone-aware eviction + dec_swa_lock_only from upstream #23882 ### 📊 Changes **10 files changed** (+202 additions, -73 deletions) <details> <summary>View changed files</summary> 📝 `python/sglang/srt/environ.py` (+2 -0) 📝 `python/sglang/srt/managers/schedule_batch.py` (+29 -11) 📝 `python/sglang/srt/managers/schedule_policy.py` (+8 -9) 📝 `python/sglang/srt/mem_cache/base_prefix_cache.py` (+21 -3) 📝 `python/sglang/srt/mem_cache/chunk_cache.py` (+9 -4) 📝 `python/sglang/srt/mem_cache/hiradix_cache.py` (+13 -7) 📝 `python/sglang/srt/mem_cache/mamba_radix_cache.py` (+11 -5) 📝 `python/sglang/srt/mem_cache/radix_cache.py` (+11 -6) 📝 `python/sglang/srt/mem_cache/radix_cache_cpp.py` (+10 -13) 📝 `python/sglang/srt/mem_cache/swa_radix_cache.py` (+88 -15) </details> ### 📄 Description SWA-only eviction crashed on leaf nodes with full_lock_ref > 0, swa_lock_ref == 0 (beyond sliding window). Adds tombstone branch to free SWA without asserting, plus dec_swa_lock_only for early SWA lock release during decode. Unifies inc/dec_lock_ref return types across all cache implementations. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
kvcache-ai/sglang#49
No description provided.