Atomicity Types#
Defines the types and Protocols for creating and finalizing temporary paths.
Chiefly defines the TemporaryPath Protocol for creating and finalizing temporary paths, which allow other implementations.
TemporaryPath#
- class orbax.checkpoint.path.atomicity_types.TemporaryPath[source]#
Class that represents a temporary path.
Importantly, the temporary path always has a corresponding finalized path, and is primarily constructed from this path. The class contains logic to create the temporary path, and to finalize it into the final path.
from_final should be called from all hosts to construct the temporary path instance from the given final path. create and finalize must be called only on the primary host.
- abstractmethod async classmethod validate(temporary_path)[source]#
Validates the temporary path or raises a ValidationError.
- abstractmethod async classmethod validate_final(final_path)[source]#
Validates the final path or raises a ValidationError.
- abstractmethod classmethod from_temporary(temporary_path, *, file_options=None, snapshot_type=None)[source]#
Creates a TemporaryPath from a temporary path.
- Return type:
- abstractmethod classmethod from_final(final_path, *, checkpoint_metadata_store=None, file_options=None, snapshot_type=None)[source]#
Creates a TemporaryPath from a final path.
- Return type:
- abstractmethod get()[source]#
Constructs the temporary path without actually creating it.
- Return type: