mirror of
https://github.com/kvcache-ai/Mooncake.git
synced 2026-11-05 01:17:55 +00:00
[GH-ISSUE #2117] [RFC]: Hierarchical Arch for Intra/Inter Data Center Deployment #582
Labels
No labels
ascend
auto-closed
bug
bug
CI/Build
Common
documentation
enhancement
feature request
good first issue
help wanted
high priority
MetaX
nightly-failure
pull-request
PyTorch Backend
question
RFC
Roadmap
stale
Store
Tests
Transfer Engine
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
kvcache-ai/Mooncake#582
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @zhaoyongke on GitHub (May 16, 2026).
Original GitHub issue: https://github.com/kvcache-ai/Mooncake/issues/2117
Originally assigned to: @chestnut-Q on GitHub.
Changes proposed
In AntGroup's practice with Theta KVPool in agentic coding services, where a single LLM service reaches 10,000 card(accordingly 10,000 dummy clients), Mooncake Master becomes an obvious bottleneck. It will fail with these issues:
Even with HA mode ON, multiple Masters are available, but only one Master instance is active for all clients' requests.
When large mounts of online requests arrived, the former Leader Master instance may crash, the new Leader Master instance is activated, but may crash soon after oplog/snapshot recovery with historical failed and newly arrived requests, which called "avalanche" or "snowslide" effect.
We propose a Hierarchical KVCache Management(HKVM for simple in the remainder part) Architecture for large scale Mooncake Store deployment.
The picture shows a cluster with N sub-cluster and M nodes(we suggest only 1 real client in a node, dummy clients are 8 or 16 times of real clients with different card type) in each sub-cluster, the total nodes are M*N=C. In a sub-cluster, the Sub Master and Clients are the same with original deployment. The only change is a higher level Global Master for global KVCache management.
In HKVM, a Global Master is tailored from original Master. Its functions are:
We can adjust M and N for performance & reliability trade-off. Specially, when M=1, it will behave like the new P2P Arch; when N=1, it will degenerate into original centralized arch. In our practice, we set M to the scale of P/D group(such as 5 in 2P3D, or 2 in 1P1D), and N to number of P/D groups.
If we add a new level, HKVM naturally supports PrfaaS.
Prefill Service(in the left) and P/D Service(in the right) can run on different clusters and heterogeneous hardwares (H200 + H20 in the paper). In each cluster, we create a global kvcache pool. Prefill Service will generate KVCache of long-input-requests continuously. P/D Service will processing normal requests in parallel. The newly added Inter-DC Master collects KVEvents of both sides, checks the diff and launchs incremental updates via WAN(cross-datacenter) or LAN(intra-datacenter). Thanks to the global kvcache pool, KVCaches transferred can be reused in the future before evicted. We need set the pool sizes in each side according to Prefill Service's and P/D Service's max throughput.
Thanks again to the global kvcache pool, we don't need high-bandwidth network between these clusters, the transfer time is relaxed to KVCache eviction period(from minutes to hours in our real environment).
Our plan for next step:
Some concerns:
Any discussions, concerns or co-works(e.g. SGLang Distributed KV) are welcomed!
-- from Ant SCT inference team.
Update: The development branch is created at dev/hkvm.
Before submitting a new issue...
@chestnut-Q commented on GitHub (May 26, 2026):
Hi @zhaoyongke, thanks for the HKVM design. This is really helpful for our PrfaaS architecture! I have some questions and discussions:
@zhaoyongke commented on GitHub (May 26, 2026):
Main reason is the scale, a single master managing ten thousands clients will be a bottleneck, so we split the big cluster into several sub-clusters, and every sub-cluster will have their own master. HKVM only affects mooncake store sharing range, and the scheduler is independent with HKVM.
Sure, in this case we can get lower latency but the scale in each region may be limited. As PrfaaS introduces inter-region transferring, the latency is more tolerant than intra-region.
@chestnut-Q commented on GitHub (May 26, 2026):
I understand that each sub-cluster still has a considerable number of nodes, say hundreds, but KVCache cannot be shared across sub-clusters via mooncake store. Instead, the scheduler needs to explicitly trigger cross-sub-cluster KVCache migration. Is my understanding correct?
@zhaoyongke commented on GitHub (May 27, 2026):
Actually nodes can share KVCache with other sub-clusters by querying global master, with a slightly added latency, so KVCache is globally available, and scheduler treats all nodes as equal cache-hit rate in L3.
@chestnut-Q commented on GitHub (May 27, 2026):
Thanks for the clarification @zhaoyongke. Really looking forward to the Global Master implementation!
One thought for when we later extend to inter-datacenter HKVM: we could attach labels to sub-masters to achieve a soft/hard partitioning effect. Masters sharing the same label would be interconnected with high bandwidth, while masters with different labels could have KVCache transfer bottlenecks. This would give us a more flexible knob for KVCache management policies.
@zhaoyongke commented on GitHub (May 28, 2026):
Pretty good suggestion! We'll consider this in the implementation.
@zchuango commented on GitHub (Jul 8, 2026):
Hi @zhaoyongke , we are very interested in the hierarchical master architecture proposed in #2117.
This feature is important for our large-scale deployment scenario, where a single active master may become a bottleneck with many clients. We would like to know if there has been any progress on this work, or if there is any current plan/timeline for it.
Thanks!
@zhaoyongke commented on GitHub (Jul 16, 2026):
Hi @zchuango , we're building globally shared kvcache pool in cluster level now, a lot of engineering work is on-going, including inference engine and mooncake store refactoring, and online requests modeling.
The roadmap of HKVM is planned as follow:
Thks for your attention!