feat(rollout): send per-GPU weight-sync payloads to multi-GPU engines - #81
Draft
Rockdu wants to merge 1 commit into
Draft
feat(rollout): send per-GPU weight-sync payloads to multi-GPU engines#81Rockdu wants to merge 1 commit into
Rockdu wants to merge 1 commit into
Conversation
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.
What
payload_gpu_uuids), so every sgl-d worker imports the payload of the training rank on its own GPU.num_gpusis the engine's GPU span,tp_sizecomes from--sglang-tp-sizeinstead of being hardcoded to that span, and the engine pins the whole span instead of a single GPU.validate_argsrejects--sglang-tp-size * --sglang-sp-degree != --rollout-num-gpus-per-engine.sp_degree=2).Why
--rollout-num-gpus-per-engine > 1used to mean TP only, becausetp_sizewas pinned to the span andnum_gpuswas never passed, so--sglang-sp-degreecould not be satisfied. With the span split bytp_size * sp_degree, the same allocation serves TP, SP, or TP x SP rollout engines.The payload labels remove an assumption in the weight-sync path: the gathered list is ordered by training rank, and a worker only ends up with its co-located rank's buffer if the engine's GPU span is ordered the same way. Labelling by GPU makes the pairing explicit, and a mismatch (engine span != the span miles gathered over) fails loudly instead of silently importing a peer GPU's memory.
Requires the matching sglang-d change (
payload_gpu_uuidsonUpdateWeightFromTensorReqInput); a build without it drops the field and the worker rejects the request instead of guessing.Files
miles/backends/fsdp_utils/diffusion_update_weight_utils.py— gather(gpu_uuid, payloads)per rank, send the labels with the request.miles/backends/sglang_diffusion_utils/sglang_diffusion_engine.py— forwardpayload_gpu_uuids;num_gpus/tp_sizeserver args; pin the engine's whole GPU span.miles/backends/sglang_diffusion_utils/arguments.py— reject a span thattp_size * sp_degreedoes not fill.scripts/run-diffusion-grpo-wan22-pickscore-5gpu-rollout-sp2.sh— the 5-GPU Wan2.2 recipe plus--rollout-num-gpus-per-engine 2 --sglang-sp-degree 2.Validation
On 8xH200 with the Wan2.2 recipe at
rollout_num_gpus_per_engine=2, sp_degree=2: both engines started asnum_gpus=2, tp_size=1, sp_degree=2, ulysses_degree=2with CFG parallel auto-disabled, each pinned to its own GPU pair, 8 weight syncs returned 200 OK across both experts with zero skipped updates, and a temporary probe confirmed all four workers imported a buffer on their own physical GPU.That run used an earlier variant of the sgl-d side (world-rank indexing); the UUID-labelled path here has only had a logic walkthrough. End-to-end (rollout samples -> reward -> first train step) is still unverified: the run was cut short, and the old sp branch it started from could not finish a rollout because it predates the msgpack rollout transport (
af1fdc0).Checklist
pre-commit runpasses on the touched filespytest -xis green — not runpython3 train.py --helpstill parses — no new flags; only existing--sglang-*args are used