Repository navigation
[Fix] linker: Offload Mamba branch checkpoints on stored nodes - #49042
Open
alphabetc1 wants to merge 1 commit into
Open
alphabetc1 wants to merge 1 commit into
alphabetc1 wants to merge 1 commit into
Conversation
alphabetc1
requested review from
Jialin,
Ying1123,
hanming-lu,
hnyls2002,
huangtingwei9988,
hzh0425,
ispobock,
merrymercy,
stmatengss,
xiezhq-hermann and
yizhang2077
as code owners
November 7, 2026 06:44
alphabetc1
force-pushed
the
fix/linker-mamba-branch-offload
branch
from
November 9, 2026 17:52
2469750 to
dbd75f7
Compare
This was referenced Nov 9, 2026
This branch has not been deployed
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.
Motivation
With the external linker, a Mamba checkpoint taken at a branch point (
mamba_branching_seqlen) is attached to a node split off an already-stored node. The split node inherits the stored mark, so its Mamba state never reaches the store, and requests that share only that prefix get no L3 hit once the device copy is gone. This affects every hybrid Mamba model served with the linker (e.g. Kimi-K3, Inkling).HiCache handles the same case through its incremental backup; #48431 adds request-end-only Mamba backups for HiCache and does not touch the linker path.
Modifications
UnifiedCacheLinkerWrapper: a node whose KV is already stored or queued offloads its state components alone, holding the node lock until the ack and leaving its KV stored/pending marks untouched.Accuracy Tests
Unit tests:
test_unified_cache_linker.py(Python and Rust tree backends) and a Rust tree-core test.End to end on
mainwith #49043 and #49355: Kimi-K3.1-Pro, B300 TP8, DFLASH, Mooncake linker. After a cache flush, branch-point prefixes restore from L3, and the restored KV, indexer, KDA state and draft bytes match the offloaded bytes; skipping one pool on load makes only that pool mismatch. GSM8K (sgl-eval, 16-shot shared prefix, cache flushed every 64 questions): 98.18% (1295/1319) with the linker vs 98.03% without.CI States
Latest PR Test (Base): ❌ Run #42668823938
Latest PR Test (Extra): ❌ Run #42668823785
Latest PR Test (AMD ROCm 10): ❌ Run #42668824072
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: