AMCT (PyTorch)

You can set the AMCT quantization log level using environment variables.

Logs include logs printed on the screen and logs saved in the amct_log/amct_pytorch.log file. The environment variables are optional. If they are not set, the default log level INFO is used.

The logs in the amct_pytorch.log file will be overwritten when quantization is performed again. You need to save the logs. In addition, the size of the generated log file is related to the number of layers of the model to be quantized. Ensure that the server where ATC is installed has sufficient space.

Take the ResNet-101 model as an example. If the log level is set to INFO, the log file size is about 12 KB, and the size of the temporary file is about 260 MB. If the log level is set to DEBUG, the log file size is about 390 KB, and the size of the temporary file is about 430 MB.

  • 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.
    • Sets the level of information displayed on the screen.
    Table 1 lists the valid values and their meanings.
    Table 1 Variable Value Range

    Log Level

    Description

    Details

    DEBUG

    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: INFO, WARNING, and ERROR logs. Defaults to INFO.

    Brief quantization processing messages, including the quantization phase.

    WARNING

    WARNING: WARNING and ERROR logs.

    Warning messages during quantization.

    ERROR

    ERROR: ERROR logs.

    Error messages during quantization.

    Log levels are case insensitive. For instance, Info, info, and INFO are all valid values.

  • Command Example
    The following commands are only examples. You can set the parameters based on the site requirements.
    • Set the information level of the quantization log amct_pytorch.log to INFO.
      export AMCT_LOG_FILE_LEVEL=INFO
    • Sets the level of the information displayed on the screen to INFO.
      export AMCT_LOG_LEVEL=INFO