feat(grpo): optional early stop at a validation metric threshold - #3404
Merged
Conversation
michal2409
force-pushed
the
split/stop-at-accuracy
branch
from
July 30, 2026 08:50
7d6d96d to
dd5f7be
Compare
Adds two required grpo keys, defaulted in the exemplar YAMLs: - stop_at_validation_threshold (float | null): end training once the chosen validation metric reaches this value; null (the default) disables early stopping. - stop_at_validation_metric (str, default accuracy): which reported validation metric to compare; a metric validation does not report fails loudly listing the available keys. The stop takes effect at the end of the stopping step: with checkpointing enabled the step is saved first (forced like a last step, carrying its validation metrics), and every exit flushes pending checkpoint finalization the same way the timeout/max-steps early returns do. Signed-off-by: Michal Futrega <mfutrega@nvidia.com>
michal2409
force-pushed
the
split/stop-at-accuracy
branch
from
July 30, 2026 13:50
92ef483 to
c149546
Compare
yuki-97
reviewed
Jul 30, 2026
yuki-97
left a comment
Contributor
There was a problem hiding this comment.
thanks @michal2409 , LGTM, just two minor nits.
…at-accuracy Signed-off-by: Michal Futrega <mfutrega@nvidia.com> # Conflicts: # nemo_rl/algorithms/grpo_sync.py
Per review: a null metric disables the early stop (the threshold is no longer the switch), and setup() asserts the threshold is set whenever the metric is. Also parametrize the stop tests over grpo_train_sync via mock_sync_grpo_infrastructure and add an initial-validation stop test for all three trainers. Signed-off-by: Michal Futrega <mfutrega@nvidia.com>
yuki-97
previously approved these changes
Jul 31, 2026
yuki-97
left a comment
Contributor
There was a problem hiding this comment.
thanks @michal2409 , LGTM
Contributor
|
/ok to test aecf0af |
yuki-97
enabled auto-merge (squash)
July 31, 2026 14:14
…at-accuracy Signed-off-by: Michal Futrega <mfutrega@nvidia.com>
Their contract test validates the full MasterConfig, so the new required grpo keys must be present (same trap as the research template config). Signed-off-by: Michal Futrega <mfutrega@nvidia.com>
Contributor
Author
|
/ok to test 0e14faa |
max(train/critic/loss) lands at 6.68-7.00 in CI for unrelated PRs (NVIDIA-NeMo#3401, NVIDIA-NeMo#3404, NVIDIA-NeMo#3423) since the vLLM 0.25.1 bump; the same critic-side drift is already tracked in NVIDIA-NeMo#3412. Placeholder bump, like the grad_norm bound raised in NVIDIA-NeMo#3280. Signed-off-by: Michal Futrega <mfutrega@nvidia.com>
Contributor
Author
|
/ok to test 0e14faa |
michal2409
added a commit
to michal2409/RL
that referenced
this pull request
Aug 2, 2026
max(train/critic/loss) lands at 6.68-7.00 in CI for unrelated PRs (NVIDIA-NeMo#3401, NVIDIA-NeMo#3404, NVIDIA-NeMo#3423) since the vLLM 0.25.1 bump; the same critic-side drift is already tracked in NVIDIA-NeMo#3412. Placeholder bump, like the grad_norm bound raised in NVIDIA-NeMo#3280. Signed-off-by: Michal Futrega <mfutrega@nvidia.com>
Contributor
Author
Contributor
Author
|
/ok to test 4ab2fe5 |
6 tasks
Contributor
|
thanks for the bump for L1 PPO threshold, tracked at #3412 (comment) and bump |
yuki-97
approved these changes
Aug 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Train-to-accuracy runs (benchmarking, recipe qualification, ablations) need training to stop as soon as the quality bar is met, rather than at a step count nobody can know in advance. This PR adds an optional early stop on a validation metric, via two config keys defaulted in the exemplar YAMLs:
grpo.stop_at_validation_metric(str | null) — which reported validation metric to compare;null(the default) disables early stopping. Any reported metric works (for example a grouped pass@k); a metric that validation does not report fails loudly listing the available keys.grpo.stop_at_validation_threshold(float | null) — end training once the chosen metric reaches this value;setup()asserts it is set whenever the metric is.The stop takes effect at the end of the stopping step: with checkpointing enabled the step is saved first (forced like a last step, carrying its validation metrics for
get_best_checkpoint_path()), and every exit flushes pending checkpoint finalization the same way the existing timeout/max-steps early returns do.Covered by unit tests parametrized over all three trainers (grpo_train, async_grpo_train, grpo_train_sync): periodic threshold stop, initial-validation stop, configurable metric, loud failure on an unreported metric, and checkpoint-on-stop.