Coverage for  / home / jenkins / .local / lib / python3.10 / site-packages / hyper_parallel / core / distributed_checkpoint / __init__.py: 100%

11 statements  

« prev     ^ index     » next       coverage.py v7.13.1, created at 2026-05-11 07:26 +0800

1# Copyright 2026 Huawei Technologies Co., Ltd 

2# 

3# Licensed under the Apache License, Version 2.0 (the "License"); 

4# you may not use this file except in compliance with the License. 

5# You may obtain a copy of the License at 

6# 

7# http://www.apache.org/licenses/LICENSE-2.0 

8# 

9# Unless required by applicable law or agreed to in writing, software 

10# distributed under the License is distributed on an "AS IS" BASIS, 

11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 

12# See the License for the specific language governing permissions and 

13# limitations under the License. 

14# ============================================================================ 

15""" 

16Hyper Parallel Checkpoint Package. 

17 

18This package provides distributed checkpoint saving and loading capabilities, 

19including support for tensor sharding, resharding, and layout management. 

20""" 

21 

22__all__ = [ 

23 # Main API 

24 "save", 

25 "async_save", 

26 "AsyncSaveResponse", 

27 "load", 

28 # Metadata 

29 "Metadata", 

30 "MetadataIndex", 

31 "TensorStorageMetadata", 

32 "BytesStorageMetadata", 

33 "ChunkStorageMetadata", 

34 "TensorProperties", 

35 # Planner interfaces 

36 "SavePlanner", 

37 "LoadPlanner", 

38 "SavePlan", 

39 "LoadPlan", 

40 "WriteItem", 

41 "ReadItem", 

42 "WriteItemType", 

43 "LoadItemType", 

44 # Standard planners 

45 "StandardSavePlanner", 

46 "StandardLoadPlanner", 

47 # Storage interfaces 

48 "StorageWriter", 

49 "StorageReader", 

50 "StorageInfo", 

51 "WriteResult", 

52 # File system storage 

53 "FileSystemWriter", 

54 "FileSystemReader", 

55 # Layout I/O 

56 "get_current_layout", 

57 "save_layout", 

58 "load_layout", 

59 "combine_layout", 

60 "get_global_layout", 

61 # Base API 

62 "save_checkpoint", 

63 "load_checkpoint", 

64 # Resharding 

65 "ReshardHandler", 

66] 

67 

68# Main API 

69from hyper_parallel.core.distributed_checkpoint.api import ( 

70 AsyncSaveResponse, 

71 async_save, 

72 load, 

73 save, 

74) 

75 

76# Metadata structures 

77from hyper_parallel.core.distributed_checkpoint.metadata import ( 

78 BytesStorageMetadata, 

79 ChunkStorageMetadata, 

80 Metadata, 

81 MetadataIndex, 

82 TensorProperties, 

83 TensorStorageMetadata, 

84) 

85 

86# Planner interfaces and data structures 

87from hyper_parallel.core.distributed_checkpoint.planner import ( 

88 LoadItemType, 

89 LoadPlan, 

90 LoadPlanner, 

91 ReadItem, 

92 SavePlan, 

93 SavePlanner, 

94 WriteItem, 

95 WriteItemType, 

96) 

97 

98# Standard planner implementations 

99from hyper_parallel.core.distributed_checkpoint.standard_planner import ( 

100 StandardLoadPlanner, 

101 StandardSavePlanner, 

102) 

103 

104# Storage interfaces and data structures 

105from hyper_parallel.core.distributed_checkpoint.storage import ( 

106 StorageInfo, 

107 StorageReader, 

108 StorageWriter, 

109 WriteResult, 

110) 

111 

112# File system storage implementations 

113from hyper_parallel.core.distributed_checkpoint.filesystem_storage import ( 

114 FileSystemReader, 

115 FileSystemWriter, 

116) 

117 

118# Layout I/O utilities 

119from hyper_parallel.core.distributed_checkpoint.layout import ( 

120 combine_layout, 

121 get_current_layout, 

122 get_global_layout, 

123 load_layout, 

124 save_layout, 

125) 

126 

127# Base API (backward compatibility) 

128from hyper_parallel.core.distributed_checkpoint.loader import load_checkpoint 

129from hyper_parallel.core.distributed_checkpoint.saver import save_checkpoint 

130 

131# Resharding utilities 

132from hyper_parallel.core.distributed_checkpoint.reshard import ReshardHandler