Repository navigation
perf(data-plane): cut sync TQ overhead and count the rollout actor metrics - #4580
Conversation
35bcb09 to
6ff0f3e
Compare
yuki-97
left a comment
There was a problem hiding this comment.
Merge blockers — please target the r0.8.0 branch instead of main and add the cherry-pick-to-main label, since this is a fix PR for the v0.8 release.
Thanks for the fix: the sync data-plane slowdown is now cheaper (data.num_workers: 0 and fewer TQ columns written) and visible in the metrics, since the rollout actor's kv_first_write is counted in the cluster view.
Scope: grpo_sync.py, sync_rollout_actor.py, tq_policy.py, data_plane/README.md, and the nine *-tq_mooncake recipes.
Checked:
- Dropped TQ columns — nothing reads them back: workers fetch
DP_TRAIN_FIELDS,attach_message_log_viewno-ops when the decomposed fields are absent, and validation takesturn_roles/turn_contentsfromdriver_carry. data.num_workers: 0— it feeds both the train and valStatefulDataLoader, nopersistent_workers/prefetch_factoris set that would reject 0, and the nine recipes are every*-tq_mooncakerecipe except the single-controller one.- Snapshot fan-out — the extra-source refs are submitted before the worker fan-out blocks so the round trips overlap, and a failure is dropped like a worker's rather than failing the step.
Remaining comments are on the debug timers, docs and comments left stale by the dropped columns, how the rollout actor exposes its snapshot method, and whether the single controller mooncake_cpu recipe needs the same num_workers setting.
- Drop the debug timers (rollout_to_tq per-phase actor_timing/ plumbing, validate_sync and logprob sub-timers) so timing matches grpo.py and the single-controller path; restore the original validation loop. - SyncRolloutActor.get_data_plane_snapshot: explicit method instead of borrowing TQWorkerMixin's. - Fix docstrings/comments left stale by not writing turn_* to TQ (validate_sync, llm_message_utils MESSAGE_LOG_BULK_FIELDS). Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Zhiyu Li <[email protected]>
…or in metrics - rollout_to_tq: stop writing columns nothing reads back to TQ (turn_*, non-tensor fb pass-through such as extra_env_info/idx/stop_strings/ task_name). They were msgpack'd per field x row on every step; kv_first_write drops from ~1.2s to ~0.4-0.6s/step on prorlv2 qwen2.5-math-1.5b. Validation still gets turn_* via driver_carry. - Cluster data-plane metrics now include the rollout actor's client (SyncRolloutActor.get_data_plane_snapshot + TQPolicy .add_data_plane_snapshot_source), so kv_first_write is counted. - Validation DataLoader: persistent workers primed in setup() before the data plane pins its RDMA segment on the driver; forking afterwards copied the pinned pages (~20s per validation). - Per-phase timers for rollout_to_tq (incl. Ray dispatch/return legs), validate_sync, and policy/reference logprobs. - data_plane/README.md: rollout actor is now in the cluster fan-out; validation example reads turn_* from driver_carry. prorlv2-qwen2.5-math-1.5b-instruct-1n8g-fsdp2tp1.v2-tq_mooncake, 450 steps (steps 2-450): mean/median step 21.48/17.34s -> 17.91/16.10s (no data plane: 16.76/14.95s); validation ~23s -> ~1.8s; nightly metric checks pass. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Zhiyu Li <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Zhiyu Li <[email protected]>
Set data.num_workers: 0 in the nine GRPO-sync mooncake_cpu recipes, and drop the setup-order val-loader priming. mooncake_cpu RDMA-pins a large segment on the driver, and forking a DataLoader worker after that copies the pinned pages (~20s per validation, measured on the prorlv2 recipe). No data-loader code change remains. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Zhiyu Li <[email protected]>
- Drop the debug timers (rollout_to_tq per-phase actor_timing/ plumbing, validate_sync and logprob sub-timers) so timing matches grpo.py and the single-controller path; restore the original validation loop. - SyncRolloutActor.get_data_plane_snapshot: explicit method instead of borrowing TQWorkerMixin's. - Fix docstrings/comments left stale by not writing turn_* to TQ (validate_sync, llm_message_utils MESSAGE_LOG_BULK_FIELDS). Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Zhiyu Li <[email protected]>
9eda780 to
4fe00c9
Compare
|
@yuki-97 thanks for the review. Everything is addressed:
Head is now |
|
/ok to test 4fe00c9 |
|
/ok to test 4fe00c9 |
|
The automatic cherry-pick to |
What
The GRPO sync data-plane path (
data_plane.enabled=true,mooncake_cpu) was ~4.7 s/step slower than the no-data-plane baseline on the prorlv2 qwen2.5-math-1.5b nightly. The reporteddata_plane/*/wall_s(~0.5 s) didn't account for it. This PR fixes the two largest causes and closes the metrics gap that hid them.rollout_to_tqwrites only columns someone reads. It stops writingturn_lengths/turn_roles/turn_contentsand the non-tensorfinal_batchpass-through columns (extra_env_info,idx,stop_strings,task_name) to TQ. Mooncake stored each as its own msgpack object per field × row, and nothing on this path reads them back: workers fetchLP_SEED_FIELDS/DP_TRAIN_FIELDS, the driver readscontent/input_ids, and validation getsturn_*viadriver_carry.kv_first_writedrops from ~1.2–1.7 s to ~0.4–0.6 s/step.StatefulDataLoader(num_workers: 1) re-forked its worker every pass after the driver had mounted its RDMA-pinned Mooncake segment (~68 GB), and the fork copied the pinned pages (~20 s per validation). The nine GRPO-syncmooncake_cpurecipes now setdata.num_workers: 0, so data loads in-process and nothing forks from the pinned driver. This is config-only; there is no data-loader code change.SyncRolloutActor.get_data_plane_snapshotplusTQPolicy.add_data_plane_snapshot_source. The cluster view now countskv_first_write, which was the step's largest write and was previously invisible (n_processes9 → 10, put volume ~3 → ~18 MB/step).data_plane/README.mdand thellm_message_utils/validate_syncdocs updated to match.(Per-phase timers were used during the investigation to locate (1) and (2); they are not part of this PR.)
Results
prorlv2-qwen2.5-math-1.5b-instruct-1n8g-fsdp2tp1.v2-tq_mooncake, 450 steps, CI containerrl.71876279, steps 2–450:...fsdp2tp1.v2)878d98f2b, with timers)4fe00c91donr0.8.0)token_mult_prob_errormedian 1.005 (1.004 at step 450); hash mismatches 0.Not in this PR (follow-ups)
tq_mooncake_checkpoint.pyalready zeroes it, but only in checkpoint mode. Zeroing it unconditionally would make every driver fork cheap, which would also fix the train-loader epoch rollover.num_workers: 0(e.g. aforkserverworker context when the backend ismooncake_cpu), which would keep parallel data loading.vlm_grpo-nemotron-omni-…-tq_mooncakenow loads images in the driver. That should be small, but it hasn't been measured._record_actor_timing,collect_data_plane_snapshotswith extra sources, and the reducedrollout_to_tqwrite set.Test plan
data.num_workers: 0on the prorlv2 recipe: validation 6.9 s (first, warm-up) / 1.75 s,data_processing0.03 s/stepruff check/ruff format --check🤖 Generated with Claude Code