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-10-25 05:45 +0800
« 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 quantization: config, tensors, quantizers, functions, modules."""
17from hyper_parallel.components.quantization.config import (
18 LowPrecisionConfig,
19 LowPrecisionDtypeScheme,
20)
21from hyper_parallel.components.quantization.functional import (
22 GroupedLinear,
23 LinearStrategy,
24 W4A8GroupedLinear,
25 FakeW4A8GroupedLinear,
26 build_low_precision_strategy,
27)
28from hyper_parallel.components.quantization.ops import (
29 FakeW4A8CapabilityError,
30 FakeW4A8NpuOps,
31 HiFloat8NpuOps,
32 LowPrecisionCapabilityError,
33 MXFP8NpuOps,
34 W4A8CapabilityError,
35 W4A8NpuOps,
36 hifloat8_grouped_matmul,
37 hifloat8_matmul,
38 mxfp8_grouped_matmul,
39 mxfp8_matmul,
40 transform_grouped_scale,
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)
66__all__ = [
67 "HiFloat8NpuOps",
68 "HiFloat8Quantizer",
69 "HiFloat8Tensor",
70 "HiFloat8TensorStorage",
71 "LowPrecisionConfig",
72 "LowPrecisionDtypeScheme",
73 "LowPrecisionCapabilityError",
74 "LinearStrategy",
75 "GroupedExperts",
76 "MXFP8NpuOps",
77 "MXFP8Quantizer",
78 "MXFP8Tensor",
79 "MXFP8TensorStorage",
80 "W4A8CapabilityError",
81 "W4A8GroupedLinear",
82 "W4A8NpuOps",
83 "W4A8Quantizer",
84 "W4A8Tensor",
85 "W4A8TensorStorage",
86 "FakeW4A8CapabilityError",
87 "FakeW4A8GroupedLinear",
88 "FakeW4A8NpuOps",
89 "FakeW4A8Quantizer",
90 "GroupedLinear",
91 "build_low_precision_strategy",
92 "LowPrecisionLinear",
93 "QuantizedTensor",
94 "QuantizedTensorStorage",
95 "Quantizer",
96 "hifloat8_grouped_matmul",
97 "hifloat8_matmul",
98 "mxfp8_grouped_matmul",
99 "mxfp8_matmul",
100 "transform_grouped_scale",
101 "validate_w4a8_gmm_runtime",
102 "validate_fake_w4a8_gmm_runtime",
103]