fix(megatron): finalize async saves on all ranks before hooks#1763
Open
HJSang wants to merge 2 commits into
Open
fix(megatron): finalize async saves on all ranks before hooks#1763HJSang wants to merge 2 commits into
HJSang wants to merge 2 commits into
Conversation
Signed-off-by: Hejian Sang <sanghj0923@gmail.com>
Contributor
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
HJSang
marked this pull request as ready for review
July 22, 2026 17:33
HJSang
requested review from
Shi-Dong,
Zhichenzzz,
fzyzcjy,
maocheng23,
yueming-yuan and
yushengsu-thu
as code owners
July 22, 2026 17:33
Contributor
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
Contributor
Author
|
Can someone take a look at this simple PR? it fixed async bug. 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.
Summary
Why
Megatron distributed-checkpoint finalization performs distributed coordination. The post-save hook path previously called blocking finalization only on rank 0, while the other ranks returned from
save_model. Multi-rank jobs could therefore hang indefinitely before the hook ran.This preserves the existing contract introduced in #1586: asynchronous saves are fully written before the hook observes them, and the hook itself runs once on rank 0. The only change is that checkpoint finalization now executes collectively.
Validation
pytest -q --confcutdir=tests/fast/backends/megatron_utils tests/fast/backends/megatron_utils/test_actor_checkpoint.py(2 passed inradixark/miles:dev)pre-commit run --files miles/backends/megatron_utils/actor.py tests/fast/backends/megatron_utils/test_actor_checkpoint.pyGPU CI
A maintainer must add
run-ci-ckptandrun-ci-megatronbefore this draft is marked ready for review.