Repository navigation
fix(grpo): accept grpo.max_num_epochs: null as "no epoch limit" - #4975
Merged
yuki-97 merged 1 commit intoOct 29, 2026
Merged
Conversation
The single controller and async_grpo_train already treat a null max_num_epochs as training until max_num_steps, but GRPOConfig rejected null. Type the field int | None and honor None in the sync trainers and the Megatron train_iters computation. Signed-off-by: Mikhail Shilkov <[email protected]>
yuki-97
approved these changes
Oct 29, 2026
yuki-97
left a comment
Contributor
There was a problem hiding this comment.
LGTM, thanks @mikhailshilkov for adding this!
Contributor
|
/ok to test 883b34c |
yuki-97
enabled auto-merge (squash)
October 29, 2026 11:17
RayenTian
added a commit
that referenced
this pull request
Oct 30, 2026
…pool guidance The functional recovery hook took replacement_index to match the signature but dropped it when delegating, so every delegated call recorded as a first attempt and would have falsified first_attempt_reward for anyone asserting on it there. Inert today -- the scripts that use the hook do not enable dynamic sampling -- but wrong, and the delegate defaults the kwarg so it failed silently. Three wording fixes in the spare-pool guidance: - The guide stated the refill condition twice in consecutive clauses. Fold them into one sentence that also carries the check-frequency fact, which was the only new information the second clause added. - "covers any drop rate below 50%; below that the pool can empty" read as "below 50% the pool can empty" -- the nearest antecedent is the percentage, not the mark. Say "set it lower". - A test helper's default-argument comment still carried "anything smaller reaches 0 in between", the claim the previous commit retired everywhere else. Also note grpo.max_num_epochs: null in the shorter-epoch paragraph. Accepting null landed on main in #4975; the SingleController clamp already returned early for it, so the paragraph's advice now has a second option. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Signed-off-by: ruit <[email protected]>
RayenTian
added a commit
that referenced
this pull request
Nov 2, 2026
…pool guidance The functional recovery hook took replacement_index to match the signature but dropped it when delegating, so every delegated call recorded as a first attempt and would have falsified first_attempt_reward for anyone asserting on it there. Inert today -- the scripts that use the hook do not enable dynamic sampling -- but wrong, and the delegate defaults the kwarg so it failed silently. Three wording fixes in the spare-pool guidance: - The guide stated the refill condition twice in consecutive clauses. Fold them into one sentence that also carries the check-frequency fact, which was the only new information the second clause added. - "covers any drop rate below 50%; below that the pool can empty" read as "below 50% the pool can empty" -- the nearest antecedent is the percentage, not the mark. Say "set it lower". - A test helper's default-argument comment still carried "anything smaller reaches 0 in between", the claim the previous commit retired everywhere else. Also note grpo.max_num_epochs: null in the shorter-epoch paragraph. Accepting null landed on main in #4975; the SingleController clamp already returned early for it, so the paragraph's advice now has a second option. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Signed-off-by: ruit <[email protected]>
1 task done
RayenTian
added a commit
that referenced
this pull request
Nov 3, 2026
…pool guidance The functional recovery hook took replacement_index to match the signature but dropped it when delegating, so every delegated call recorded as a first attempt and would have falsified first_attempt_reward for anyone asserting on it there. Inert today -- the scripts that use the hook do not enable dynamic sampling -- but wrong, and the delegate defaults the kwarg so it failed silently. Three wording fixes in the spare-pool guidance: - The guide stated the refill condition twice in consecutive clauses. Fold them into one sentence that also carries the check-frequency fact, which was the only new information the second clause added. - "covers any drop rate below 50%; below that the pool can empty" read as "below 50% the pool can empty" -- the nearest antecedent is the percentage, not the mark. Say "set it lower". - A test helper's default-argument comment still carried "anything smaller reaches 0 in between", the claim the previous commit retired everywhere else. Also note grpo.max_num_epochs: null in the shorter-epoch paragraph. Accepting null landed on main in #4975; the SingleController clamp already returned early for it, so the paragraph's advice now has a second option. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Signed-off-by: ruit <[email protected]>
RayenTian
added a commit
that referenced
this pull request
Nov 3, 2026
…pool guidance The functional recovery hook took replacement_index to match the signature but dropped it when delegating, so every delegated call recorded as a first attempt and would have falsified first_attempt_reward for anyone asserting on it there. Inert today -- the scripts that use the hook do not enable dynamic sampling -- but wrong, and the delegate defaults the kwarg so it failed silently. Three wording fixes in the spare-pool guidance: - The guide stated the refill condition twice in consecutive clauses. Fold them into one sentence that also carries the check-frequency fact, which was the only new information the second clause added. - "covers any drop rate below 50%; below that the pool can empty" read as "below 50% the pool can empty" -- the nearest antecedent is the percentage, not the mark. Say "set it lower". - A test helper's default-argument comment still carried "anything smaller reaches 0 in between", the claim the previous commit retired everywhere else. Also note grpo.max_num_epochs: null in the shorter-epoch paragraph. Accepting null landed on main in #4975; the SingleController clamp already returned early for it, so the paragraph's advice now has a second option. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Signed-off-by: ruit <[email protected]>
RayenTian
added a commit
that referenced
this pull request
Nov 4, 2026
…pool guidance The functional recovery hook took replacement_index to match the signature but dropped it when delegating, so every delegated call recorded as a first attempt and would have falsified first_attempt_reward for anyone asserting on it there. Inert today -- the scripts that use the hook do not enable dynamic sampling -- but wrong, and the delegate defaults the kwarg so it failed silently. Three wording fixes in the spare-pool guidance: - The guide stated the refill condition twice in consecutive clauses. Fold them into one sentence that also carries the check-frequency fact, which was the only new information the second clause added. - "covers any drop rate below 50%; below that the pool can empty" read as "below 50% the pool can empty" -- the nearest antecedent is the percentage, not the mark. Say "set it lower". - A test helper's default-argument comment still carried "anything smaller reaches 0 in between", the claim the previous commit retired everywhere else. Also note grpo.max_num_epochs: null in the shorter-epoch paragraph. Accepting null landed on main in #4975; the SingleController clamp already returned early for it, so the paragraph's advice now has a second option. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Signed-off-by: ruit <[email protected]>
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.
What does this PR do ?
Lets
grpo.max_num_epochsbenull, meaning "train untilmax_num_steps, cycling the dataset as needed", in every GRPO trainer.The single controller (
single_controller.py,_clamp_max_num_steps, the epoch check insingle_controller_utils/config.py) andasync_grpo_trainalready treatNonethat way. ButGRPOConfigdeclaresmax_num_epochs: int = 1, so a config that usesnullfails validation before any of that code runs. This PR:int | None(the default stays 1);grpo_train,grpo_train_sync) and the Megatrontrain_iterscomputation ingrpo.setuphonorNone. Without this they would raiseTypeErroroncurrent_epoch < NoneandNone * train_sample_count.Issues
None filed.
Usage
Before your PR is "Ready for review"
Pre checks:
Additional Information
test_grpo_train_without_epoch_limit_cycles_until_max_num_steps: withmax_num_epochs=Noneand a one-batch dataloader,grpo_trainruns exactlymax_num_steps(3) steps. It fails without the fix; all oftests/unit/algorithms/test_grpo.pypasses with it (486 tests).Epoch N/Nonewhen there is no limit. This is cosmetic and left as is.