Skip to content

Commit

Permalink
Move Checkpointer implementations to _src.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 689914902
  • Loading branch information
cpgaffney1 authored and Orbax Authors committed Nov 15, 2024
1 parent 0f9e562 commit dbda123
Show file tree
Hide file tree
Showing 12 changed files with 37 additions and 19 deletions.
1 change: 1 addition & 0 deletions checkpoint/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ accept and return metadata as dictionaries.
- Create `Composite` class, which `CompositeArgs` now subclasses.
- Move `tree` to `_src`.
- Move `serialization` to `_src`.
- Move `Checkpointer` implementations to `_src`.
- Move `type_handlers` to `_src/serialization`
- Add notes to Barrier error `XlaRuntimeError(DEADLINE_EXCEEDED)` with
actionable info.
Expand Down
7 changes: 2 additions & 5 deletions checkpoint/orbax/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
from orbax.checkpoint import aggregate_handlers
from orbax.checkpoint import args
from orbax.checkpoint import checkpoint_utils
from orbax.checkpoint import checkpointers
from orbax.checkpoint import handlers
from orbax.checkpoint import logging
from orbax.checkpoint import metadata
Expand All @@ -46,11 +47,7 @@
from orbax.checkpoint.transform_utils import Transform

from orbax.checkpoint.abstract_checkpoint_manager import AbstractCheckpointManager
from orbax.checkpoint.abstract_checkpointer import AbstractCheckpointer
from orbax.checkpoint.async_checkpointer import AsyncCheckpointer
from orbax.checkpoint.checkpointer import Checkpointer
from orbax.checkpoint.pytree_checkpointer import PyTreeCheckpointer
from orbax.checkpoint.standard_checkpointer import StandardCheckpointer
from orbax.checkpoint.checkpointers import *
from orbax.checkpoint.checkpoint_manager import CheckpointManager
from orbax.checkpoint.checkpoint_manager import AsyncOptions
from orbax.checkpoint.checkpoint_manager import CheckpointManagerOptions
Expand Down
7 changes: 2 additions & 5 deletions checkpoint/orbax/checkpoint/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
from orbax.checkpoint import aggregate_handlers
from orbax.checkpoint import args
from orbax.checkpoint import checkpoint_utils
from orbax.checkpoint import checkpointers
from orbax.checkpoint import handlers
from orbax.checkpoint import logging
from orbax.checkpoint import metadata
Expand All @@ -46,11 +47,7 @@
from orbax.checkpoint.transform_utils import Transform

from orbax.checkpoint.abstract_checkpoint_manager import AbstractCheckpointManager
from orbax.checkpoint.abstract_checkpointer import AbstractCheckpointer
from orbax.checkpoint.async_checkpointer import AsyncCheckpointer
from orbax.checkpoint.checkpointer import Checkpointer
from orbax.checkpoint.pytree_checkpointer import PyTreeCheckpointer
from orbax.checkpoint.standard_checkpointer import StandardCheckpointer
from orbax.checkpoint.checkpointers import *
from orbax.checkpoint.checkpoint_manager import CheckpointManager
from orbax.checkpoint.checkpoint_manager import AsyncOptions
from orbax.checkpoint.checkpoint_manager import CheckpointManagerOptions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@
from etils import epath
import jax
from orbax.checkpoint import checkpoint_args
from orbax.checkpoint import checkpointer
from orbax.checkpoint import future as future_lib
from orbax.checkpoint import options as options_lib
from orbax.checkpoint import utils
from orbax.checkpoint._src import asyncio_utils
from orbax.checkpoint._src.checkpointers import checkpointer
from orbax.checkpoint._src.handlers import async_checkpoint_handler
from orbax.checkpoint._src.metadata import checkpoint
from orbax.checkpoint._src.multihost import counters
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@
from etils import epath
from etils import epy
import jax
from orbax.checkpoint import abstract_checkpointer
from orbax.checkpoint import checkpoint_args
from orbax.checkpoint import options as options_lib
from orbax.checkpoint import utils
from orbax.checkpoint._src import asyncio_utils
from orbax.checkpoint._src.checkpointers import abstract_checkpointer
from orbax.checkpoint._src.handlers import checkpoint_handler
from orbax.checkpoint._src.handlers import composite_checkpoint_handler
from orbax.checkpoint._src.metadata import checkpoint
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
"""Shorthand for `Checkpointer(PyTreeCheckpointHandler())`."""

