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-07-06 05:41 +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 "CHUNK_INFO", 

36 "ChunkInfo", 

37 # Planner interfaces 

38 "SavePlanner", 

39 "LoadPlanner", 

40 "SavePlan", 

41 "LoadPlan", 

42 "WriteItem", 

43 "ReadItem", 

44 "WriteItemType", 

45 "LoadItemType", 

46 # Standard planners 

47 "StandardSavePlanner", 

48 "StandardLoadPlanner", 

49 # Storage interfaces 

50 "StorageWriter", 

51 "StorageReader", 

52 "StorageInfo", 

53 "WriteResult", 

54 # File system storage 

55 "FileSystemWriter", 

56 "FileSystemReader", 

57 # Layout I/O 

58 "get_current_layout", 

59 "save_layout", 

60 "load_layout", 

61 "combine_layout", 

62 "get_global_layout", 

63 # Base API 

64 "save_checkpoint", 

65 "load_checkpoint", 

66 # Resharding 

67 "ReshardHandler", 

68] 

69 

70# Main API 

71from hyper_parallel.core.distributed_checkpoint.api import ( 

72 AsyncSaveResponse, 

73 async_save, 

74 load, 

75 save, 

76) 

77 

78# Metadata structures 

79from hyper_parallel.core.distributed_checkpoint.metadata import ( 

80 BytesStorageMetadata, 

81 ChunkStorageMetadata, 

82 Metadata, 

83 MetadataIndex, 

84 TensorProperties, 

85 TensorStorageMetadata, 

86 CHUNK_INFO, 

87 ChunkInfo 

88) 

89 

90# Planner interfaces and data structures 

91from hyper_parallel.core.distributed_checkpoint.planner import ( 

92 LoadItemType, 

93 LoadPlan, 

94 LoadPlanner, 

95 ReadItem, 

96 SavePlan, 

97 SavePlanner, 

98 WriteItem, 

99 WriteItemType, 

100) 

101 

102# Standard planner implementations 

103from hyper_parallel.core.distributed_checkpoint.standard_planner import ( 

104 StandardLoadPlanner, 

105 StandardSavePlanner, 

106) 

107 

108# Storage interfaces and data structures 

109from hyper_parallel.core.distributed_checkpoint.storage import ( 

110 StorageInfo, 

111 StorageReader, 

112 StorageWriter, 

113 WriteResult, 

114) 

115 

116# File system storage implementations 

117from hyper_parallel.core.distributed_checkpoint.filesystem_storage import ( 

118 FileSystemReader, 

119 FileSystemWriter, 

120) 

121 

122# Layout I/O utilities 

123from hyper_parallel.core.distributed_checkpoint.layout import ( 

124 combine_layout, 

125 get_current_layout, 

126 get_global_layout, 

127 load_layout, 

128 save_layout, 

129) 

130 

131# Base API (backward compatibility) 

132from hyper_parallel.core.distributed_checkpoint.loader import load_checkpoint 

133from hyper_parallel.core.distributed_checkpoint.saver import save_checkpoint 

134 

135# Resharding utilities 

136from hyper_parallel.core.distributed_checkpoint.reshard import ReshardHandler