Repository navigation
perf(pytorch): add rolling Mooncake checkpoints across prefill and decode - #5211
Open
silencelamb wants to merge 13 commits into
Open
silencelamb wants to merge 13 commits into
silencelamb wants to merge 13 commits into
Conversation
silencelamb
marked this pull request as ready for review
November 30, 2026 00:27
This was referenced Nov 30, 2026
silencelamb
requested review from
RunningLeon and
caikun-pjlab
and removed request for
RunningLeon
December 3, 2026 11:01
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.
Hybrid attention can resume at a shared prefix when both its attention KV and its recurrent state are available. A new turn can branch inside the previous prompt or reuse some of its generated tokens. This PR lets Mooncake Store publish recurrent and convolution state on one absolute token grid across prefill and accepted decode. As a conversation advances, older checkpoints become eligible for reclamation once other readers and conversations release them.
Configuration
LMDEPLOY_STORE_CHECKPOINT_INTERVAL00disables the grid.LMDEPLOY_STORE_CHECKPOINT_KEEP2-1= unlimited,0= zero points, positiveN= at most the latestNpoints.At interval 4,096 and KEEP=2, a 5,000-token sequence has one candidate at 4,096. At 13,000 tokens, the latest two candidates are 8,192 and 12,288. Reuse requires a safe published state and matching KV.
Use compact state with
--prefill-save-last-only. Bounded retention across chat turns requires a single-nodekv_bothservice and a stableX-Correlation-ID. The local HBM decode flags are independent of the Store grid. English guide · 中文文档AgentX performance
C120 with and without #5211
We added #5211 to the same eight-PR stack using a 4,096-token grid with KEEP=2. Both sides of each comparison use MTP3 and the same local decode settings.
“Off” omits both CLI options. “On” enables
--prefix-cache-decode-save-firstand sets--prefix-cache-decode-state-interval 1024. All nine-PR rows below use the 4,096-token grid. All rows use MTP3 except the row marked MTP5.Each replay uses one cold 1,800-second Weka 256K window, seed 20260707, eight H200s, TP1/DP8/EP8, BF16 KV and sticky least-loaded routing. SLO goodput counts requests with TTFT ≤3 s and per-user output ≥40 tok/s. Store peak is whole-pool allocated memory sampled about every two seconds. PUT and GET sum successful transfers during scoring and drain. Uncached input tokens include both new input and repeated input that required computation.
C120 uses FlashMLA, 48,000 KV blocks/rank, DP prefill period 4 and a 1,280 GiB Store. The baseline includes #5186, #5187, #5212, #5216, #5221, #5222, #5223 and #5224 (
44eab704). For the nine-PR measurements we added #5211 at43962b92to the same stack (9606bd50). These windows predate the subsequent merge of upstream main at06c6d224.C70 on the QA deployment
The November 11 QA report recorded 1.25 RPS, 1,206.72 decode tok/s, TTFT p50 997.50 ms and 0.6978 SLO goodput (2,297 completions, 55.9% attainment). TPOT percentiles and Store bytes were unavailable in that report.
The three replays use the documented QA image at
a0102d47, router 0.0.9, MTP5, BF16 KV and 1,024 GiB of RDMA Store (128 GiB/rank). The deployment guide enables both local decode options. Only the third replay applies #5211 to that runtime. The QA report gives no full client command or seed.Effect of the local decode flags. On the stock QA image, turning both off changed RPS by +0.51%. In the same pair, decode throughput fell 2.35% and SLO goodput rose 3.78%. Peak Store occupancy fell 44.98% and cumulative PUT volume fell 53.44%.
Effect of #5211 at C70. With both local decode options off, decode throughput rose 8.10% and SLO goodput rose 14.01%. Peak Store occupancy fell 36.58% and cumulative PUT volume rose 33.01%. RPS changed by +4.79% and TTFT p95 fell from 3,454 to 2,816 ms. Uncached input changed from 15,063,516 to 13,083,143 tokens. Each setting had one formal window.
Choosing the interval, cap and MTP depth
KEEP=-1.Validation
06c6d224, the focused CPU-accessible suite passed 676 tests (9 CUDA skips). It covers the joint Store key formats and the interaction between pending-write limits and ordinary checkpoint reservations. Ruff passed for the changed Python files.e5b250f0, the expanded GPU regression suite passed 1,895 tests with 0 skipped.