Repository navigation
[config] Reject validation.steps=-1 when data-parallel degree > 1 - #4807
Merged
Merged
Conversation
User-facing config errors should not use assert, which disappears under -O.
A finite validation pass with DP>1 can exhaust ranks at different steps and hang collectives. Fail as soon as the DP degree is known, with an error that names validation.steps, instead of waiting for the dataloader repeat guard.
YeonwooSung
requested review from
fegin,
tianyu-l,
wconstab and
wwwjn
as code owners
September 20, 2026 09:06
|
|
|
The following ciflow label(s) have been added but CI has not been triggered yet because the workflows are awaiting approval:
Once a maintainer approves the workflows (scroll to the bottom of the PR page), the corresponding CI jobs will be triggered automatically. Please ping one of the reviewers if you do not have access to approve and run workflows. |
tianyu-l
reviewed
Sep 21, 2026
A finite pass sets the loader to repeat=False, so DP ranks can exhaust at different steps and hang on validation collectives. Name that in the error and the steps docstring instead of only stating the DP=1 constraint.
Drop the helper and the Trainer-level call. GrainDataLoader already rejects repeat=False under DP.
tianyu-l
approved these changes
Sep 22, 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.
Summary
validation.steps=-1consumes a finite dataset once. Ranks then stop independently, so a DP degree > 1 can hang on validation collectives (dist_sumof token counts / loss). GrainDataLoader already rejectsrepeat=Falsewithdp_world_size > 1; that error names dataloaderrepeat, notvalidation.steps.This PR:
assertonvalidation.stepswith aValueError, matchingvalidation.freq.assertdisappears underpython -O.Validator.__init__once the real DP degree is known, namingvalidation.steps. Config__post_init__cannot do this becausedata_parallel_shard_degreedefaults to leftover-1.The existing dataloader
repeatguard is left in place.#4301zero-batch / zero-token errors are unchanged. The Flux validator warning is unchanged.Test plan
pytest tests/unit_tests/cpu/test_validate.py tests/unit_tests/cpu/test_validator_frequency.py(13 passed locally, including 8 subtests)