Skip to content
Merged
Changes from all 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
8 changes: 4 additions & 4 deletions torchtitan/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -575,17 +575,17 @@ def train(self):
logger.warning("Ran out of data; last step was canceled.")
break

self.checkpointer.save(
self.step, last_step=(self.step == job_config.training.steps)
)

# Run validation if validator is available
if (
self.job_config.validation.enabled
and self.validator.should_validate(self.step)
):
self.validator.validate(self.model_parts, self.step)

self.checkpointer.save(
self.step, last_step=(self.step == job_config.training.steps)
)

# signal the profiler that the next profiling step has started
if torch_profiler:
torch_profiler.step()
Expand Down
Loading