Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop writing msgpack file for new checkpoints and update empty nodes handling so that it no longer depends on this file. #4055

Merged
merged 1 commit into from
Jul 8, 2024
Merged
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
6 changes: 2 additions & 4 deletions flax/training/checkpoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
)
from collections.abc import Callable, Iterable

from etils import epath # type: ignore[import-untyped]
import jax
import orbax.checkpoint as ocp
from absl import logging
Expand Down Expand Up @@ -77,7 +76,7 @@

# Orbax main checkpoint file name.
ORBAX_CKPT_FILENAME = 'checkpoint'
ORBAX_METADATA_FILENAME = '_METADATA'
ORBAX_MANIFEST_OCDBT = 'manifest.ocdbt'

PyTree = Any

Expand Down Expand Up @@ -124,8 +123,7 @@ def _safe_remove(path: str):

def _is_orbax_checkpoint(path: str) -> bool:
return io.exists(os.path.join(path, ORBAX_CKPT_FILENAME)) or io.exists(
os.path.join(path, ORBAX_METADATA_FILENAME)
or ocp.type_handlers.is_ocdbt_checkpoint(epath.Path(path))
os.path.join(path, ORBAX_MANIFEST_OCDBT)
)


Expand Down
Loading