Skip to content

Commit

Permalink
Add warning when GCS checkpoint is missing commit_success.txt (in cas…
Browse files Browse the repository at this point in the history
…e the checkpoint comes from not GCS originally).

PiperOrigin-RevId: 658176355
  • Loading branch information
rdyro authored and Orbax Authors committed Aug 1, 2024
1 parent 1ab7e97 commit 05acbe2
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions checkpoint/orbax/checkpoint/path/step.py
Original file line number Diff line number Diff line change
Expand Up @@ -540,6 +540,15 @@ def is_checkpoint_finalized(path: epath.PathLike) -> bool:
if not path.is_dir():
raise ValueError(f'Path {path} is not a directory. Not a valid checkpoint')
if is_gcs_path(path) and not (path / _COMMIT_SUCCESS_FILE).exists():
logging.warning(
'This GCS path %s does not contain the %s file used to indicate a'
' successfully written GCS checkpoint. If the checkpoint was'
' originally saved with GCS, the checkpoint was not successfully'
' written. If the the checkpoint was saved differently and copied, you'
' need to add %s to the checkpoint directory.', path,
_COMMIT_SUCCESS_FILE, _COMMIT_SUCCESS_FILE
)

return False
if TMP_DIR_SUFFIX in path.name:
return False
Expand Down

0 comments on commit 05acbe2

Please sign in to comment.