Repository navigation
fix(sglang): reclaim the shrinking cache component - #573
Draft
shipiyouniao wants to merge 13 commits into
Draft
shipiyouniao wants to merge 13 commits into
shipiyouniao wants to merge 13 commits into
Conversation
Co-authored-by: 石皮幼鸟 <2960474346@qq.com>
Co-authored-by: 石皮幼鸟 <2960474346@qq.com>
Co-authored-by: 石皮幼鸟 <2960474346@qq.com>
Co-authored-by: 石皮幼鸟 <2960474346@qq.com>
Co-authored-by: 石皮幼鸟 <2960474346@qq.com>
Co-authored-by: 石皮幼鸟 <2960474346@qq.com>
Co-authored-by: 石皮幼鸟 <2960474346@qq.com>
Co-authored-by: 石皮幼鸟 <2960474346@qq.com>
Co-authored-by: 石皮幼鸟 <2960474346@qq.com>
This was referenced Oct 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Shrinking a managed SWA pool can remain deferred while FULL prefix nodes are locked, even when their old SWA windows can be reclaimed. The shrink callback previously checked only
full_evictable_size()and sent onlynum_tokens; it could return before requesting SWA eviction.The fix retains each manager's FULL/SWA ownership and requests the matching native eviction component. It stops when the physical target is met, respects grouped frees and pending cache transfers, and retains active windows and permanent backing. This also handles HiSparse's logical allocator and SWA-owned C4 state.
The previous reclaimer used FULL availability for every discovered manager. Native SGLang supports independent SWA eviction while the FULL prefix remains protected.
Before:
After:
Stacked on #569 and its existing dependencies, with one new fix commit. Existing PR heads are unchanged. This does not add cache residency policy, async eviction or scheduling policy.
Validation at
3612369cdd700d606f1731f8a2f8f6636b049491: 532 targeted tests; the Python 3.11 CPU suite passed 1,644 tests with 14 optional native-probe/SGLang skips; GPU-free C++ tests, all-file pre-commit and MyPy 3.10–3.13 passed. On one T4 using Python 3.12, 18 native SGLang component tests and 4 exact-placement tests passed. Dedicated private Codex review completed with no actionable findings. The complete CPU version matrix is left to GitHub CI; it is not claimed as a completed private check.The T4 fixture uses real SGLang 0.5.20 cache, allocator and physical backing with fixed small pools. It does not load model weights, execute attention/compressor kernels, capture graphs or measure serving performance. Full DSV4/MTP serving and distributed validation have not been run; this PR remains draft.