mirror of
https://github.com/kvcache-ai/Mooncake.git
synced 2026-11-05 01:17:55 +00:00
[GH-ISSUE #2572] [RFC]: Streaming Transfer for Mooncake #676
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#676
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 @zxpdemonio on GitHub (Jun 23, 2026).
Original GitHub issue: https://github.com/kvcache-ai/Mooncake/issues/2572
Changes proposed
This RFC proposes adding streaming transfer support to Mooncake Store so that large training or inference payloads can be produced, transferred, and consumed progressively instead of only through object-level blocking
Put/Getcalls.Motivation
Mooncake Store currently exposes object-level transfer APIs. A caller starts a
GetorPutand observes completion only when the whole object transfer finishes. This works well for bulk transfer bandwidth, but it leaves no way for upper layers to overlap transfer with compute when payloads are large.This matters for future asynchronous and pipelined workloads:
fully_async_policy: sample-granularity execution can use chunk completion as the synchronization unit without storing one key per sample.This is not primarily intended to improve the latency of today’s fully synchronous PPO path. In that path, each stage waits for the whole batch for operations such as advantage normalization and mini-batch splitting, and large RDMA transfers already achieve high utilization. For the near term, Mooncake’s direct benefit over TransferQueue comes from reducing key fragmentation and supporting field-level selective reads. Streaming transfer is the foundation for future async and pipelined execution.
Goals
Non-goals
Get/PutAPIs.High-level architecture
Streaming transfer adds a handle-oriented layer on top of the existing Mooncake Store transfer path. The store still uses the Master for metadata and the Transfer Engine for data movement. The new part is that a large logical transfer can be split into chunks, and completion of each chunk becomes visible to the caller.
The key abstraction is a streaming session. A session owns the chunk state for one logical transfer. The caller receives a handle that exposes progress-oriented operations such as polling completed chunks, waiting for a specific chunk, or waiting for the entire transfer.
Synchronous APIs remain as convenience wrappers: they can submit the same underlying transfer and then call
wait_all()internally.API model
The full streaming-transfer series is expected to expose three families of operations.
Progressive read
Progressive read transfers one object into a caller-provided destination buffer and reports completion by chunk.
Conceptually:
This is useful when a consumer can start processing the first chunks before the whole object arrives.
Streaming scatter read
Streaming scatter read generalizes progressive read to multiple keys and ranges. It allows a structured or batched object to be read into selected destinations while still exposing chunk-level progress.
Conceptually:
This is the read-side primitive that can serve structured-object selective reads and TransferQueue-like batched access without creating one key per sample-field pair.
Progressive put
Progressive put lets a producer publish chunks as they become available and then seal the object when no more chunks will be written.
Conceptually:
This is the write-side primitive needed for rollout/transfer overlap: the producer does not need to wait until the whole batch is generated before publishing data.
Dataflow in an async pipeline
The important behavior is not that each individual chunk is faster than a bulk transfer. The benefit is that independent stages can overlap in time when the upper-layer algorithm can operate on partial data.
Relationship to TransferQueue replacement
TransferQueue commonly represents a training batch as many small KV entries, roughly
batch_size × field_count. This creates metadata and scheduling overhead from many small keys.Mooncake’s preferred model is to store each stage output as a small number of larger structured objects:
Streaming transfer complements structured objects. It avoids returning to one-key-per-sample just to gain progressive visibility.
Implementation plan
The complete code path exists in PR #1864. To make review tractable, it should be landed as a series:
Chunked read infrastructure
num_chunks,is_chunk_ready,wait_chunk, andwait_all.Progressive read and streaming scatter read submission
Client and Python integration
Progressive put
Each PR should preserve the existing synchronous API behavior and introduce only the minimum public surface needed for that layer.
Design considerations
Completion and waiting
A streaming handle should provide both polling and blocking APIs. The implementation must avoid lost wakeups and must not hold unrelated state locks while waiting for long periods. The exact synchronization primitive can be refined in implementation review, but the external contract should stay simple: a chunk is either pending, completed successfully, or failed.
Backpressure
Large transfers should not submit all chunks at once. A session should maintain a submission window so resource usage stays bounded while still keeping the transfer engine busy.
Failure handling
Failures should be visible through the same handle used for progress. If one chunk fails, later
wait_chunk()/wait_all()calls should return an error instead of hanging or silently reporting success.API compatibility
Existing object-level APIs remain unchanged. Streaming APIs are additive. Synchronous reads/writes can continue to use the existing path or internally wait on streaming handles after the streaming path is mature.
Testing plan
Open questions
Summary
Streaming transfer should be viewed as a foundation for future async and pipelined Mooncake Store workloads. The design keeps today’s synchronous APIs intact while adding handles that expose progressive completion for large transfers.
Before submitting a new issue...
@github-actions[bot] commented on GitHub (Jun 23, 2026):
Thanks for opening this issue, @zxpdemonio!
16206312A maintainer will triage this when possible. To help us respond faster, please include:
Useful links: Documentation · Contributing guide
@zxpdemonio commented on GitHub (Aug 12, 2026):
Closing this RFC because the implementation direction has evolved. #2881 has been merged and provides session-based ranged multi-buffer transfers, while the Transfer Engine batching optimization is being handled separately in #3310. This RFC also included broader progressive read/put and chunk-completion semantics that were not adopted as one combined design; if those capabilities are needed later, they should be proposed again around a concrete upper-layer use case and the current APIs.