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-11-15 07:18 +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 "ActivationCheckpointSelection", 

30 "CompileConfig", 

31 "DataLoaderConfig", 

32 "DatasetConfig", 

33 "DebugConfig", 

34 "FSDP2Config", 

35 "MemoryConfig", 

36 "MixedPrecisionConfig", 

37 "ModelIntegrationConfig", 

38 "OptimizerConfig", 

39 "OptimizerSwapConfig", 

40 "ProfilingAnalysisConfig", 

41 "ProfilingConfig", 

42 "StressDetectConfig", 

43 "OpStressDetectConfig", 

44 "ModelStressDetectConfig", 

45 "ReplaceAction", 

46 "Target", 

47 "TrainerConfig", 

48 "TrainingConfig", 

49 "WandbConfig", 

50 "save_configs", 

51 "CheckpointingConfig", 

52] 

53 

54from hyper_parallel.models.build_options import CompileConfig, FSDP2Config 

55from hyper_parallel.components.checkpoint.config import CheckpointingConfig 

56 

57from hyper_parallel.trainer.config.data import ( 

58 DataLoaderConfig, 

59 DatasetConfig, 

60 ModelAssetsConfig, 

61) 

62from hyper_parallel.trainer.config.optimization import ( 

63 MixedPrecisionConfig, 

64 OptimizerConfig, 

65 OptimizerSwapConfig, 

66) 

67from hyper_parallel.trainer.config.parallelism import ( 

68 AcceleratorConfig, 

69 ActivationCheckpointConfig, 

70 ActivationCheckpointSelection, 

71 PlanOverride, 

72 ReplaceAction, 

73 _import_module_type, 

74 entries_to_module_replacements, 

75 entries_to_module_replacement_requests, 

76 entries_to_method_replacements, 

77 entries_to_plan_overrides, 

78 normalize_distributed_setup_overrides, 

79) 

80from hyper_parallel.trainer.config.target import Target 

81from hyper_parallel.trainer.config.stress_detect import ( 

82 ModelStressDetectConfig, 

83 OpStressDetectConfig, 

84 StressDetectConfig, 

85) 

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

87from hyper_parallel.trainer.config.training import ( 

88 DebugConfig, 

89 MemoryConfig, 

90 ModelIntegrationConfig, 

91 ProfilingAnalysisConfig, 

92 ProfilingConfig, 

93 TrainingConfig, 

94 WandbConfig, 

95)