orbit.actions.SaveCheckpointIfPreempted

View source on GitHub

Action that saves on-demand checkpoints after a preemption.

orbit.actions.SaveCheckpointIfPreempted(
 cluster_resolver: tf.distribute.cluster_resolver.ClusterResolver,
 checkpoint_manager: tf.train.CheckpointManager,
 checkpoint_number: Optional[tf.Variable] = None,
 keep_running_after_save: Optional[bool] = False
)

Args

cluster_resolver A tf.distribute.cluster_resolver.ClusterResolver object.
checkpoint_manager A tf.train.CheckpointManager object.
checkpoint_number A tf.Variable to indicate the checkpoint_number for checkpoint manager, usually it will be the global step.
keep_running_after_save Whether to keep the job running after the preemption on-demand checkpoint. Only set to True when in-process preemption recovery with tf.distribute.experimental.PreemptionWatcher is enabled.

Methods

__call__

View source

__call__(
 _
) -> None

Call self as a function.

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates. Some content is licensed under the numpy license.

Last updated 2025年04月18日 UTC.