Skip to content

Commit

Permalink
Adding checkpoint after traning ends
Browse files Browse the repository at this point in the history
  • Loading branch information
angegonzalez committed May 7, 2024
1 parent 6629dfa commit b1872e1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/nanotron/config/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ class CheckpointsArgs:
checkpoints_path: Path
checkpoint_interval: int
save_initial_state: Optional[bool] = False
save_final_state: Optional[bool] = False
resume_checkpoint_path: Optional[Path] = None
checkpoints_path_is_shared_file_system: Optional[bool] = False

Expand Down
5 changes: 4 additions & 1 deletion src/nanotron/trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,10 @@ def train(
self.save_checkpoint()

dist.barrier() # let's wait for everyone before leaving


if self.config.checkpoints.save_final_state:
self.save_checkpoint()

self.post_training()

def training_step(
Expand Down

0 comments on commit b1872e1

Please sign in to comment.