Repository navigation
Conversation
Serendipity-matong
requested review from
fegin,
tianyu-l,
wconstab and
wwwjn
as code owners
September 15, 2026 01:37
ivy-zhou
requested changes
Sep 15, 2026
| ) | ||
| return True | ||
|
|
||
| def _resolve_load_step(self, step: int, has_checkpoint_folder: bool) -> int: |
Contributor
There was a problem hiding this comment.
I don't think you need to extract this out, I think you can just call find_load_step directly.
| def load(self, step: int = -1) -> bool: | ||
| if self.enable and self.enable_ft_dataloader_checkpoints: | ||
| self._ft_load() | ||
| has_checkpoint_folder = self._storage.isdir(self.folder) |
Contributor
There was a problem hiding this comment.
If you run the super().load(step) ahead of trying to load the DL folder and try to look at the checkpoint ID from it, does this code get any cleaner?
|
|
tianyu-l
approved these changes
Sep 21, 2026
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
Fix TorchFT dataloader checkpoint loading to stay aligned with the selected
main training checkpoint.
Root Cause
TorchFTCheckpointManager.load()independently selected the latest checkpointfrom the per-replica dataloader checkpoint directory before the base checkpoint
manager resolved the main checkpoint step.
For example, if the main checkpoint directory contained
step-500while theTorchFT dataloader directory already contained
step-501, recovery loadedmodel state from
step-500but dataloader state fromstep-501. This could skipdata and break exact recovery.
Changes
selected main checkpoint.
before the main checkpoint state.
checkpoint exists than the selected main checkpoint.
Testing
python -m pytest torchtitan/experiments/torchft/tests/test_torchft_checkpoint.py -q(7 passed)
flake8on changed filespre-commit run ufmtpre-commit run pydoclintpre-commit run codespellpython -m compileall ...git diff --check