mirror of
https://github.com/kvcache-ai/Mooncake.git
synced 2026-11-05 01:17:55 +00:00
[GH-ISSUE #4990] [RFC]: Fix MemFabric SDMA memory allocation and NPU transport initialization for Mooncake Store #1265
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#1265
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 @jamesjxliu on GitHub (Oct 27, 2026).
Original GitHub issue: https://github.com/kvcache-ai/Mooncake/issues/4990
Summary
This RFC describes the MemFabric integration fixes in https://github.com/kvcache-ai/Mooncake/pull/4834. The goal is to support distributed Mooncake Store caching and prefill/decode (PD) transfers on Ascend NPUs, including SDMA over HCCS and independent protocol selection for PD and Store.
Problems
When integrating SGLang HiCache with Mooncake Store and the TENT MemFabric transport, three integration gaps can prevent initialization, registration, or data transfer:
For example, two adjacent 3 MiB buffers produce these aligned ranges:
Registering both aligned ranges independently can cause the native transport to reject an overlapping memory region.
Proposed changes
smem_mem_alloc/smem_mem_freeAPIs. Keep allocation ownership and library lifetime valid until outstanding buffers are released. Leave native memory/page management inside MemFabric.kLocalReadWriteregistration bypass for initiator-local buffers.Independent PD and Store protocols
MF_PROTOCOLselects the standalone Transfer Engine / PD protocol.MF_STORE_PROTOCOLoverrides it for the Store Transfer Engine and Store allocation path. When the override is unset or empty, Store falls back toMF_PROTOCOL.For example, with MemFabric enabled in the TENT configuration:
Using
device_sdmafor both variables selects SDMA for both PD and Store. A Store-only application can setMF_STORE_PROTOCOLwithout settingMF_PROTOCOL. The override does not rewrite the PD environment variable.Validation
The PR extends existing MemFabric transport tests to cover allocation/free lifetime, deferred initialization, device ownership, protocol overrides, SDMA local buffers, aligned registration reuse, partial-failure retry, and boundary-safe READ/WRITE transfers.
End-to-end validation should include SGLang PD transfers, L3 cache population, clearing local caches, and L3 readback. Check per-rank cache counters and loaded native libraries in addition to HTTP responses. RDMA and SDMA must be validated on hardware supporting the corresponding path.
@github-actions[bot] commented on GitHub (Oct 27, 2026):
Thanks for opening this issue, @jamesjxliu!
20507750A maintainer will triage this when possible. To help us respond faster, please include:
Useful links: Documentation · Contributing guide