Skip to content
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
10 changes: 3 additions & 7 deletions src/maxtext/common/checkpointing.py
Original file line number Diff line number Diff line change
Expand Up @@ -973,15 +973,11 @@ def maybe_save_checkpoint(checkpoint_manager, state, config, data_iterator, step
except elastic_utils.manager.ScaleUpSignalError as e:
if config.elastic_enabled:
max_logging.log(f"Elastic event detected, letting exception bubble up: {e}")
raise
else:
raise exceptions.StopTraining("Job is preempted.") from e
raise
except jax.errors.JaxRuntimeError as e:
if config.elastic_enabled:
max_logging.log(f"Elastic event detected, letting exception bubble up: {e}")
raise
else:
raise exceptions.StopTraining("Job is preempted.") from e
raise
except Exception as e:
raise exceptions.StopTraining(f"Checkpointing failed. {str(e)}") from e

Expand All @@ -991,7 +987,7 @@ def maybe_save_checkpoint(checkpoint_manager, state, config, data_iterator, step

# Raise exception upon preemption
if checkpoint_manager.reached_preemption(actual_step):
raise exceptions.StopTraining("Job is preempted.")
raise exceptions.StopTraining("Job received termination signal (SIGTERM).")


def save_checkpoint(checkpoint_manager, step, state, config=None, data_iterator=None, force=False):
Expand Down
Loading