Repository navigation
fix: restore local optimizer state without distributed broadcast - #317
Open
Liuchenbing-2026 wants to merge 1 commit into
Open
Liuchenbing-2026 wants to merge 1 commit into
Liuchenbing-2026 wants to merge 1 commit into
Conversation
Contributor
Author
|
@Yunnglin could you please review this focused single-process optimizer-resume fix? The same four regressions reproduce the missing-default-process-group failure on current main and pass on this head. Actual checkpoint I/O restores AdamW moments and the next update exactly, both with no process group and with a real one-rank Gloo group. The final published files were verified byte-for-byte against the rerun snapshot; this does not claim multi-rank sharding validation. Thanks! |
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.
PR type
PR information
Single-process NativeFSDPStrategy training can save optimizer state without an initialized distributed process group. Loading it nevertheless enables
broadcast_from_rank0, which makes PyTorch query the default group and raiseValueError: Default process group has not been initialized.Enable rank-zero broadcast for loading only when a process group is initialized. Saving behavior remains unchanged. Regression tests exercise actual AdamW checkpoint I/O and subsequent optimization both without a process group and with a real one-rank CPU/Gloo group. They compare restored learning rate, step and moment tensors, then require exact equality of the next parameter update against uninterrupted training. The existing placement test and broadcast-option control remain covered.
AI assistance was used for implementation and testing.
Experiment results
Compared the same tests on main
9953ea1ebbbdbe59c3831702157d3c147ca0ee26and the fixed implementation:Only the no-process-group checkpoint round trip fails on main. Both local and initialized one-rank round trips pass after the fix, including moment restoration and subsequent weights at
rtol=atol=0.All pre-commit hooks passed; the test file also passed manual isort/yapf/flake8 checks because repository hooks exclude tests. Environment: Linux/aarch64, Python 3.12.13, Torch 2.10.0, CPU only. A one-rank Gloo run is not multi-rank FSDP sharding validation; this rerun does not claim the latter.