Skip to content

[Fix] linker: Offload Mamba branch checkpoints on stored nodes - #49042

Open
alphabetc1 wants to merge 1 commit into
sgl-project:mainfrom
alphabetc1:fix/linker-mamba-branch-offload
Open

alphabetc1 wants to merge 1 commit into
sgl-project:mainfrom
alphabetc1:fix/linker-mamba-branch-offload

Conversation

@alphabetc1

@alphabetc1 alphabetc1 commented Nov 7, 2026 •

Copy link
Copy Markdown
Collaborator

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

  • Python and Rust tree cores: in linker mode, an insert that newly attaches a Mamba state to an existing node emits a backup for it.
  • 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.
  • Mooncake direct linker: accept an offload without a KV transfer.

Accuracy Tests

Unit tests: test_unified_cache_linker.py (Python and Rust tree backends) and a Rust tree-core test.

End to end on main with #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-test to run the tests your change touches, or copy this prompt for an agent:

Find the registered tests this PR affects and run them with /rerun-test, following https://github.com/sgl-project/sglang/blob/main/.agents/skills/rerun-test/SKILL.md

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

@github-actions github-actions Bot added hicache Hierarchical Caching for SGLang unified-radix-cache mooncake labels Nov 7, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hicache Hierarchical Caching for SGLang mooncake unified-radix-cache

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant