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 wait_until_finished under checkpoint_manager to fix issue when checkpoint was not completed. #1581

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
3 changes: 3 additions & 0 deletions t5x/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -570,6 +570,7 @@ def _run_inference_eval():
trainer.train_state,
checkpoint_cfg.save.state_transformation_fns, # pytype: disable=attribute-error
)
checkpoint_manager.wait_until_finished()

# If we take manual control of the garbage collector, we need to disable it
# before starting training.
Expand Down Expand Up @@ -687,6 +688,7 @@ def _as_gda(spec):
trainer.train_state,
checkpoint_cfg.save.state_transformation_fns, # pytype: disable=attribute-error
)
checkpoint_manager.wait_until_finished()
logging.info(
'Stopping training loop early since `stop_training` is requested.'
)
Expand Down Expand Up @@ -739,6 +741,7 @@ def _as_gda(spec):
trainer.train_state,
checkpoint_cfg.save.state_transformation_fns, # pytype: disable=attribute-error
)
checkpoint_manager.wait_until_finished()
# Increment the checkpoint_step_index only if a checkpoint was saved.
if (
checkpoint_steps
Expand Down
Loading