Repository navigation
feat(cache): store FlashStates checkpoints in Mooncake - #1809
Conversation
Signed-off-by: AlpinDale <alpindale@gmail.com>
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: adb6920316
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if not self.frontier_write_through or request.resumable or request.status == RequestStatus.FINISHED_ABORTED: | ||
| return |
There was a problem hiding this comment.
Avoid pinning frontier saves on load-only consumers
With frontier_write_through=true and kv_role="kv_consumer", this method queues a save and pins all checkpoint blocks for every eligible finished request, but MooncakeStoreWorker.can_put is false for consumers and wait_for_save() returns without submitting those jobs. Consequently, no completion metadata releases these references, progressively exhausting the GPU block pool and leaving pending push work permanently outstanding. Either reject this configuration during connector initialization or skip frontier-save registration when the worker cannot PUT.
Useful? React with 👍 / 👎.
Summary
Adds native Mooncake Store support for FlashStates checkpoints, allowing a supported hybrid model to restore a completed request's checkpoint after it leaves the GPU prefix cache.
Each stored checkpoint includes the full attention prefix, recurrent state and any unfinished indexer compression group. Lookup requires the checkpoint's payloads and completion manifests from every worker rank.
This uses the stock Mooncake Store API. The donor's custom host-cache policy integration through
unit_policy_urlremains unsupported.Usage
With Mooncake installed and a Store configuration saved as
mooncake.json, enable frontier write-through alongside the existing FlashStates options. This example uses TCP and GLM on 2 GPUs:What do the options do?
frontier_write_through: true: Writes completed-request checkpoints to the Store, including checkpoints between cache-block boundaries.kv_role: "kv_both": Allows the engine to save and restore checkpoints.kv_load_failure_policy: "recompute": Recomputes a request if a checkpoint becomes unavailable or a transfer fails.cache_prefix: Separates deployments sharing a Store. Use an immutable identifier and change it when the weights or build change.Keep
load_asyncandlookup_asyncenabled, which are the defaults. Leavesave_decode_cachedisabled. Separate engines on the same host need distinctlookup_rpc_portvalues inkv_connector_extra_config.Capacity and limitations
Size host memory for the stored attention prefixes as well as recurrent state. Checkpoints require matching parallel geometry and cache layouts between writers and readers.
Embedded host segments belong to their worker processes. Stopping those workers can remove checkpoints from the shared Store.
To reset GPU prefix caches while retaining host checkpoints, let pending saves drain and use
LLM.reset_prefix_cache(reset_connector=False)orPOST /reset_prefix_cache?reset_external=false.