Quantifiable Layers and Restrictions
This section describes the quantifiable layers of different frameworks and related restrictions.
- If the input data type or weight data type of the network model is float16 or mixed precision of float32 and float16, the quantization of the following operators is disabled:
AvgPool, Pooling, AvgPoolV2, MaxPool, MaxPoolV3, Add, Eltwise, and BatchMatMulV2 (Both inputs are tensors.).
- The following products do not support the Caffe framework:
Atlas A2 training product /Atlas A2 inference product Atlas A3 training product /Atlas A3 inference product Atlas 350 Accelerator Card
- Layers that support uniform quantization and their restrictions (Caffe framework)
Supported Layer Type
Restrictions
Ascend IR–defined Layer
InnerProduct
transpose = false, axis = 1
FullyConnection
Convolution
4 × 4 filter
Conv2D
Deconvolution
1-dilated 4 × 4 filter
Deconvolution
Pooling
- If mode is set to 1, indicating full quantization (weight+tensor), and global_pooling is set to false, the N shift operation is not supported.
- If mode is set to 0, only tensor quantization is performed.
Pooling
Eltwise
Only tensor quantization is performed and operation=1 is required.
Eltwise
- Layers that support uniform quantization and their restrictions (TensorFlow framework)
- Layers that support uniform quantization and their restrictions (ONNX framework)
This version does not support weight-only quantization.
Weight-only quantization is supported only by the following product types:
Ascend IR–defined Layer |
Weight Quantization Only, channel_wise=true in Weight ARQ |
Weight Quantization Only, asymmetric in Weight ARQ (true/false) |
Weight and Activation Quantization, channel_wise=true in Weight ARQ |
Weight and Activation Quantization, asymmetric=true in Weight ARQ |
Restriction |
|---|---|---|---|---|---|
MatMulV2 |
√ |
true |
× |
× |
The second inputs do not have dynamic inputs (such as placeholders). |
BatchMatMulV2 |
√ |
true |
× |
× |
The second inputs do not have dynamic inputs (such as placeholders). |
FFN |
√ |
true and false |
× |
× |
|
Notes:
- √: Supported. ×: Quantization is abnormal.
- channel_wise=true in Weight ARQ: Channels are separately quantized using different quantization factors.
- asymmetric in Weight ARQ
- true: Asymmetric weight quantization is used.
- false: Symmetric weight quantization is used.
- true and false: Both symmetric weight quantization and asymmetric weight quantization are supported.