Setting Environment Variables
This section describes how to set the log information and log level using environment variables during AMCT quantization.
There are logs printed to the screen and logs saved in the amct_log/amct_onnx.log file. The environment variables are optional. If they are not set, the default log level INFO is used.
- Variables
The log level is set by the following variables:
- AMCT_LOG_FILE_LEVEL: specifies the level of messages in the amct_onnx.log file and the level of messages in the log file generated of the corresponding quantizable layer when the fake-quantized model is generated.
- AMCT_LOG_LEVEL: specifies the level of information printed to the screen.
Table 1 lists the valid values and their meanings.Table 1 Variables Log Level
Description
Details
DEBUG
DEBUG, INFO, WARNING, and ERROR logs.
Detailed process messages, including the quantization layer and corresponding processing phase (fusion, parameter quantization, or activation quantization)
INFO
INFO, WARNING, and ERROR logs. Defaults to INFO.
Brief quantization processing messages, including the quantization phase.
WARNING
WARNING and ERROR logs.
Warning messages during quantization.
ERROR
ERROR logs.
Error messages during quantization.
Log levels are case insensitive. For instance, Info, info, and INFO are all valid values.
- Command ExampleThe following commands are only examples. You can set the parameters based on your need.
- Set the information level of the quantization log amct_onnx.log to INFO.
export AMCT_LOG_FILE_LEVEL=INFO
- Set the level of the information displayed on the screen to INFO.
export AMCT_LOG_LEVEL=INFO
- Set the information level of the quantization log amct_onnx.log to INFO.