Skip to content

Commit

Permalink
Move distributed checkpointing to a subdirectory of experimental (#5656)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonb377 authored and qihqi committed Oct 10, 2023
1 parent 6dccf0a commit e7e7c5e
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion test/spmd/test_xla_distributed_checkpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
create_default_global_save_plan,
)
from torch_xla.experimental.distributed_checkpoint import SPMDLoadPlanner, SPMDSavePlanner
from torch_xla.experimental._distributed_checkpoint_helpers import (
from torch_xla.experimental.distributed_checkpoint._helpers import (
_sharded_cpu_state_dict, _CpuShards, _is_sharded_tensor)


Expand Down
6 changes: 6 additions & 0 deletions torch_xla/experimental/distributed_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.distributed_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 e7e7c5e

Please sign in to comment.