Skip to content

feat(sc): log sample-lag mean and percentiles - #5272

Merged
yuki-97 merged 4 commits into
NVIDIA-NeMo:mainfrom
christian-muertz:cmrtz/sample-lag-percentiles
Nov 24, 2026
Merged

yuki-97 merged 4 commits into
NVIDIA-NeMo:mainfrom
christian-muertz:cmrtz/sample-lag-percentiles

Conversation

@christian-muertz

@christian-muertz christian-muertz commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor
  • I, the PR author, have personally reviewed every line of this PR.

What and why

The maximum rollout lag alone cannot distinguish one stale rollout from a stale training batch. Pool lags across every consumed chunk and log weight_version_lag_mean, weight_version_lag_p50/p90/p95/p99, and weight_version_lag_max. The maximum was previously logged as weight_version_lag.

Each consumed rollout contributes once. Under forest training its first segment represents the rollout and padding contributes nothing. Lag is the step's training weight version minus the version in the row tag. On the token-capture path all siblings carry the group's oldest observed version. Empty steps log a maximum of zero. Nonempty steps report all statistics with inclusive percentile interpolation.

Issues

None.

Convergence / perf / functionality proof

This change only affects metric reporting. Ruff lint, formatting and focused CPU checks passed for forest segments and padding, ordinary rows without segment metadata, and empty steps. The controller test now checks the renamed maximum. The full controller suite was not run locally.

Needs upstream changes

None.

@copy-pr-bot

copy-pr-bot Bot commented Nov 17, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@yuki-97 yuki-97 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR keeps weight_version_lag as the step's maximum lag and adds its mean and p50/p90/p95/p99. The new statistics are computed once over the lags from every chunk of the step, so a rollout counts the same whether it arrived in a small chunk or a large one.

Scope: the sample-lag statistics in the SingleController step loop, at 1c03ac5

Checked:

  • weight_version_lag is unchanged: max(v − w) equals v − min(w), and an empty step still logs 0.
  • Lags are collected once per consumed chunk, outside the PPO epoch loop, so epochs and critic passes do not count a sample twice.
  • The removed min_sample_version had no other reader, and step 4 of the _train_pump docstring matches the code (single_controller.py:2765).
  • Pooling raw lags and reducing them once, instead of averaging chunk means, gives every row the same weight. That matches the stated intent outside forest training.

Remaining comments are on:

  • rollout weighting of the lag statistics under forest training

nit

  • name the max lag key weight_version_lag_max to match the new suffixes

Generated by Claude Code (#4999 version)

Comment thread nemo_rl/algorithms/single_controller.py Resolved
Comment thread nemo_rl/algorithms/single_controller.py Resolved
@github-actions github-actions Bot added the CI:Lfast Runs a fast test suite and re-use nightly `main` container (but sync dependencies to PRs version) label Nov 23, 2026
@christian-muertz

Copy link
Copy Markdown
Contributor Author

/ok to test 49fd9fe

@christian-muertz

Copy link
Copy Markdown
Contributor Author

/ok to test 30e0d23

@yuki-97
yuki-97 merged commit 76a3aaa into NVIDIA-NeMo:main Nov 24, 2026
103 of 114 checks passed
fujial-code added a commit that referenced this pull request Nov 24, 2026
Picks up #5271 and #5272; no conflicts.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Signed-off-by: fujial <[email protected]>
sharonyu-115 pushed a commit to sharonyu-115/RL that referenced this pull request Nov 26, 2026
…full-batch checks

NVIDIA-NeMo#5272 renamed train/weight_version_lag to train/weight_version_lag_max, so
the smoke test and the three nightly drivers asserted on a key that is no
longer logged, and check_metrics.py fails a check whose key is missing.
Also point the design doc at the new metric name and fix a 'below' that
refers to a recipe listed above.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Signed-off-by: Shuang Yu <[email protected]>
sharonyu-115 added a commit to sharonyu-115/RL that referenced this pull request Nov 26, 2026
…full-batch checks

NVIDIA-NeMo#5272 renamed train/weight_version_lag to train/weight_version_lag_max, so
the smoke test and the three nightly drivers asserted on a key that is no
longer logged, and check_metrics.py fails a check whose key is missing.
Also point the design doc at the new metric name and fix a 'below' that
refers to a recipe listed above.

Signed-off-by: Shuang Yu <[email protected]>
sharonyu-115 added a commit to sharonyu-115/RL that referenced this pull request Nov 27, 2026
…full-batch checks

NVIDIA-NeMo#5272 renamed train/weight_version_lag to train/weight_version_lag_max, so
the smoke test and the three nightly drivers asserted on a key that is no
longer logged, and check_metrics.py fails a check whose key is missing.
Also point the design doc at the new metric name and fix a 'below' that
refers to a recipe listed above.

Signed-off-by: Shuang Yu <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI:Lfast Runs a fast test suite and re-use nightly `main` container (but sync dependencies to PRs version)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants