Parsing Logs of a Custom AI CPU Operator

Overview

This function parses dump data files to obtain required information.

Currently, this function can parse AI CPU custom operator logs from dump data files and save the logs as log files.

Command Syntax

python3 dump_parser.py save_log -d dump_file [-out output]

Table 1 describes the command-line options.

This function is implemented through the dump_parser.py script, which is stored in ${INSTALL_DIR}/tools/operator_cmp/compare. 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..

Table 1 Command-line options

Option

Description

Mandatory (Yes/No)

-d

--dump_file

Dump data file to be parsed.

Yes

-out

--output

Directory for storing AI CPU custom operator logs. The default directory is the current directory.

The format of the result file name is dump_file_name.{index}.log.

You are not advised to configure directories that are different from those of the current user to avoid privilege escalation risks.

No

Procedure

  1. Log in to the CANN tool installation environment.
  2. 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..
  3. Run the save_log parsing command.
    python3 dump_parser.py save_log -d my_dump_path/dump_file -out /MyApp20/out

    After the command is executed, the log file is generated in the directory specified by -out.