Skip to content
Open
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
22 changes: 12 additions & 10 deletions checkpoint/orbax/checkpoint/checkpoint_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -860,16 +860,6 @@ def __init__(
)


# Cleanup directories from previous runs that may not have been finalized.
if self._options.cleanup_tmp_directories:
asyncio_utils.run_sync(
temporary_paths.cleanup_temporary_paths(
self._directory,
multiprocessing_options=self._options.multiprocessing_options,
temporary_path_cls=self._options.temporary_path_class,
)
)

self._step_name_format = (
self._options.step_name_format
or step_lib.standard_name_format(
Expand Down Expand Up @@ -914,6 +904,18 @@ def __init__(
)
)

# Cleanup directories from previous runs that may not have been finalized.
if self._options.cleanup_tmp_directories:
self._checkpoint_deleter.delete_steps(
[
step_lib.step_from_checkpoint_name(tmp_path.get().name)
for tmp_path in asyncio_utils.run_sync(
temporary_paths.all_temporary_paths(self._directory)
)
]
)


self._save_progress_tracker = synchronization.MultihostSynchronizedValue(
value=False,
multiprocessing_options=self._multiprocessing_options,
Expand Down