Repository navigation
feat(sc): telemetry for rollout checkpointing - #3925
Conversation
30ba01f to
a9f5575
Compare
e847da0 to
2df5b12
Compare
2df5b12 to
70940a9
Compare
|
/ok to test 70940a9 |
70940a9 to
deabd07
Compare
deabd07 to
a4c10a7
Compare
a4c10a7 to
23d1295
Compare
Signed-off-by: Anish Mahishi <[email protected]> (cherry picked from commit 815f3d9)
Signed-off-by: Anish Mahishi <[email protected]> (cherry picked from commit 9853cf4)
Signed-off-by: Anish Mahishi <[email protected]> (cherry picked from commit 67f8278)
Signed-off-by: Anish Mahishi <[email protected]> (cherry picked from commit eafe0a5)
(cherry picked from commit af43edd) Signed-off-by: Anish Mahishi <[email protected]>
Signed-off-by: Anish Mahishi <[email protected]>
Signed-off-by: Anish Mahishi <[email protected]>
Signed-off-by: Anish Mahishi <[email protected]>
Signed-off-by: Anish Mahishi <[email protected]>
Signed-off-by: Anish Mahishi <[email protected]>
Signed-off-by: Anish Mahishi <[email protected]>
Signed-off-by: Anish Mahishi <[email protected]>
1784afe to
195df04
Compare
Signed-off-by: Anish Mahishi <[email protected]>
|
/ok to test a3dfa6c |
terrykong
left a comment
There was a problem hiding this comment.
Follow-up on 195df04 (head a3dfa6c, rebased on main). Checked every thread from the first review against the code rather than the replies: 18 of 19 are fixed and resolved. Two things below, one of which blocks approval.
Verified locally at a3dfa6c: ruff 0.9.9 check + format clean on the 14 changed Python files; tests/unit/single_controller + tests/unit/utils/test_logger.py + tests/unit/experience/test_rollout_manager.py → 5 failed / 1084 passed, all five from the one regression below. (13 further failures in test_setup.py::TestOPDFullValidation are main's #3978 needing an env var; not this PR.)
CI on a3dfa6c agrees: L0_Unit_Tests_Other fails on exactly this — test_run_restores_native_tq_replay_metadata_without_payload_reput with the target_step_list AttributeError at single_controller.py:991 (the run stops at the first failure, so the other four show up once that one is fixed). L0_Unit_Tests_Models_1 is test_stream_weights_via_ipc_zmq_impl timing out, which nothing in these commits touches, and the quality gate is downstream of both.
Two inline comments: the _FakeTQBuffer regression from the new cursor check (blocking, one-line fix), and a low-severity symmetry note on the admission guard.
Generated by Claude Code
Signed-off-by: Anish Mahishi <[email protected]>
|
/ok to test e48366d |
Signed-off-by: Anish Mahishi <[email protected]>
|
/ok to test 054bb6f |
Eleven commits, two conflicts. nemo_rl/algorithms/single_controller.py -- NOT a keep-both. #3925 (telemetry for rollout checkpointing) replaced the retry-count approach with a reason-typed result: it deletes _MAX_CONSECUTIVE_ROLLOUT_CHECKPOINT_FAILURES and adds the _RolloutCheckpointSaveResult dataclass in the same place this branch's _SUPERVISOR_DRAIN_TIMEOUT_S sits. Resolved as ours + main's dataclass, with the constant dropped: it has no remaining users anywhere in the merged tree, this branch never referenced it, and RolloutCheckpointAttemptReason is imported and used by the replacement. Keeping it would have resurrected a name main removed on purpose. tests/unit/environments/test_nemo_gym_utils.py -- adjacency, as before. #3368 (actor failure and teardown ownership) appends module-level tests to the same end-of-file this branch appended TestUnresolvedAgentRefsAreDiagnosable to. main's functions first, this branch's class after. The other nine merged clean, including #3739 (nccl_reshard M-to-N refit for Megatron generation) and #4063 (refit_with_reload_api in the v2 entrypoint), both of which touch refit paths this PR hardens. Verified after the merge: every artefact this PR adds is still present (_refit_participants, _SUPERVISOR_DRAIN_TIMEOUT_S, the aggregated router drain, shard_liveness_ref, record_weight_version, should_rebuild, restart_backoff_s, the router's transport-cause log), submodule pins match main on all three, and 1398 tests pass across single_controller, fleet_health, the generation router, the gym utils and weight_sync. pyrefly reports two new import errors beyond the known one, all three in data_plane/adapters/transfer_queue.py from #4103, inside a try/except ImportError that exists to report exactly that drift. Optional TQ submodules absent from this container, not a regression. Signed-off-by: asolergibert <[email protected]> Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
#3925 moved trainer metrics onto a custom nemo_rl/step axis: trainer rows are logged without step=, each trainer metric is defined with step_metric="nemo_rl/step", and independent telemetry events commit rows of their own. W&B's Step then counts rows, not trainer steps (SingleController canary: trainer steps 1 and 2 at _step 49 and 61), and charts no longer line up with earlier runs plotted against Step. Set WANDB_CALLER_STEP_METRIC to "step", which now stands for W&B's own step. Each use of the constant special-cases that value; any other value keeps the #3925 behavior. - Trainer rows: run.log(row, step=trainer_step), with no extra field. - Trainer metrics: defined without a step_metric, i.e. on W&B's Step. - Custom-axis events (rollout telemetry, GPU monitoring): run.log(event, commit=False), so they join W&B's current row instead of advancing its step, keeping the last value of each key per trainer step, as on the super-v3.5-posttraining branch. - No hidden custom step metric is defined at startup. Trainer steps must be logged in nondecreasing order, which the SingleController and legacy drivers do. The #3925 assertions in tests/unit/utils/test_logger.py are not updated (8 tests fail). Signed-off-by: Peter Jin <[email protected]>
What does this PR do?
Summary
Adds observability for Single Controller rollout checkpointing and recovery.
This PR measures whether periodic checkpointing affects rollout throughput, where checkpoint and restore time is spent, how much work is blocked by checkpoint barriers, and how effectively completed rollout work is reused after restart.
Stacked on #3924.
What changed
Rollout throughput
Adds metrics for:
Raw generation throughput uses cumulative counters exposed through the generation interface. vLLM implements these counters today; other inference backends can add support through the same interface. With token capture, committed tokens are counted exactly from valid staged rows; without token capture, they are estimated from the per-sample mean and completion count.
Checkpoint latency and backpressure
Adds phase-level checkpoint timing:
Also records:
controller_sidecar_bytesintentionally excludes the native TQ payload because the current TQ checkpoint API does not report its size. The implementation avoids recursively scanning the shared checkpoint directory because doing so could perturb checkpoint benchmarks.Checkpoint outcomes
Every scheduled checkpoint attempt records:
Checkpoint invariant violations continue to fail immediately. Retryable I/O and timeout failures retain bounded retry behavior controlled by
rollout_checkpointing.max_consecutive_failures.Restore and recovery
Adds restore timing for:
Recovery-efficiency metrics report:
The restore path now rejects a sampler cursor that is older than restored rollout work instead of silently dropping colliding prompts. Coverage includes a real rollout-pump borrow and repayment round trip through checkpoint capture and restore.
Logging behavior
Independent checkpoint, recovery, and throughput events use absolute wall-clock time for visualization so telemetry continues advancing during a long trainer step and across process restart.
nemo_rl/stepremains the trainer-correlated step axis. W&B's internal_stepis a monotonically increasing event-row index.Wall-clock sampling is disabled by default. Set
rollout_checkpointing.telemetry_interval_sto a positive interval in seconds to enable it; this does not change checkpoint cadence.Primary dashboard
The intended high-level dashboard contains:
The remaining controller, buffer, vLLM request, KV-cache, and per-mutation metrics are diagnostic drill-down signals.
Additional fixes
This PR also incorporates review follow-ups that:
Validation
Completed locally:
ruff checkruff format --checkgit diff --checkRecommended unit tests:
Issues
Closes #4047
Before your PR is "Ready for review"
Pre checks: