Dev/gtong/disagg pipeline - #402
Draft
gtong-nv wants to merge 4 commits into
Draft
Conversation
Signed-off-by: Gangzheng Tong <gtong@nvidia.com>
Signed-off-by: Gangzheng Tong <gtong@nvidia.com>
Signed-off-by: Gangzheng Tong <gtong@nvidia.com>
Signed-off-by: Gangzheng Tong <gtong@nvidia.com>
gtong-nv
marked this pull request as draft
July 30, 2026 23:25
Contributor
Greptile SummaryAdds three-stage LingBot inference disaggregation and benchmark tooling.
Confidence Score: 5/5The PR appears safe to merge, with no concrete changed-code defect identified. The stage lifecycle, tensor handoffs, subgroup rank handling, collective participation, and documented topology constraints are internally consistent, and the advisory leads do not establish a PR-introduced reachable vulnerability. Important Files Changed
Sequence DiagramsequenceDiagram
participant E as Encoder GPU
participant D as DiT GPU/CP Group
participant V as Decoder GPU
E->>E: Encode conditioning and controls
E->>D: Mooncake tensor handoff
D->>D: Denoise and update resident KV cache
D->>V: Mooncake clean-latent handoff
V->>V: Decode video frames
Reviews (1): Last reviewed commit: "Add aggregated LingBot CP8 baseline" | Re-trigger Greptile |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Three-stage disaggregated inference
LingBot can load the encoder, DiT, and decoder on three independent GPUs:
This is pipeline-stage disaggregation, analogous to SGLang's independently
scheduled prefill and decode pools but split at diffusion-native boundaries.
The evolving autoregressive KV cache stays on the DiT worker. Only one-shot
conditioning, per-step encoder features, and clean latents cross stage
boundaries. Moving the KV cache every chunk would add a much larger transfer
and break session affinity.
Install the optional Mooncake transport:
uv sync --package flashdreams-lingbot --extra dev --extra disagg # The container/host runtime must also provide the RDMA userspace libraries. apt-get install libibverbs1 ibverbs-providers librdmacm1 ibverbs-utilsRun the reproducible three-GPU benchmark:
Use all eight GPUs for concurrent sessions by keeping one encoder and one
decoder worker and assigning the other six GPUs to session-affine DiT workers:
The allocation is derived from the tracked 1:1:1 stage service times. It is a
throughput topology: each DiT replica owns a distinct session and KV cache.
It does not split one session's DiT computation over six GPUs.
To minimize one session's latency instead, make ranks 1–6 one context-parallel
DiT group. Rank 1 receives the Mooncake handoff, broadcasts the input within
the NCCL subgroup, and sends the gathered clean latent to rank 7:
CP6 must use ring attention for this 40-head model. Ulysses requires the head
count to be divisible by the context-parallel size, so CP6 Ulysses is rejected
(
40 % 6 != 0). A CP4 Ulysses comparison uses six processes and leaves twoGPUs idle:
Cap Inductor compilation parallelism when several compiled DiT ranks share a
node. The default 32 workers per rank becomes 192 workers at CP6 and can
overcommit the host during cold compilation.
On the tested H100 node, CP6 ring was the minimum-latency allocation: 743.27 ms
median per 12-frame chunk and 15.90 generated FPS, a 3.01× latency speedup over
CP1. CP4 Ulysses reached 754.41 ms and 15.70 FPS. CP6 was 1.5% faster; CP4 had
higher scaling efficiency and left two GPUs available for other work.
For an aggregated baseline, put the complete pipeline on every GPU and use all
eight ranks as the DiT context-parallel WORLD group:
The normal 832×464 grid has 4,524 tokens and cannot divide over CP8. The
nearest valid height is 448, which produces 4,368 tokens. On eight H100s, the
aggregated CP8 Ulysses run reached 393.33 ms median latency and 29.50 generated
FPS. It is the fastest tested single-session topology, but it replicates
encoder and decoder work and gives up independent stage placement. The
aggregated report and
comparison chart include the
resolution-normalized throughput and node-wide HBM tradeoff.
Validate the data plane without loading checkpoints:
Both benchmarks write
benchmark.jsonand a Markdown summary. They report:and effective GB/s for encoder → DiT and DiT → decoder;
small-payload setup overhead;
See the
three-stage H100 experiment report
for the tested stack, measurement method, detailed findings, Slurm
reproduction procedure, 1:1:1 versus 1:6:1 results, component chart, and
acceptance limitations, including the CP4/CP6 single-session comparison.
Mooncake is explicitly initialized with its
rdmaprotocol. On a single node,the engine may select a topology-local GPU path; the measured effective GB/s
is therefore authoritative for that allocation, while the protocol name alone
must not be presented as proof that traffic traversed an InfiniBand NIC.
Cross-node deployment additionally needs routable stage hostnames, RDMA-capable
NICs, GPUDirect RDMA, and a control plane that forwards the opaque
TensorTransferTicketbetween stage services.The design follows the
LightX2V three-stage disaggregation study:
control-plane messages carry only tensor metadata and registered destination
addresses; Mooncake moves the tensor payload directly between device buffers.