Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add checkpoint load step #716

Merged
merged 3 commits into from
Dec 5, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion torchtitan/config_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,12 @@ def __init__(self):
0 is the default value.
""",
)

self.parser.add_argument(
"--checkpoint.load_step",
type=int,
default=-1,
help="Load the checkpoint at the specified step. If -1, load the latest checkpoint.",
)
# activation checkpointing configs
self.parser.add_argument(
"--activation_checkpoint.mode",
Expand Down
2 changes: 1 addition & 1 deletion train.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ def loss_fn(pred, labels):
logger.info("Created seed checkpoint")
return

checkpoint_loaded = checkpoint.load()
checkpoint_loaded = checkpoint.load(step=job_config.checkpoint.load_step)

if parallel_dims.pp_enabled and not checkpoint_loaded:
# TODO: fix this by allowing each rank to set their own seed
Expand Down
Loading