Quantization Configuration Parameters

Table 1 retrain_enable

Description

QAT enable

Type

Boolean

Value

true or false

Command-Line Options

  • true: on
  • false: off

Recommended Value

true

Required/Optional

Optional

Table 2 retrain_data_config

Description

Activation quantization configuration

Type

Dictionary

Value

-

Command-Line Options

Includes the following parameters:

  • batch_num: batch number for quantization.
  • clip_max: upper bound of clipping-based quantization, defaulted to be empty.
  • clip_min: lower bound of clipping-based quantization, defaulted to be empty.
  • fixed_min: whether to fix the minimum value of clipping-based quantization to 0, defaulted to be empty.
  • dst_type: Currently, only INT8 quantization bit width is supported. The default value is INT8.

Recommended Value

-

Required/Optional

Optional

Table 3 retrain_weight_config

Description

Weight quantization configuration

Type

Dictionary

Value

-

Command-Line Options

Includes the following parameters:

  • weights_retrain_algo: quantization algorithm select, defaulted to arq_retrain.
  • channel_wise: whether to use different quantization factors for each channel.
  • dst_type: Currently, only INT8 quantization bit width is supported. The default value is INT8.

Recommended Value

-

Required/Optional

Optional

Table 4 weights_retrain_algo

Description

Weight quantization algorithm

Type

String

Value

-

Command-Line Options

  • ulq_quantize: ULQ clipping-based quantization algorithm
  • arq_retrain: ARQ algorithm

Recommended Value

arq_retrain

Required/Optional

Optional

Table 5 channel_wise

Description

Whether to use different quantization factors for each channel.

Type

Boolean

Value

true or false

Command-Line Options

  • true: Channels are separately quantized using different quantization factors.
  • false: All channels are quantized altogether using the same quantization factors.

Recommended Value

true

Required/Optional

Optional

Table 6 batch_num

Description

Batch number for quantization

Type

Integer

Value

Greater than 0

Command-Line Options

Defaults to 1. You are advised to keep the calibration dataset size within 50 images. Calculate batch_num based on batch_size as follows:

batch_num × batch_size = Calibration dataset size

batch_size indicates the number of images per batch.

Recommended Value

1

Required/Optional

Optional

Table 7 fixed_min

Description

Fixed lower bound switch for the activation quantization algorithm

Type

Boolean

Value

true or false

Command-Line Options

  • true: fixes the lower bound of the activation quantization algorithm at 0.
  • false: does not fix the lower bound of the activation quantization algorithm.

Recommended Value

Do not include this parameter.

Required/Optional

Optional

Table 8 clip_max

Description

Upper bound for the activation quantization algorithm

Type

Float

Value

clip_max > 0

Find the maximum max based on the distribution of the activation values at different layers. The recommended value range is [0.3 × max, 1.7 × max].

Command-Line Options

If this parameter is included, the upper bound of the clipping-based activation quantization algorithm is fixed. If this parameter is not included, the upper bound is learned using the IFMR algorithm.

Recommended Value

Do not include this parameter.

Required/Optional

Optional

Table 9 clip_min

Description

Lower bound for the activation quantization algorithm

Type

Float

Value

clip_min < 0

Find the minimum min based on the distribution of the activation values at different layers. The recommended value range is [0.3 × min, 1.7 × min].

Command-Line Options

If this parameter is included, the lower bound of the clipping-based activation quantization algorithm is fixed. If this parameter is not included, the lower bound is learned using the IFMR algorithm.

Recommended Value

Do not include this parameter.

Required/Optional

Optional

Table 10 dst_type

Description

Quantization bit width select

Type

String

Value

Currently, only INT8 (default) is supported.

Command-Line Options

Selects the quantization bit width during quantization.

Recommended Value

-

Required/Optional

Optional