NVIDIA-NeMo/RL #4607
(nemo-lens bump, rl.iteration on every span, shared nv.dl.* attributes).
All permalinks pin the PR head 2f6b955.
Two pages on this PR, one question each. This one: what the step number change does.
rl.iteration = 412.
That filter only finds spans that carry the tag. Dotted words have a short explanation: hover or tap them.Each training loop now opens its step inside
iteration_scope(step)
(for GRPO: grpo.py:3231).
It puts {rl.iteration: 412} in a
ContextVar
(lens helpers.py:37),
and a lens span processor copies it onto every span as the span starts
(providers.py:42-48).
No call site has to pass the number. A new span added inside the step later is covered too.
rl.iterationA span that sets rl.iteration itself keeps its own value. Validation uses this: it also runs once before training and reports 0 there.
The finalize span uses it too, because it runs on its own thread, and a raw thread starts with an empty ContextVar.
| Change | Before | After |
|---|---|---|
Shared nv.dl.* resource attributes | 2 (rank, world size) | 17: topology, batch sizes, optimizer, step target, library versions, run uuid. The same keys a Megatron run reports. |
rl.checkpoint.finalize span | Checkpoint span ended when the loop was released, while async writers were still going | A second span that ends when tmp_step_N is renamed, i.e. when the checkpoint can be resumed from |
rl.host.memory.* gauges | Host memory reached W&B only | The driver reads each node's Ray metrics page every 10 s and records used/total bytes per host |
| Renamed keys (breaking) | rl.step, dl.tensor_parallel.size, dl.pipeline_parallel.size | rl.iteration, nv.dl.topology.size.tp, nv.dl.topology.size.pp |
rl.step or dl.*_parallel.size must be updated.
Four loops never open a step scope (grpo_sync, async PPO, xtoken distillation, MPO), so their spans still carry no rl.iteration, even though the docs say every loop does.
The new rl.checkpoint.async_save tag on the finalize span is always true, which is the subject of the
second page.
π review comment β span-groups.md:149 (loops without the scope)