Analyzing Comparison Results Using Commands

Command Syntax

To analyze comparison results using commands, run the -advisor option after tensor comparison. Then, use Advisor to continue the analysis and output the result.

The command syntax is as follows:

python3 msaccucmp.py compare -m my_dump_path -g golden_dump_path -advisor
Table 1 Command-line options for network-wide comparison

Option

Description

-advisor

After tensor comparison is complete, analyzes the comparison result and provides expert suggestions.

Note: The -overflow_detection option provides expert suggestions for FP16 overflow/underflow detection. It is enabled after the -advisor option is configured.

Procedure

  1. Log in to the CANN tool installation environment.
  2. Generate a .json file.
    atc --mode=1 --om=$HOME/data/resnet50.om --json=$HOME/data/resnet50.json
  3. Go to the ${INSTALL_DIR}/tools/operator_cmp/compare directory. Replace ${INSTALL_DIR} with the actual CANN component directory. If the Ascend-CANN-Toolkit package is installed as the root user, the CANN component directory is /usr/local/Ascend/ascend-toolkit/latest..
  4. Run the comparison command.
    python3 msaccucmp.py compare -m $HOME/MyApp_mind/resnet50 -g $HOME/Standard_caffe/resnet50 -f $HOME/data/resnet50.json -out $HOME/result -advisor
  5. Wait until accuracy comparison is complete. Then, Advisor analyzes the comparison result and outputs the analysis result. The result file is named advisor_summary.txt, and the save path is specified by -out. For details about the command output, see Output Results and Tuning Suggestions.