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_pytorch/proto/basic_info.proto under the AMCT installation directory.
Message |
Required/Optional |
Type |
Field |
Description |
|---|---|---|---|---|
AutoChannelPruneConfig |
- |
- |
- |
Simplified configuration for AMCT 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 |
bool |
ascend_optimized |
Whether to perform Ascend affinity optimization. If the pruned model needs 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. The default value is 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. |
|
AttrProto |
- |
- |
- |
Common attribute definition message, which is used to store different types of attribute values. |
AttrType |
- |
- |
Enumeration of attribute types for selecting the field in which values are stored. |
|
- |
- |
UNDEFINED |
Undefined type. |
|
- |
- |
FLOAT |
Single floating-point number. |
|
- |
- |
INT |
Single integer. |
|
- |
- |
STRING |
Single string. |
|
- |
- |
FLOATS |
Floating-point number array. |
|
- |
- |
INTS |
Integer array. |
|
- |
- |
STRINGS |
String array. |
|
Optional |
string |
name |
Attribute name. |
|
Optional |
AttrType |
type |
Attribute type (using the AttrType enumeration). |
|
Optional |
float |
f |
Floating-point value (used when the type is FLOAT). |
|
Optional |
int64 |
i |
Integer value (used when the type is INT). |
|
Optional |
bytes |
s |
String value (used when the type is STRING). |
|
Repeated |
float |
floats |
Floating-point array (used when the type is FLOATS). |
|
Repeated |
int64 |
ints |
Integer array (used when the type is INTS). |
|
Repeated |
bytes |
strings |
String array (used when the type is STRINGS). |
The following is an example of the simplified configuration file (amc.cfg) for auto channel pruning:
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'