Simplified Configuration File for Auto Channel Pruning Search
The basic_info.proto file describes configurations for auto channel pruning search. Find the file in /amct_tensorflow/proto/basic_info.proto under the AMCT installation directory. The content of the file is as follows.
Parameter |
Required/Optional |
Type |
Field |
Description |
|---|---|---|---|---|
AutoMixedPrecisionConfig |
- |
- |
- |
AMCT simplified configuration for automatic mixed precision search. The current version does not support this feature. |
Optional |
Float |
compress_ratio |
Compression ratio. The computation amount of all quantizable layers is used as a reference compression multiple. |
|
Repeated |
QuantBitLimit |
quant_bit_limit |
Quantization bit width search range of specified layers. |
|
Optional |
String |
ptq_cfg |
Simplified PTQ configuration file, which is used to obtain the quantization factors under the quantization bit widths of INT4 and INT8 during calibration. If it is not set, uses the default PTQ configuration. |
|
Optional |
Int64 |
test_iteration |
Number of batches to dump. The dump data is used to measure the quantization impact and computation amount. The data size should be large enough to be representative. |
|
Optional |
String |
override_qat_cfg |
Simplified QAT configuration file. The output of automatic mixed precision search will overwrite the bit width of involved layers, and other parameters remain unchanged. If it is not set, uses the simplified QAT configuration file (.proto) to generate a .cfg configuration file with quantization bit width. |
|
AutoChannelPruneConfig |
- |
- |
- |
AMCT simplified configuration for auto channel pruning search |
Required |
Float |
compress_ratio |
Compression ratio. The computation amount of all quantizable layers is used as a reference compression multiple. |
|
Optional |
Boolean |
ascend_optimized |
Whether to perform adaptation to Ascend platforms. If the sparsified model is to be deployed on the AI processor, you are advised to set this parameter to true. |
|
Optional |
Float |
max_prune_ratio |
Maximum sparsity ratio of a single layer. Defaults to 1. |
|
Optional |
Int64 |
test_iteration |
Batch number of the input test data. |
|
Optional |
String |
override_prune_cfg |
Simplified configuration file for channel pruning set by the user. It can contain only the skip and override configurations. The configured layers use the specified configuration and will not be rewritten by the auto channel pruning search APIs. |
|
QuantBitLimit |
- |
- |
- |
Quantization bit width search range of specified layers. |
Optional |
String |
layer_name |
Layer name. |
|
Repeated |
DataType |
data_range |
Quantization bit width range. |
|
DataType |
- |
- |
- |
Quantization bit width range. Enumeration. |
- |
- |
FLOAT |
Float. Not quantized. The current version supports only INT8 quantization. |
|
- |
- |
INT8 |
INT8 quantization. |
|
- |
- |
INT4 |
INT4 quantization. |
The following is an example of the simplified configuration file (amc.cfg) for auto channel pruning search:
compress_ratio: 1.5 ascend_optimized: true max_prune_ratio: 0.8 test_iteration: 1 override_prune_cfg: 'your/path/to/override_channel_prune.cfg'