MatMulQAT

Applicable Products

Product

Supported

Ascend 950PR/Ascend 950DT

x

Atlas A3 training products/Atlas A3 inference products

x

Atlas A2 training products/Atlas A2 inference products

x

Atlas 200I/500 A2 inference products

x

Atlas inference products

x

Atlas training products

x

Description

Constructs a MatMul QAT operator.

Prototype

This operator supports only the API for construction from scratch.
1
qat = amct_pytorch.nn.module.quantization.matmul.MatmulQAT(device, config)

Parameters

Table 1 Parameters in the API for operator construction from scratch

Parameter

Input/Output

Description

device

Input

Running device.

A string.

Default: None

config

Input

Quantization configuration. The following is a configuration example. For details about quantization configuration parameters, see Quantization Configuration Parameters.

DEFAULT_QAT_CONF = {
    "retrain_enable": True,
    "retrain_data_config": {
        "dst_type": "INT8", # INT8
        "batch_num": 1, # Greater than 0
        "fixed_min": True,
        "clip_max": 1.0,
        "clip_min": -1.0
    },
    "retrain_weight_config": {
        "dst_type": "INT8", # INT8
        "weights_retrain_algo": "arq_retrain", # arq_retrain/ulq_retrain
        "channel_wise": True
    }
}

A dict.

Default: None

Returns

Returns the constructed QAT single-operator instance.

Example

Construction from scratch:
1
2
3
from amct_pytorch.nn.module.quantization.matmul import MatmulQAT

MatmulQAT(device=None, config=None)