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

7 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 quantization: config, tensors, quantizers, functions, modules.""" 

16 

17from hyper_parallel.components.quantization.config import ( 

18 LowPrecisionConfig, 

19 LowPrecisionDtypeScheme, 

20 MXBlockSizeValue, 

21) 

22from hyper_parallel.components.quantization.functional import ( 

23 GroupedLinear, 

24 LinearStrategy, 

25 W4A8GroupedLinear, 

26 FakeW4A8GroupedLinear, 

27 build_low_precision_strategy, 

28) 

29from hyper_parallel.components.quantization.ops import ( 

30 FakeW4A8CapabilityError, 

31 FakeW4A8NpuOps, 

32 HiFloat8NpuOps, 

33 LowPrecisionCapabilityError, 

34 MXFP8NpuOps, 

35 W4A8CapabilityError, 

36 W4A8NpuOps, 

37 hifloat8_grouped_matmul, 

38 hifloat8_matmul, 

39 mxfp8_grouped_matmul, 

40 mxfp8_matmul, 

41 validate_fake_w4a8_gmm_runtime, 

42 validate_w4a8_gmm_runtime, 

43) 

44from hyper_parallel.components.quantization.modules import ( 

45 GroupedExperts, 

46 LowPrecisionLinear, 

47) 

48from hyper_parallel.components.quantization.quantizers import ( 

49 HiFloat8Quantizer, 

50 MXFP8Quantizer, 

51 Quantizer, 

52 W4A8Quantizer, 

53 FakeW4A8Quantizer, 

54) 

55from hyper_parallel.components.quantization.tensor import ( 

56 HiFloat8Tensor, 

57 HiFloat8TensorStorage, 

58 MXFP8Tensor, 

59 MXFP8TensorStorage, 

60 QuantizedTensor, 

61 QuantizedTensorStorage, 

62 W4A8Tensor, 

63 W4A8TensorStorage, 

64) 

65 

66__all__ = [ 

67 "HiFloat8NpuOps", 

68 "HiFloat8Quantizer", 

69 "HiFloat8Tensor", 

70 "HiFloat8TensorStorage", 

71 "LowPrecisionConfig", 

72 "LowPrecisionDtypeScheme", 

73 "MXBlockSizeValue", 

74 "LowPrecisionCapabilityError", 

75 "LinearStrategy", 

76 "GroupedExperts", 

77 "MXFP8NpuOps", 

78 "MXFP8Quantizer", 

79 "MXFP8Tensor", 

80 "MXFP8TensorStorage", 

81 "W4A8CapabilityError", 

82 "W4A8GroupedLinear", 

83 "W4A8NpuOps", 

84 "W4A8Quantizer", 

85 "W4A8Tensor", 

86 "W4A8TensorStorage", 

87 "FakeW4A8CapabilityError", 

88 "FakeW4A8GroupedLinear", 

89 "FakeW4A8NpuOps", 

90 "FakeW4A8Quantizer", 

91 "GroupedLinear", 

92 "build_low_precision_strategy", 

93 "LowPrecisionLinear", 

94 "QuantizedTensor", 

95 "QuantizedTensorStorage", 

96 "Quantizer", 

97 "hifloat8_grouped_matmul", 

98 "hifloat8_matmul", 

99 "mxfp8_grouped_matmul", 

100 "mxfp8_matmul", 

101 "validate_w4a8_gmm_runtime", 

102 "validate_fake_w4a8_gmm_runtime", 

103]