Repository navigation
[Fix] mamba: Clear a stale COW source when an unadmitted request is matched again - #50009
Merged
Merged
Conversation
Collaborator
Author
|
/rerun-test registered/unit/mem_cache/test_mamba_stale_cow_source.py |
kpham-sgl
requested review from
Ying1123,
alphabetc1,
hanming-lu,
hnyls2002,
huangtingwei9988,
hzh0425,
ispobock,
merrymercy,
xiezhq-hermann and
yizhang2077
as code owners
November 12, 2026 04:02
There was a problem hiding this comment.
Claude Code Review
This repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.
Tip: disable this comment in your organization's Code Review settings.
41 of 42 tasks
Contributor
|
🚀 |
alphabetc1
approved these changes
Nov 12, 2026
hnyls2002
added a commit
that referenced
this pull request
Nov 12, 2026
5 tasks done
This was referenced Nov 13, 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.
Original authors: @yhyang201
Port of #48414
A request that a prefix match set up for a Mamba copy-on-write, but that the admission pass then left queued without calling
_drop_unadmitted_match, keepsreq.kv.mamba_cow_src_index. If the matched node's device state is evicted before the next pass, the rematch finds no device state and returns early, leaving the old source index. The request then copies its initial state from a slot that may have been reused. This PR ports the fix from the Kimi-K3.1 Day-0 branch: the rematch clears the source index when the node has no device state.Against the raw port (first commit): no changes.
Not taken: the Day-0 branch also calls
_drop_unadmitted_matchon the three early exits of the admission loop regardless ofdefer_cow_slot. Main guards those calls since #49300, and the rematch fix covers the stale source without changing that.Modifications
MambaComponent.finalize_match_result_in_cachesetsreq.kv.mamba_cow_src_index = Nonewhen the best-match node has no device Mamba state.Tests
test_mamba_stale_cow_source.py(1 GPU): match with copy-on-write, evict the node's device state, match again, and check the request holds no source index that is not the node's live state.pre-commit, compile).CI States
Latest PR Test (Base): 🚫 Run #43159687576
Latest PR Test (Extra): ❌ Run #43159687559
Latest PR Test (AMD ROCm 10): ⏳ Run #43159687623
Tip
Base CI only covers the core cases, and its workload may not exercise your change. Use
/rerun-testto run the tests your change touches, or copy this prompt for an agent: