Coverage for hyper_parallel / core / checkpoint / __init__.py: 100%

11 statements  

« prev     ^ index     » next       coverage.py v7.13.1, created at 2026-03-01 07:33 +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# Main API 

23from hyper_parallel.core.checkpoint.api import load, save 

24 

25# Metadata structures 

26from hyper_parallel.core.checkpoint.metadata import ( 

27 BytesStorageMetadata, 

28 ChunkStorageMetadata, 

29 Metadata, 

30 MetadataIndex, 

31 TensorProperties, 

32 TensorStorageMetadata, 

33) 

34 

35# Planner interfaces and data structures 

36from hyper_parallel.core.checkpoint.planner import ( 

37 LoadItemType, 

38 LoadPlan, 

39 LoadPlanner, 

40 ReadItem, 

41 SavePlan, 

42 SavePlanner, 

43 WriteItem, 

44 WriteItemType, 

45) 

46 

47# Standard planner implementations 

48from hyper_parallel.core.checkpoint.standard_planner import ( 

49 StandardLoadPlanner, 

50 StandardSavePlanner, 

51) 

52 

53# Storage interfaces and data structures 

54from hyper_parallel.core.checkpoint.storage import ( 

55 StorageInfo, 

56 StorageReader, 

57 StorageWriter, 

58 WriteResult, 

59) 

60 

61# File system storage implementations 

62from hyper_parallel.core.checkpoint.filesystem_storage import ( 

63 FileSystemReader, 

64 FileSystemWriter, 

65) 

66 

67# Layout I/O utilities 

68from hyper_parallel.core.checkpoint.layout import ( 

69 combine_layout, 

70 get_current_layout, 

71 get_global_layout, 

72 load_layout, 

73 save_layout, 

74) 

75 

76# Base API (backward compatibility) 

77from hyper_parallel.core.checkpoint.loader import load_checkpoint 

78from hyper_parallel.core.checkpoint.saver import save_checkpoint 

79 

80# Resharding utilities 

81from hyper_parallel.core.checkpoint.reshard import ReshardHandler 

82 

83__all__ = [ 

84 # Main API 

85 "save", 

86 "load", 

87 # Metadata 

88 "Metadata", 

89 "MetadataIndex", 

90 "TensorStorageMetadata", 

91 "BytesStorageMetadata", 

92 "ChunkStorageMetadata", 

93 "TensorProperties", 

94 # Planner interfaces 

95 "SavePlanner", 

96 "LoadPlanner", 

97 "SavePlan", 

98 "LoadPlan", 

99 "WriteItem", 

100 "ReadItem", 

101 "WriteItemType", 

102 "LoadItemType", 

103 # Standard planners 

104 "StandardSavePlanner", 

105 "StandardLoadPlanner", 

106 # Storage interfaces 

107 "StorageWriter", 

108 "StorageReader", 

109 "StorageInfo", 

110 "WriteResult", 

111 # File system storage 

112 "FileSystemWriter", 

113 "FileSystemReader", 

114 # Layout I/O 

115 "get_current_layout", 

116 "save_layout", 

117 "load_layout", 

118 "combine_layout", 

119 "get_global_layout", 

120 # Base API 

121 "save_checkpoint", 

122 "load_checkpoint", 

123 # Resharding 

124 "ReshardHandler", 

125]