Coverage for  / home / jenkins / .local / lib / python3.10 / site-packages / hyper_parallel / components / quantization / functional / __init__.py: 100%

15 statements  

« prev     ^ index     » next       coverage.py v7.13.1, created at 2026-10-25 05:45 +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"""Low-precision strategies, shared autograd flows, and operator adapters.""" 

16 

17from hyper_parallel.components.quantization.functional.base_linear_func import ( 

18 LinearStrategy, 

19 _LinearFunction, 

20) 

21from hyper_parallel.components.quantization.functional.hifloat8_gmm_func import ( 

22 HiFloat8GroupedLinear, 

23) 

24from hyper_parallel.components.quantization.functional.hifloat8_linear_func import ( 

25 HiFloat8LinearStrategy, 

26) 

27from hyper_parallel.components.quantization.functional.linear_strategy_factory import ( 

28 build_linear_strategy, 

29) 

30from hyper_parallel.components.quantization.functional.mxfp8_gmm_func import ( 

31 MXFP8GroupedLinear, 

32) 

33from hyper_parallel.components.quantization.functional.mxfp8_linear_func import ( 

34 MXFP8LinearStrategy, 

35) 

36# Compatibility re-exports; NPU operator implementations live in ``quantization.ops``. 

37from hyper_parallel.components.quantization.ops.npu_hifloat8 import ( 

38 HiFloat8NpuOps, 

39 hifloat8_grouped_matmul, 

40 hifloat8_matmul, 

41 validate_hifloat8_gmm_runtime, 

42 validate_hifloat8_runtime, 

43) 

44from hyper_parallel.components.quantization.ops.npu_mxfp8 import ( 

45 LowPrecisionCapabilityError, 

46 MXFP8NpuOps, 

47 mxfp8_grouped_matmul, 

48 mxfp8_matmul, 

49 validate_npu_gmm_runtime, 

50 validate_npu_runtime, 

51) 

52from hyper_parallel.components.quantization.ops.npu_w4a8 import ( 

53 W4A8CapabilityError, 

54 W4A8NpuOps, 

55 transform_grouped_scale, 

56 validate_w4a8_gmm_runtime, 

57) 

58from hyper_parallel.components.quantization.functional.base_gmm_func import ( 

59 GroupedLinear, 

60 _GroupedLinearFunction, 

61) 

62from hyper_parallel.components.quantization.functional.strategy_factory import ( 

63 build_low_precision_strategy, 

64) 

65from hyper_parallel.components.quantization.functional.w4a8_gmm_func import ( 

66 W4A8GroupedLinear, 

67) 

68from hyper_parallel.components.quantization.functional.fake_w4a8_gmm_func import ( 

69 FakeW4A8GroupedLinear, 

70) 

71from hyper_parallel.components.quantization.ops.npu_fake_w4a8 import ( 

72 FakeW4A8CapabilityError, 

73 FakeW4A8NpuOps, 

74 validate_fake_w4a8_gmm_runtime, 

75) 

76 

77__all__ = [ 

78 "HiFloat8NpuOps", 

79 "HiFloat8GroupedLinear", 

80 "HiFloat8LinearStrategy", 

81 "LowPrecisionCapabilityError", 

82 "LinearStrategy", 

83 "MXFP8NpuOps", 

84 "MXFP8LinearStrategy", 

85 "hifloat8_grouped_matmul", 

86 "hifloat8_matmul", 

87 "mxfp8_grouped_matmul", 

88 "mxfp8_matmul", 

89 "MXFP8GroupedLinear", 

90 "GroupedLinear", 

91 "_LinearFunction", 

92 "_GroupedLinearFunction", 

93 "W4A8CapabilityError", 

94 "W4A8NpuOps", 

95 "W4A8GroupedLinear", 

96 "FakeW4A8GroupedLinear", 

97 "FakeW4A8CapabilityError", 

98 "FakeW4A8NpuOps", 

99 "build_linear_strategy", 

100 "build_low_precision_strategy", 

101 "transform_grouped_scale", 

102 "validate_w4a8_gmm_runtime", 

103 "validate_fake_w4a8_gmm_runtime", 

104 "validate_hifloat8_gmm_runtime", 

105 "validate_hifloat8_runtime", 

106 "validate_npu_gmm_runtime", 

107 "validate_npu_runtime", 

108]