Skip to content

Commit

Permalink
Move distributed checkpointing to a subdirectory of experimental
Browse files Browse the repository at this point in the history
  • Loading branch information
jonb377 committed Sep 29, 2023
1 parent 63a9020 commit c060b6e
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
7 changes: 4 additions & 3 deletions test/spmd/test_xla_distributed_checkpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@
create_default_local_save_plan,
create_default_global_save_plan,
)
from torch_xla.experimental.distributed_checkpoint import SPMDLoadPlanner, SPMDSavePlanner
from torch_xla.experimental._distributed_checkpoint_helpers import (
_sharded_cpu_state_dict, _CpuShards, _is_sharded_tensor)
from torch_xla.experimental.checkpoint import SPMDLoadPlanner, SPMDSavePlanner
from torch_xla.experimental.checkpoint._helpers import (_sharded_cpu_state_dict,
_CpuShards,
_is_sharded_tensor)


class DistributedCheckpointTestBase(test_xla_sharding_base.XlaShardingTest):
Expand Down
6 changes: 6 additions & 0 deletions torch_xla/experimental/checkpoint/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from .planners import SPMDSavePlanner, SPMDLoadPlanner

__all__ = [
"SPMDSavePlanner",
"SPMDLoadPlanner",
]
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,11 @@
from torch.distributed.checkpoint.utils import find_state_dict_object
from torch.utils._pytree import tree_map
from torch_xla.experimental.xla_sharding import XLAShardedTensor, XLAShard
from torch_xla.experimental._distributed_checkpoint_helpers import (
from torch_xla.experimental.checkpoint._helpers import (
FLATTEN_MAPPING, flatten_state_dict, dedup_tensors, _is_sharded_tensor,
set_element, narrow_tensor_by_index, _unwrap_xla_sharded_tensor, _CpuShards)
from typing import Any, Dict, List, Tuple, Union

__all__ = [
"SPMDSavePlanner",
"SPMDLoadPlanner",
]


class SPMDSavePlanner(SavePlanner):
"""
Expand Down

0 comments on commit c060b6e

Please sign in to comment.