mirror of
https://github.com/kvcache-ai/Mooncake.git
synced 2026-11-05 01:17:55 +00:00
[GH-ISSUE #2873] [RFC]: Disaggregated Diffusion Model Serving with Mooncake #746
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#746
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 @gangula-karthik on GitHub (Jul 13, 2026).
Original GitHub issue: https://github.com/kvcache-ai/Mooncake/issues/2873
Changes proposed
[RFC] Disaggregated Diffusion Model Serving with Mooncake
Introduction
This RFC proposes first-class support in Mooncake for disaggregated serving of diffusion models (image and video generation), decoupling the pipeline into independently scalable stages — Condition Encode (E), Denoise (D, the DiT/U-Net transformer), and VAE Decode (V) — connected by the Mooncake Transfer Engine and Mooncake Store, and orchestrated through a queue-based multi-stage scheduler.
This directly targets two roadmap items:
Motivation
LLM-style Prefill/Decode (PD) disaggregation exists because prefill is compute-bound and decode is memory-bound. Diffusion pipelines have an analogous — but structurally different — resource asymmetry:
Co-locating these stages on one GPU group causes the same problems PD disaggregation solved for LLMs:
Prior art already validated the approach on Mooncake: LightX2V ships encoder/transformer disaggregation over the Transfer Engine (blog); SGLang EPD disaggregation decouples multimodal encoders using Mooncake RDMA; SGLang's diffusion disaggregation RFC (sgl-project/sglang#19512) decomposes the same three stages inside the engine; vLLM-Omni uses
MooncakeTransferEngineConnector/MooncakeStoreConnectorfor its AR → Generation → Diffusion pipeline. This RFC generalizes these point integrations into a reusable Mooncake-level capability.Non-goals
Background: what actually moves between stages
Unlike LLM PD (paged KV cache blocks), diffusion inter-stage payloads are dense, contiguous tensors, transferred once per stage boundary, not per token:
Consequences for the design:
batch_transfer_sync_write/BatchTransferover multi-NIC RDMA; no need for per-layer streaming like KV cache.Put/Getobject model with hash-based keys (prompt hash → embedding; request-id + step → latent).Proposed design
Three deliverables, in dependency order:
1. Inter-stage transfer connector (
DiffusionConnector)A thin, framework-facing connector (Python, under
mooncake-integration/) mirroring the vLLMMooncakeConnectorsplit:register_memory) at stage start-up — the actual inference buffers (encoder output, DiT latent output, VAE input), so all transfers are DMA-only with no CPU-side copies or serialization — and exposes them as segments.batch_transfer_sync_read(or the producer pushes withbatch_transfer_sync_write), using the existingP2PHANDSHAKEmetadata path so no extra metadata service is required.Put/Get): the producer publishes into the Store's cluster-wide DRAM pool (with SSD spill) and frees its VRAM immediately — decouples producer/consumer lifetimes, which is required for queue-based orchestration (below), elastic pools, and any-to-any routing. This is the same relay pattern SGLang-Omni already uses for thinker/talker/vocoder stages.publish()is asynchronous per request (not per batch), so one slow request in a producer batch never gates its batchmates' handoff.2. Queue-based orchestration
LLM PD routing is point-to-point (a prefill instance is paired with a decode instance per request). Diffusion stages have wildly different service times (encode: ms; denoise: seconds–minutes; decode: seconds), so static pairing wastes capacity. We propose per-stage queues with Store-relayed handoff — deliberately asymmetric, because the stages are not symmetric:
Mechanics:
3. Cross-instance caching (reuse, not just transfer)
Mooncake Store as a shared cache pool for diffusion, analogous to prefix caching / the SGLang Encoder Global Cache Manager:
Proposed API sketch (Python)
Architecture
Chunked Denoise → Decode handoff, overlapping transfer and decode:
Implementation plan
DiffusionConnectorwith whole-tensor P2P + Store-relay modes; reference integration in LightX2V (upstream its ad-hoc transfer onto the connector)Benchmarks to publish with Phase 2/3: (a) end-to-end video-gen throughput and P99 TTFF (time-to-first-frame) for colocated vs. disaggregated at equal GPU count; (b) Denoise→Decode transfer overlap efficiency; (c) decode-pool sharing ratio (N denoise groups : M decode workers) at target SLO; (d) connector overhead vs. a raw
batch_transfer_sync_writebaseline, confirming the connector adds metadata/scheduling cost only, not data copies.Alternatives considered
Open questions
mooncake-integration/?Related work
Before submitting a new issue...
@github-actions[bot] commented on GitHub (Jul 13, 2026):
Thanks for opening this issue, @gangula-karthik!
56480632A maintainer will triage this when possible. To help us respond faster, please include:
Useful links: Documentation · Contributing guide
@stmatengss commented on GitHub (Jul 13, 2026):
Great RFC, thanks for the detailed write-up! Extending Mooncake Conductor to handle this multi-stage orchestration rather than making it a separate service, as it aligns well with its current routing role. The credit-based flow control is also a crucial addition to prevent OOM/bottlenecks. Great work!
@gangula-karthik commented on GitHub (Jul 13, 2026):
Thanks for the comments! Will work on implementation as well, before that could you also share the slack invite link as it is expired, thanks!
@stmatengss commented on GitHub (Jul 15, 2026):
Please try this link: https://join.slack.com/t/mooncake-project/shared_invite/zt-3qx4x35ea-zSSTqTHItHJs9SCoXLOSPA
@gangula-karthik commented on GitHub (Jul 19, 2026):
Phase 1 scope & aim
Per the RFC's implementation plan (Phase 1 row):
DiffusionConnectorwith whole-tensor P2P + Store-relaymodes, plus a reference integration in LightX2V (replacing its ad-hoc transfer code with the
connector). Depends only on existing Transfer Engine / Store APIs — no changes to TE/Store
internals needed. This phase intentionally excludes chunked latent transfer, the queue-based
orchestrator, and caching (those are Phases 2–4).
Phase 1 tracking
StagePayload,StageHandle,P2PSegmentRef, constructor,publish/consumesignatures,auto-mode selection rule) — PR: #2992publish/consumefortransfer_mode="p2p") — PR: TBDpublish/consumefortransfer_mode="store", delete-on-consume lease) — PR: TBDWill keep this comment updated as each PR lands.
@github-actions[bot] commented on GitHub (Oct 18, 2026):
This issue has had no activity for 90 days and will be closed in 7 days if there is no further activity. Please comment or react if it should stay open.
@github-actions[bot] commented on GitHub (Oct 25, 2026):
Closing due to 3 months of inactivity. If this is still relevant, please comment and we can reopen.