[ckpt] fix: Restore checkpoints without Energon state - #5593
Merged
Conversation
Signed-off-by: Yu Yao <yaoyu.094@gmail.com>
Contributor
Author
|
/ok to test 685fd32 |
Contributor
|
LGTM The change correctly reorders the restore logic so the missing iter_N directory case returns early before computing dp_rank, while a present iter_N dir with a missing per-DP-rank file still raises loudly. Docstring, docs, and unit tests are updated consistently. Suggested test cases
No perf tests impacted. |
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.
Problem
Selecting an older model checkpoint that predates Energon dataloader-state saving can fail if the same checkpoint root contains state for a newer generation.
For example, a supported
checkpoint.ckpt_step=10resume may selectiter_0000010whileenergon/iter_0000020exists. The restore path checked only the sharedenergonroot, then treated the missingenergon/iter_0000010/train_dataloader_dprank000.ptas a data-parallel-size mismatch and aborted. This prevents otherwise valid older model-only checkpoints from resuming.Root cause and fix
The loader did not distinguish two different conditions:
Check the selected
iter_Ndirectory before resolving the DP-rank file. A missing selected generation now follows the existing pre-feature compatibility behavior and starts the dataloader fresh. A missing rank file inside an existing selected generation remains a hard error to avoid silently changing data order. The checkpointing documentation now describes this boundary.Validation
Fail before, on the unmodified
fbb7570cf7eec94fd2e6064454d84f7fad07fbfabase:Pass after:
The adjacent set includes a negative control proving that an existing selected generation with a missing DP-rank file still raises. This is a focused CPU path; no GPU, distributed, full-suite, convergence, or performance validation was run.