aclgrphCalibration
Applicable Products
Ascend 950PR&950DT products : supportedAtlas A3 products : supportedAtlas A2 products : supportedAtlas 200I/500 A2 inference products : supportedAtlas inference products : supportedAtlas training products : supported
Header File/Library File
- Header file: #include <amct/acl_graph_calibration.h>
- Library file: libamctacl.so
Description
Automatically transforms a non-quantized graph into a quantized graph. For details about the application scenarios, see Quantization.
AMCT also provides two other quantization APIs: graphCalibration and amctGraphCalibration, which encapsulate quantization parameters. aclgrphCalibration is recommended.
Prototype
1 | graphStatus aclgrphCalibration(ge::Graph &graph, const std::map<ge::AscendString, ge::AscendString> &quantizeConfigs) |
Parameters
Parameter |
Input/Output |
Description |
|---|---|---|
graph |
Input |
Original graph to be modified. |
quantizeConfigs |
Input |
Key-value mapping table for the configuration options required for API execution. Both key (indicating the parameter type) and value (indicating the parameter value) are in string format. The configuration options are as follows:
|
Returns
Parameter |
Type |
Description |
|---|---|---|
- |
graphStatus |
GRAPH_SUCCESS(0): success. Other values: failure. |
Constraints
- Quantization is not supported for graphs where quantization operators have already been inserted.
- For details about the layers that support quantization and their constraints, see Quantifiable Layers and Constraints.
- When the PTQ calibration function specified in the configuration file is used, only environments with an installed NPU device are supported. You can refer to CANN Software Installation to set up the product environment.
- In the
Atlas 200I/500 A2 inference products Ascend RC scenario, you also need to install the NCS software in the operating environment and configure the key certificate. For details, see AOE (Ascend RC) > Environment Setup in Ascend Optimization Engine (AOE).