from typing import Optional
from orbax.checkpoint import checkpointer
from orbax.checkpoint import options as options_lib
from orbax.checkpoint._src.checkpointers import checkpointer
from orbax.checkpoint._src.handlers import pytree_checkpoint_handler


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@

from typing import Any, Optional, Type
from etils import epath
from orbax.checkpoint import async_checkpointer
from orbax.checkpoint import options as options_lib
from orbax.checkpoint._src.checkpointers import async_checkpointer
from orbax.checkpoint._src.handlers import standard_checkpoint_handler
from orbax.checkpoint._src.metadata import checkpoint
from orbax.checkpoint._src.path import atomicity
Expand Down
2 changes: 1 addition & 1 deletion checkpoint/orbax/checkpoint/_src/path/format_utils_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import numpy as np
from orbax.checkpoint import args as args_lib
from orbax.checkpoint import checkpoint_manager
from orbax.checkpoint import checkpointer
from orbax.checkpoint._src.checkpointers import checkpointer
from orbax.checkpoint._src.handlers import pytree_checkpoint_handler
from orbax.checkpoint._src.handlers import standard_checkpoint_handler
from orbax.checkpoint._src.metadata import checkpoint as checkpoint_metadata
Expand Down
6 changes: 3 additions & 3 deletions checkpoint/orbax/checkpoint/checkpoint_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@
import jax
from jax.experimental.array_serialization import serialization as jax_serialization
from orbax.checkpoint import abstract_checkpoint_manager
from orbax.checkpoint import abstract_checkpointer
from orbax.checkpoint import args as args_lib
from orbax.checkpoint import async_checkpointer
from orbax.checkpoint import checkpoint_args
from orbax.checkpoint import checkpointer as checkpointer_lib
from orbax.checkpoint import options as options_lib
from orbax.checkpoint import utils
from orbax.checkpoint._src.checkpointers import abstract_checkpointer
from orbax.checkpoint._src.checkpointers import async_checkpointer
from orbax.checkpoint._src.checkpointers import checkpointer as checkpointer_lib
from orbax.checkpoint._src.handlers import checkpoint_handler
from orbax.checkpoint._src.handlers import composite_checkpoint_handler
from orbax.checkpoint._src.handlers import handler_registration
Expand Down
2 changes: 1 addition & 1 deletion checkpoint/orbax/checkpoint/checkpoint_utils_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
from orbax.checkpoint import args
from orbax.checkpoint import checkpoint_manager
from orbax.checkpoint import checkpoint_utils
from orbax.checkpoint import pytree_checkpointer
from orbax.checkpoint import test_utils
from orbax.checkpoint import utils
from orbax.checkpoint._src.checkpointers import pytree_checkpointer
from orbax.checkpoint._src.handlers import pytree_checkpoint_handler
from orbax.checkpoint._src.metadata import value as value_metadata
from orbax.checkpoint._src.path import step as step_lib
Expand Down
23 changes: 23 additions & 0 deletions checkpoint/orbax/checkpoint/checkpointers.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Copyright 2024 The Orbax Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""Public symbols for checkpointers module."""

# pylint: disable=g-importing-member, g-bad-import-order, unused-import, g-multiple-import

from orbax.checkpoint._src.checkpointers.abstract_checkpointer import AbstractCheckpointer
from orbax.checkpoint._src.checkpointers.async_checkpointer import AsyncCheckpointer
from orbax.checkpoint._src.checkpointers.checkpointer import Checkpointer
from orbax.checkpoint._src.checkpointers.pytree_checkpointer import PyTreeCheckpointer
from orbax.checkpoint._src.checkpointers.standard_checkpointer import StandardCheckpointer

0 comments on commit dbda123

Please sign in to comment.