show_kernel_debug_data

In the static graph scenario, all operators of the entire graph are offloaded to the NPU for execution. The single-operator debugging information (through the printf API) on the kernel can be obtained only after the model execution is complete. This tool provides the offline parsing capability to help users obtain and parse the debugging information (parse the .bin file into a readable format).

show_kernel_debug_data can be called by multiple users concurrently. However, users need to specify different flushing paths. Otherwise, the flushed content may be overwritten.

Applicability

Product

Supported

Atlas A3 training products / Atlas A3 inference products

√

Atlas A2 training products / Atlas A2 inference products

√

Atlas 200I/500 A2 inference products

√

Atlas inference products

√

Atlas training products

x

Tool Installation

  1. Install the tool.

    The tool is released with the CANN package. (For details about how to install the CANN package, see Environment Setup). The default path is ${INSTALL_DIR}/tools/show_kernel_debug_data. Replace ${INSTALL_DIR} with the file storage path after CANN software installation. For example, if the installation is performed by the root user, the default file storage path is /usr/local/Ascend/cann.

  2. Set environment variables.

    • Install the Ascend-CANN-Toolkit package as the root user:
      source /usr/local/Ascend/cann/set_env.sh
    • Install the Ascend-CANN-Toolkit package as a non-root user:
      source ${HOME}/Ascend/cann/set_env.sh

  3. Check whether the tool is successfully installed.

    Run the following command. If --help or -h is displayed, the tool environment is normal and the functions are normal.
    show_kernel_debug_data -h

How to Use

Result

The directory structure of the parsed result file is as follows:

├ ${output_path}
├── PARSER_${timestamp}           // ${timestamp} indicates the timestamp.
│   ├── parser.log              // Tool parsing log, including the routine process on the kernel and printf information.