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

10 statements  

« prev     ^ index     » next       coverage.py v7.13.1, created at 2026-12-05 05:12 +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"""Typed trainer configuration tree (stage 7, 05 §15.2.5). 

16 

17The former ``auto_models/trainer/config.py`` monolith is split into 

18``target`` / ``training`` / ``parallelism`` / ``optimization`` / ``data`` / 

19``trainer`` by configuration domain; ``manager`` and ``resolver`` moved 

20from ``auto_models/config`` unchanged. This package re-exports the same 

21public class names — including the AutoModels-owned ``CompileConfig`` / 

22``FSDP2Config`` / ``CheckpointingConfig`` — without copying their 

23definitions. 

24""" 

25 

26__all__ = [ 

27 "AcceleratorConfig", 

28 "ActivationCheckpointConfig", 

29 "FullCheckpointConfig", 

30 "FullExcludeRegionConfig", 

31 "ModelModuleSpec", 

32 "ModuleRegionSpec", 

33 "SelectiveCheckpointConfig", 

34 "CompileConfig", 

35 "DataLoaderConfig", 

36 "DatasetConfig", 

37 "DebugConfig", 

38 "FSDP2Config", 

39 "MemoryConfig", 

40 "MixedPrecisionConfig", 

41 "ModelIntegrationConfig", 

42 "OptimizerConfig", 

43 "OptimizerSwapConfig", 

44 "ProfilingAnalysisConfig", 

45 "ProfilingConfig", 

46 "StressDetectConfig", 

47 "OpStressDetectConfig", 

48 "ModelStressDetectConfig", 

49 "ReplaceAction", 

50 "Target", 

51 "TrainerConfig", 

52 "TrainingConfig", 

53 "WandbConfig", 

54 "save_configs", 

55 "CheckpointingConfig", 

56] 

57 

58from hyper_parallel.models.build_options import CompileConfig, FSDP2Config 

59from hyper_parallel.components.checkpoint.config import CheckpointingConfig 

60 

61from hyper_parallel.trainer.config.data import ( 

62 DataLoaderConfig, 

63 DatasetConfig, 

64 ModelAssetsConfig, 

65) 

66from hyper_parallel.trainer.config.optimization import ( 

67 MixedPrecisionConfig, 

68 OptimizerConfig, 

69 OptimizerSwapConfig, 

70) 

71from hyper_parallel.trainer.config.parallelism import ( 

72 AcceleratorConfig, 

73 ActivationCheckpointConfig, 

74 FullCheckpointConfig, 

75 FullExcludeRegionConfig, 

76 ModelModuleSpec, 

77 ModuleRegionSpec, 

78 PlanOverride, 

79 ReplaceAction, 

80 SelectiveCheckpointConfig, 

81 _import_module_type, 

82 entries_to_module_replacements, 

83 entries_to_module_replacement_requests, 

84 entries_to_method_replacements, 

85 entries_to_plan_overrides, 

86 normalize_distributed_setup_overrides, 

87) 

88from hyper_parallel.trainer.config.target import Target 

89from hyper_parallel.trainer.config.stress_detect import ( 

90 ModelStressDetectConfig, 

91 OpStressDetectConfig, 

92 StressDetectConfig, 

93) 

94from hyper_parallel.trainer.config.trainer import TrainerConfig, save_configs 

95from hyper_parallel.trainer.config.training import ( 

96 DebugConfig, 

97 MemoryConfig, 

98 ModelIntegrationConfig, 

99 ProfilingAnalysisConfig, 

100 ProfilingConfig, 

101 TrainingConfig, 

102 WandbConfig, 

103)