Skip to content
Merged
Show file tree
Hide file tree
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
7 changes: 7 additions & 0 deletions checkpoint/orbax/checkpoint/checkpoint_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -1042,6 +1042,8 @@ def _configure_checkpointer_legacy_init(
multiprocessing_options=options.multiprocessing_options,
file_options=options.file_options,
async_options=options.async_options,
atomicity_options=options.atomicity_options,
temporary_path_class=options.temporary_path_class,
),
**item_handlers,
),
Expand Down Expand Up @@ -1102,6 +1104,8 @@ def _configure_checkpointer_from_item_names_and_handlers(
multiprocessing_options=options.multiprocessing_options,
file_options=options.file_options,
async_options=async_options,
atomicity_options=options.atomicity_options,
temporary_path_class=options.temporary_path_class,
),
**all_item_handlers, # pyrefly: ignore[bad-argument-type]
),
Expand Down Expand Up @@ -1133,7 +1137,10 @@ def _configure_checkpointer_from_handler_registry(
CompositeCheckpointHandler(
composite_options=composite_checkpoint_handler.CompositeOptions(
multiprocessing_options=options.multiprocessing_options,
file_options=options.file_options,
async_options=async_options,
atomicity_options=options.atomicity_options,
temporary_path_class=options.temporary_path_class,
),
handler_registry=handler_registry,
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,7 @@ def get_v0_checkpointer_and_args(
async_options=context.async_options.v0(),
file_options=context.file_options.v0(),
multiprocessing_options=context.multiprocessing_options.v0(),
atomicity_options=context.atomicity.v0(),
)
ckptr = async_checkpointer.AsyncCheckpointer(
composite_checkpoint_handler.CompositeCheckpointHandler(
Expand All @@ -345,6 +346,7 @@ def get_v0_checkpointer_and_args(
async_options=context.async_options.v0(),
multiprocessing_options=context.multiprocessing_options.v0(),
file_options=context.file_options.v0(),
atomicity_options=context.atomicity.v0(),
)
args = composite_checkpoint_handler.CompositeArgs(**{
name: handler_compatibility.Args(checkpointable)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,7 @@
class _AsyncSaveResponse(async_types.AsyncResponse[bool]):
"""Response for asynchronous saving."""

def __init__(
self, manager: checkpoint_manager.CheckpointManager
):
def __init__(self, manager: checkpoint_manager.CheckpointManager):

async def _wait() -> bool:
# If a background operation fails wait_until_finished() will re-raise the
Expand Down Expand Up @@ -198,6 +196,7 @@ def __init__(
async_options=self._context.async_options.v0(),
file_options=self._context.file_options.v0(),
multiprocessing_options=self._context.multiprocessing_options.v0(),
atomicity_options=self._context.atomicity.v0(),
# Prevent the checkpoint manager from writing metrics on its own. This
# class will take responsibility for writing metrics.
prevent_write_metrics=True,
Expand Down Expand Up @@ -601,7 +600,7 @@ def load(
step: int | CheckpointMetadata | None = None,
abstract_state: (
tree_types.PyTreeOf[tree_types.AbstractLeaf] | None # pyrefly: ignore[bad-specialization]
) = None,
)=None,
*,
checkpointable_name: str = STATE_CHECKPOINTABLE_KEY,
) -> tree_types.PyTreeOf[tree_types.Leaf]: # pyrefly: ignore[bad-specialization]
Expand Down Expand Up @@ -788,7 +787,7 @@ def load_async(
step: int | CheckpointMetadata | None = None,
abstract_state: (
tree_types.PyTreeOf[tree_types.AbstractLeaf] | None # pyrefly: ignore[bad-specialization]
) = None,
)=None,
) -> async_types.AsyncResponse[tree_types.PyTreeOf[tree_types.Leaf]]: # pyrefly: ignore[bad-specialization]
"""Not yet supported."""
raise NotImplementedError()
Expand Down
Loading