Skip to content

Commit

Permalink
Parallelize many directory creations using asyncio. Also reduce the n…
Browse files Browse the repository at this point in the history
…umber of `asyncio.run` calls by moving `async` functions higher in the stack.

PiperOrigin-RevId: 663767760
  • Loading branch information
cpgaffney1 authored and pax authors committed Aug 16, 2024
1 parent c36b3c6 commit 5046217
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 0 additions & 1 deletion paxml/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,6 @@ pytype_strict_test(
deps = [
":checkpoint_metadata",
":checkpoint_paths",
":checkpoint_types",
":checkpoints",
":train_states",
# Implicit absl.testing.absltest.absltest dependency.
Expand Down
6 changes: 5 additions & 1 deletion paxml/checkpoints_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,11 @@


def _create_tmp_directory(final_dir):
if hasattr(ocp.path, 'atomicity'):
if hasattr(ocp.test_utils, 'create_tmp_directory'):
tmp_dir = ocp.path.atomicity._get_tmp_directory(final_dir)
ocp.test_utils.create_tmp_directory(tmp_dir, final_dir)
return tmp_dir
elif hasattr(ocp.path.atomicity, '_create_tmp_directory'):
tmp_dir = ocp.path.atomicity._get_tmp_directory(final_dir)
ocp.path.atomicity._create_tmp_directory(tmp_dir, final_dir)
return tmp_dir
Expand Down

0 comments on commit 5046217

Please sign in to comment.