Conversation
deepujain
force-pushed
the
feat/6004-train-state-sidecar
branch
from
September 3, 2026 02:17
906ab66 to
b764774
Compare
deepujain
force-pushed
the
feat/6004-train-state-sidecar
branch
from
September 24, 2026 21:49
b764774 to
37eac22
Compare
Signed-off-by: dejain <deepujain@gmail.com> Signed-off-by: Deepak Jain <deepujain@gmail.com>
deepujain
force-pushed
the
feat/6004-train-state-sidecar
branch
from
September 29, 2026 23:26
37eac22 to
915c333
Compare
deepujain
marked this pull request as ready for review
September 29, 2026 23:55
This branch has not been 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.
What does this PR do?
Resuming a checkpoint should restore one authoritative view of training progress. This change saves the active Megatron-LM
TrainStateas a Bridge-compatibletrain_state.ptsidecar and restores that same canonical runtime object during load.The sidecar carries iteration, consumed and skipped samples, validation samples, accumulated FLOPs, and train/valid/test flags. Rank zero writes an immutable state snapshot before the checkpoint tracker advances, including async-save finalization. On resume, rank zero loads the sidecar and broadcasts it to other ranks. Checkpoints without the sidecar reconstruct the active state from legacy checkpoint fields, and compatibility values are mirrored back to
argswhile the training-loop migration is in progress.This keeps new Bridge-compatible checkpoints and older Megatron-LM checkpoints usable without creating a second competing state model.
Issue tracking
Fixes #6004
Contribution process
Pre-checks
Validation
TrainStateschema and save/load tests passed in an isolated CPU harness.python3 -m py_compile, Black 26.3.0, isort 5.13.2, andgit diff --checkpassed for the changed state and test surfaces.The repaired commit is rebased on current
mainand signed. Full distributed checkpoint tests require the repository's GPU environment and remain a hosted CI gate.