MatMulQAT
Applicable Products
Product |
Supported |
|---|---|
x |
|
x |
|
x |
|
x |
|
x |
|
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
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) |
Parent topic: QAT APIs in Single-Operator Mode