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-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"""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 validate_w4a8_gmm_runtime, 

56) 

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

58 GroupedLinear, 

59 _GroupedLinearFunction, 

60) 

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

62 build_low_precision_strategy, 

63) 

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

65 W4A8GroupedLinear, 

66) 

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

68 FakeW4A8GroupedLinear, 

69) 

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

71 FakeW4A8CapabilityError, 

72 FakeW4A8NpuOps, 

73 validate_fake_w4a8_gmm_runtime, 

74) 

75 

76__all__ = [ 

77 "HiFloat8NpuOps", 

78 "HiFloat8GroupedLinear", 

79 "HiFloat8LinearStrategy", 

80 "LowPrecisionCapabilityError", 

81 "LinearStrategy", 

82 "MXFP8NpuOps", 

83 "MXFP8LinearStrategy", 

84 "hifloat8_grouped_matmul", 

85 "hifloat8_matmul", 

86 "mxfp8_grouped_matmul", 

87 "mxfp8_matmul", 

88 "MXFP8GroupedLinear", 

89 "GroupedLinear", 

90 "_LinearFunction", 

91 "_GroupedLinearFunction", 

92 "W4A8CapabilityError", 

93 "W4A8NpuOps", 

94 "W4A8GroupedLinear", 

95 "FakeW4A8GroupedLinear", 

96 "FakeW4A8CapabilityError", 

97 "FakeW4A8NpuOps", 

98 "build_linear_strategy", 

99 "build_low_precision_strategy", 

100 "validate_w4a8_gmm_runtime", 

101 "validate_fake_w4a8_gmm_runtime", 

102 "validate_hifloat8_gmm_runtime", 

103 "validate_hifloat8_runtime", 

104 "validate_npu_gmm_runtime", 

105 "validate_npu_runtime", 

106]