feat: add Mooncake RDMA transport for rollout data - #1709
Conversation
ab886da to
a81a18d
Compare
2feb77b to
3fe7b30
Compare
|
I re-ran the comparison using a PR-aligned bandwidth accounting boundary. The key point is that NIXL raw NIXL aligned PUT = pack_rollout_to_cuda(data) + ray.put(packed, _tensor_transport="nixl") For this reason, I report NIXL I also added unpack/reconstruct timing on the NIXL reader side. So the NIXL GET bandwidth below uses The main observation is that NIXL's pure packed-payload transfer is fast, but reconstructing the legacy rollout dict is expensive. In other words, the large gap between Benchmark: slime rollout dict, cross-machine RDMA, 2-node H20 cluster, 1000-sample rollout payload tiled/subsampled to target sizes.
My interpretation is that NIXL has a very strong raw transport path once the payload is already packed: the pure PUT cost is only around On the GET side, after including unpack/reconstruct back to the legacy rollout dict shape, Mooncake also has higher GET BW across all tested sizes. NIXL pure GET is still useful as a raw packed-payload transport reference, but it should not be treated as a complete legacy-dict GET replacement. |
|
Additional hardware note for the benchmark above: The cross-machine RDMA benchmark was run on a 2-node H20 cluster with BlueField-3 E-series SuperNICs. RDMA NIC model: RDMA bandwidth: Also note that the original performance numbers in this PR were measured on an eRDMA setup, while the later numbers I reported were measured on this RDMA setup. Therefore, the later RDMA results are expected to be better than the original eRDMA results. |
|
Great! Do we need to upgrade mooncake for this PR? |
@zhuzilin Yes. This PR should be used with the latest Mooncake main. The required structured-object transfer APIs have already landed there. Once Mooncake cuts a release containing the current main APIs, we can pin/document that release version here. |
|
The mooncake package has been upgraded to version 0.3.12.post1 on the sglang side, fully supporting all features in this PR. |
Enable rollout data transfer via Mooncake structured object store as an alternative to Ray object store, activated by --rollout-data-transport=mooncake. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…lease Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Switch imports from export_dataproto_ref/import_dataproto_ref to export_ref/import_ref to align with mooncake's parallel API refactoring. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Move release_result from get_mooncake_rollout_data to after training completes in actor.py, preventing premature buffer corruption. - Move transport type check from cleanup_mooncake_rollout_refs to call sites in train.py and train_async.py per reviewer feedback. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Use static rollout field schemas and explicit producer/consumer segment contribution so Mooncake rollout transfer avoids runtime schema inference while keeping deployment-specific store settings externalized. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Explicitly assign rollout fields to DataProto sections so metadata lists do not affect row-count detection and tensor fields follow the batch path. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
@lilei199908 This PR has been rebased onto the latest main. I also added English and Chinese user guides covering prerequisites, complete two-node setup, TCP/RDMA configuration, sync/async entrypoints, the configuration reference, and troubleshooting.\n\nThe documented path was validated with the same Mooncake wheel on both nodes: both TCP and RDMA structured-object transfer passed, including GET result release and object cleanup, and a two-node Qwen3-4B job completed several rollout/training iterations through the Mooncake RDMA backend. Could you please take another look when convenient? |
|
@lilei199908 CI update after the full run completed: the original failing test_qwen3_30B_A3B.py passed, and the transient Moonlight model-loading failure also passed. The branch is already based on the latest main (behind_by: 0), so rebasing would be a no-op. The run was ultimately blocked by two infrastructure or baseline failures: (1) test_full_disk_weight_update.py stayed in Execute on h20-node0 for nearly six hours and was cancelled, although the same official test normally passes in about five minutes on h20-node1; (2) test_qwen3.6_35B_A3B_pd_mooncake.py failed in torch_memory_saver.pause() with cudaError invalid argument. Current run: https://github.com/THUDM/slime/actions/runs/31824820879. Could you please reset or inspect h20-node0 and rerun the failed jobs? |
Summary
Add Mooncake structured object store as an alternative transport for rollout data between rollout manager and trainer, activated by
--rollout-data-transport=mooncake. This bypasses Ray's plasma object store and transfers rollout tensors directly over RDMA, reducing cross-node data transfer latency by ~3x for typical rollout payloads.Performance
Benchmark: slime rollout dict , cross-machine (eRDMA, A10 cluster):
~3x faster on the trainer-side get path, which is on the critical path of the training loop.
Why faster than Ray
Ray object store serializes the entire dict with pickle/msgpack, then transfers the serialized blob over gRPC/plasma. On the receiver side it deserializes the full payload.
Mooncake takes a different approach:
typed_raggedcodec: Variable-length tensor fields (tokens, loss_masks, log_probs, etc.) are encoded as flat buffer + offset array, enabling scatter-gather RDMA reads without per-element picklingThe net effect: Ray pays serialize + network + deserialize; Mooncake pays only network (RDMA) + lightweight metadata decode.
Design
slime/utils/data_transfer.py, 84 lines) + minimal dispatch in existing code (+103/−3 total)_ROLLOUT_DATA_TENSOR_DTYPES(statically cached), passed toput_legacy_dictfortyped_raggedcodec onvariable-length tensor fields
Boxwrapper pattern as nixl transport — transparent to training loopcleanup_mooncake_rollout_refs()after each training step to free remote buffersUsage
Testing
No benchmark scripts or benchmark outputs are included in this PR.
Checklist