Repository navigation
[mem_cache] Move mamba state and retraction_backup into ReqKvInfo - #37164
Merged
Merged
Conversation
hnyls2002
requested review from
ByronHsu,
Duyi-Wang,
HaiShaw,
ShangmingCai,
Ying1123,
alphabetc1,
hanming-lu,
huangtingwei9988,
hzh0425,
ispobock,
merrymercy,
sogalin,
xiezhq-hermann,
yeahdongcn and
yizhang2077
as code owners
August 30, 2026 22:29
hnyls2002
force-pushed
the
lsyin/kv-ownership-pr5b
branch
from
August 30, 2026 23:38
9ed7971 to
669d89e
Compare
# Conflicts: # test/registered/unit/mem_cache/test_streaming_session_unit.py
Collaborator
Author
|
Latest PR Test (Base): ✅ Run #33343014722 |
5 tasks
Merged
2 tasks done
This was referenced Sep 4, 2026
Merged
StevenChenSE
pushed a commit
to StevenChenSE/sglang
that referenced
this pull request
Sep 6, 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.
Move the mamba fields (
mamba_pool_idx, the ping-pong track fields,mamba_cow_src_index,mamba_needs_clear) andretraction_backupfromReq/SessionSlotintoReqKvInfo, completing the record of per-request resources that live outside the prefix cache.Req.detach_kv()now hands mamba state and the retraction backup over together with the KV row, so the per-field copy and clear blocks inSessionSlot.save_from_req/restore_to_reqand the mamba kwargs on the mid-abort ephemeral slot disappear;SessionSlotis down to the sharedReqKvInfo, the tree lock handles, and itsvirtual_node. Thegetattr(req, "mamba_*", None)call sites become direct reads -- with the record always present the fallback would silently return the default forever.mamba_lazy_is_insertstays onReq(a scheduling flag, not a resource handle), and the same-namedMatchResult.mamba_branching_seqlenis unrelated and untouched. Pure relocation, no behavior change. Stacks on #37108.CI States
Latest PR Test (Base): 🚫 Run #33358305272
Latest PR Test (Extra): 🚫 Run #33358305110
Latest PR Test (AMD ROCm 7.2): 🚫 Run #33358305233