Skip to content

test(grpo): cover zero-age startup barrier - #3761

Open
jthomson04 wants to merge 1 commit into
NVIDIA-NeMo:mainfrom
jthomson04:jthomson04/fix-fresh-async-lookahead-barrier
Open

jthomson04 wants to merge 1 commit into
NVIDIA-NeMo:mainfrom
jthomson04:jthomson04/fix-fresh-async-lookahead-barrier

Conversation

@jthomson04

@jthomson04 jthomson04 commented Aug 21, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • rebase onto current main after upstream PR fix(async): preserve rollout lookahead on resume #3435 superseded the original production change
  • cover max_trajectory_age_steps == 0 in the existing startup-pipeline helper test
  • verify startup does not query an impossible lookahead target when no lookahead window can exist

This test-only diff removes the uncovered production line that caused the previous Codecov patch failure.

Testing

  • pytest -q tests/unit/algorithms/test_grpo.py -k startup_pipeline_ready (7 passed)
  • ruff check tests/unit/algorithms/test_grpo.py
  • ruff format --check tests/unit/algorithms/test_grpo.py
  • git diff --check

@copy-pr-bot

copy-pr-bot Bot commented Aug 21, 2026

Copy link
Copy Markdown

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@jthomson04 jthomson04 added the CI:Lfast Runs a fast test suite and re-use nightly `main` container (but sync dependencies to PRs version) label Aug 21, 2026

@jthomson04 jthomson04 left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Reviewed by a team of five agents (RL-codebase expert, bug-finder, test-agent, devil's advocate, plus collation). Findings were adversarially challenged before posting — 4 candidate findings were dropped as noise, and one was dropped as factually wrong.

The core change looks correct, and I traced it rather than taking the premise on faith. _calculate_target_weights returns [v+1 .. v+lead] at every non-initial weight version, and weight_version only advances at refit — so target v+1 is always generated concurrently with training step v. A fresh run's step 0 therefore has exactly the same one-training-step of slack that every subsequent step already relies on; if that were unsafe, training would stall at every step, not just the first. The restored case is genuinely different: the buffer arrives pre-filled, so the wait loop can break at iteration 0 before the collector has reserved anything. The asymmetry the PR encodes is real.

One item turns CI red (import ordering); the rest are suggestions.

Verified locally: the new test passes, and the two has_complete_batch / config facts cited below were checked against source. Notably, two independent mutations to the new predicate survive the added test — details inline.

Generated by Claude Code

Comment thread tests/unit/algorithms/test_grpo.py Resolved
Comment thread tests/unit/algorithms/test_grpo.py Resolved
Comment thread nemo_rl/algorithms/grpo.py Resolved
Comment thread nemo_rl/algorithms/grpo.py Resolved
Comment thread nemo_rl/algorithms/grpo.py Resolved
@jthomson04
jthomson04 marked this pull request as ready for review August 21, 2026 20:46
@jthomson04
jthomson04 requested review from a team as code owners August 21, 2026 20:46
@copy-pr-bot

copy-pr-bot Bot commented Aug 21, 2026

Copy link
Copy Markdown

Auto-sync is disabled for ready for review pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@jthomson04

Copy link
Copy Markdown
Contributor Author

/ok to test 8646691

@jthomson04
jthomson04 force-pushed the jthomson04/fix-fresh-async-lookahead-barrier branch from 8646691 to 16c92b2 Compare August 26, 2026 16:46
@jthomson04

Copy link
Copy Markdown
Contributor Author

/ok to test 16c92b2

@jthomson04
jthomson04 force-pushed the jthomson04/fix-fresh-async-lookahead-barrier branch from 16c92b2 to 5198912 Compare September 8, 2026 17:12
@jthomson04 jthomson04 changed the title fix(grpo): limit lookahead barrier to restored buffers test(grpo): cover zero-age startup barrier Sep 8, 2026
@jthomson04

Copy link
Copy Markdown
Contributor Author

/ok to test 5198912

@jthomson04
jthomson04 force-pushed the jthomson04/fix-fresh-async-lookahead-barrier branch from 5198912 to 7ccdb5a Compare October 12, 2026 16:41
@jthomson04

Copy link
Copy Markdown
Contributor Author

/ok to test 7ccdb5a

This branch has not been deployed

No deployments
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.

1 participant