Repository navigation
[ckpt] fix: Reject Energon resume after DP changes - #5637
Merged
Merged
Conversation
Signed-off-by: Yu Yao <yaoyu.094@gmail.com>
Contributor
Author
|
/ok to test cc7016a |
Contributor
|
Light review - LGTM The DP-size guard in maybe_load_dataloader_state is a correct, fail-loud addition: it counts saved train_dataloader_dprank*.pt files and refuses to resume when that count differs from the current DP size, closing the case where a smaller current DP world would silently discard saved rank state (which the pre-existing per-rank missing-file check did not catch). Both the MSC (msc.glob) and local (Path.glob) branches are consistent with existing usage elsewhere in the file, and the new check sits ahead of the per-rank file check without breaking it. Observations (non-blocking):
Suggested test cases
|
Contributor
Author
|
/ok to test cc7016a |
Contributor
Author
|
/ok to test 18a16ac |
Contributor
Author
|
/ok to test 18a16ac |
This branch was previously deployed
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
Reject Energon dataloader-state restoration when the saved and current data-parallel sizes differ.
Supported trigger and impact
Native distributed checkpoints can be resharded across a changed DP size. Energon rank-local state cannot be restored that way without redistribution, so Bridge documents that direct Energon restore requires the same DP size.
When a DP=2 checkpoint was resumed at DP=1, the existing guard saw rank 0's old file and restored it. The extra rank-1 state was silently dropped. Energon then rebuilt dataset sharding for the new world size, so continuing from only rank 0's old position could skip or repeat samples and change the training stream while checkpoint load reported success.
Expansion already failed when a current rank file was missing; shrinkage bypassed that asymmetric check.
Root cause and minimal fix
maybe_load_dataloader_state()validated only the current rank's filename. A completed Energon generation contains exactly one deterministic file per saved pure-DP rank, so the rank-file cardinality identifies the saved DP size.Before deserializing state, the loader now counts those files through the existing local
Path.globor MSCglobpath and compares the count with the current DP process-group size. Any mismatch raises with the existing fail-loud data-order rationale. The per-rank file check remains as a malformed-generation guard.Regression evidence
An exact-function deterministic reproducer executes the maintained helper with a completed two-file generation and current DP size 1.
Fail before on
d0debd0bd308f3b4aef6aa0904952d655cb31eb5:Pass after, including unchanged DP=1 local and MSC-shaped restore controls:
The focused repository unit test was also added. Local collection was attempted but the CPU workstation stops before collection on unavailable pinned GPU import dependencies; that environment failure is not claimed as passing evidence.
Additional validation:
Scope
This patch changes only Energon dataloader-state restore validation and adds one focused CPU regression test. It does not redistribute dataloader state across DP sizes, change native model/optimizer resharding, add configuration or dependencies, or claim GPU, convergence, performance, model-quality, or full-suite validation.