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
|
/ok to test 23d1295 |
terrykong
left a comment
There was a problem hiding this comment.
This PR adds telemetry for rollout checkpointing in the single controller: a telemetry_interval_s sampling pump, throughput/save/restore/outcome metric families, checkpoint-barrier mutation counters in the replay buffer, and a new metrics doc section. It also moves WandbLogger.log_plot and log_histogram onto the buffered-step path so plots and scalars land in the same W&B history row.
Worth calling out: your earlier self-review round holds up. Checked against the code at HEAD rather than the "addressed in ..." replies — the rebase rewrote the commits those replies cite — 10 of the 11 findings are genuinely fixed. The 11th has its own thread reply: the test-side half landed and the production-side half did not, and it is harmless, so it just needs the thread not to close on a stale premise.
Local evidence at a4c10a78:
tests/unit/utils/test_logger.py+tests/unit/single_controller/: 1014 passed.tests/unit/experience/+tests/unit/data_plane/: 648 passed, 15 skipped. All 15 skips are missing dependencies (4xnemo_gym, 11xmooncake), none GPU.- ruff 0.9.9 clean on all three pinned hooks. Pyrefly reported no error in any file this PR touches, but the dependency set was incomplete, so treat that as a partial check rather than a clean bill.
Two housekeeping items. The PR is currently marked as conflicting with main — please rebase and resolve before the next round. And the review is pinned to a4c10a78; the head has since moved to 23d12951, which differs only in .github/workflows/cicd-main.yml and two functional-test scripts (13 lines), so every comment below still points at the code it describes. /ok to test 23d1295 is now running, which is what closes out the two pyrefly findings from the last round and the canonical_output_tokens arms that no local lane executed.
One coverage note: tests/unit/data_plane/test_rollout_reassembler.py is module-level skipped locally for missing nemo_gym, so the new canonical_output_tokens assertion only runs in CI's Nemo_Gym lane.
Nineteen inline comments: two getattr guards that cannot do what they look like they do, an ungated per-tick print, one docs/code mismatch in the recovery metrics table (the most substantive one — a round-trip test on the real restore path is attached, and it asks that the re-admission discard raise instead of dropping prompts, with a startup check that the restored sampler cursor is not behind the restored buffer), a naming ask for the canonical_* throughput keys, a note that the long-stalled recovery test closes #4047 and should say so, an undocumented on-switch, a hand-copied kind list, three test-coverage gaps, and six placement/duplication notes on the telemetry constants (including the mutation-kind list, which should be an enum so a wrong kind fails instead of vanishing from the series, and the hard-coded three-failure cap on the snapshot pump) — one of which is a wall-clock axis that restarts at 0 on every resume, so before- and after-restart series overlap.
Generated by Claude Code
Signed-off-by: Anish Mahishi <amahishi@nvidia.com> (cherry picked from commit 52aa315)
Signed-off-by: Anish Mahishi <amahishi@nvidia.com> (cherry picked from commit 815f3d9)
Signed-off-by: Anish Mahishi <amahishi@nvidia.com> (cherry picked from commit 9853cf4)
Signed-off-by: Anish Mahishi <amahishi@nvidia.com> (cherry picked from commit 67f8278)
Signed-off-by: Anish Mahishi <amahishi@nvidia.com> (cherry picked from commit eafe0a5)
(cherry picked from commit af43edd) Signed-off-by: Anish Mahishi <amahishi@nvidia.com>
Signed-off-by: Anish Mahishi <amahishi@nvidia.com>
Signed-off-by: Anish Mahishi <amahishi@nvidia.com>
Signed-off-by: Anish Mahishi <amahishi@nvidia.com>
Signed-off-by: Anish Mahishi <amahishi@nvidia.com>
Signed-off-by: Anish Mahishi <amahishi@nvidia.com>
Signed-off-by: Anish Mahishi <amahishi@nvidia.com>
Signed-off-by: Anish Mahishi <amahishi@nvidia.com>
1784afe to
195df04
Compare
|
/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 <amahishi@nvidia.com>
|
/ok to test e48366d |
Signed-off-by: Anish Mahishi <amahishi@nvidia.com>
|
/ok to test 054bb6f |
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: