Where a rollout checkpoint save shows up: W&B before, W&B and Lens after
NVIDIA-NeMo/RL #4730 โ
export rollout checkpoint metrics to Lens. All permalinks pin the PR head ec5348f. The review-comment links below work once the review is published.
Before
Rollout snapshot timings, sizes and attempt outcomes went to W&B and the file/MLflow loggers only. Lens had no rl.checkpoint.* series and no span for a snapshot save.
This PR
Copies those same logged numbers into Lens: 8 metrics, plus one trace span per completed save. The checkpoint code itself does not change.
Status
Open PR, in review. The review found no correctness bug in the export. It has 11 suggestions (docs, shared names, code comments, one test gap).
Background. In Single-Controller runs, a background task (the
snapshot pump)
saves rollout state every few seconds while training keeps running. It only saves when the trainer sits on a durable checkpoint, so many attempts
skip.
Lens
is NeMo-RL's OpenTelemetry export. Dotted words have a short explanation: hover or tap them.
One logger call, two destinations
The controller logs each save as one dict through
_log_telemetry_metrics,
which adds the step and the wall-clock time. Nothing changes up to
Logger.log_metrics:
it sends the dict to W&B as before, then calls the Lens tee. The PR teaches the tee three new
prefixes (metrics.py L810-L851).
The example below uses the PR's own test values.
Where they agree, and where they differ
They are the same numbers. Both paths start from the one dict the controller already
logged, so Lens adds no second timer. W&B is still the per-run record of every key. Lens is for
dashboards and alerts across runs. There, a metric label must come from a small fixed set, so the
tee keeps only the fixed operation, phase and category labels. The snapshot
number and step ride on the span, where a trace viewer can find which save was slow.
Read the save phases with care. Save phases overlap: barrier wait, the
exclusive hold
and publication all sit inside total. So never add save phases up. Restore phases do not overlap.
The span carries no goodput bucket, because the pump runs while training continues.
What the review asks
Share the names instead of copying them. The tee re-types the controller's outcome prefix, the
reason_ flag format, two key names and both outcome/reason lists. On a scratch copy, renaming any one of them
in the controller left all 58 telemetry tests green while Lens lost the series. A light module both sides already import exists:
metric_utils.py.
Do not alert on the staleness gauge. It is set only when an attempt finishes. On the locked OpenTelemetry SDK (1.44.0) a gauge sends one point per set, and nothing times out a save, so a hung save shows no new point. Alert on completed attempts instead:
increase(rl_checkpoint_attempts_total{outcome="completed"}[30m]) == 0.
Point the docs at the code.metrics.md copies metric names and logger keys that the code already declares, in two or three places, and nothing checks the copies. One has already gone stale: it cites _TRAIN_SCALARS, which no longer exists. Each table becomes one sentence naming where its rows are declared.
Shorter code comments. Keep a comment only for what the code can't show. The 13-line comment on the span constant repeats span-groups.md; five more comments tell design or review history.
Smaller fixes. Delete a test-setup block that now repeats one from main. Make the restore drift test follow dict.update(...). Correct two doc lines and one code comment. Document the default histogram buckets. Share the wall-time and step key names too.
So what. With telemetry on, Lens now shows how long rollout snapshots take,
how big they are, and whether attempts keep skipping. Before, only W&B had this. The export logic checks out.
The asks keep it correct over time: share the names the tee depends on, and alert on completed attempts, not on the gauge.