show_kernel_debug_data

Kernel-side operator debugging information (AscendC::DumpTensor, AscendC::printf, etc.) can be obtained after configuring Dump settings. The show_kernel_debug_data tool provides offline parsing capabilities, helping users obtain and parse debugging information (converting bin files into a readable format).

For a tool usage demonstration, refer to the show_kernel_debug_data example.

Usage

  • Command-Line Method

    show_kernel_debug_data  `<bin_file_path>`  [`<output_path>`]
    
    Parameter Required/Optional Description
    bin_file_path Required The path where kernel-side debugging information is saved. Supports bin files or directories. In directory mode, .bin files are recursively collected and parsed together.
    output_path Optional The path to save parsing results, e.g., "/output_dir". Defaults to the current command-line working directory. The tool will automatically create the directory if it does not exist.
  • API Method

    show_kernel_debug_data API description:

    Function Prototype def show_kernel_debug_data(bin_file_path: str, output_path: str = './') -> None
    Function Description Obtains kernel-side debugging information and parses it into readable files.
    Parameters (IN) bin_file_path The path where kernel-side debugging information is saved. Supports bin files or directories. String type.
    output_path The path to save parsing results. String type. Defaults to the directory of the calling script. Automatically created if the directory does not exist.
    Parameters (OUT) NA -
    Return Value NA -
    Constraints None
    Call Example from show_kernel_debug_data import show_kernel_debug_data
    show_kernel_debug_data("./input/dump_workspace.bin")
  • Dump Configuration

    Enable Dump configuration through the aclInit API. Configure the dump_path parameter to set the path for saving Dump data, and configure the dump_kernel_data parameter to enable the Dump function. An example configuration file is as follows:

    {
        "dump" :{
            "dump_kernel_data" :"all",
            "dump_path" :"../output"
        }
    }
    
    • dump_kernel_data: Specifies the type of data to export. Multiple types can be configured, separated by commas. The following types are currently supported:
      • all: Export output data from all of the following debugging types.
      • printf: Export output data from AscendC::printf/PRINTF debugging.
      • tensor: Export output data from AscendC::DumpTensor debugging.
      • assert: Export output data from ascend_assert debugging.
      • timestamp: Export timestamp information obtained via AscendC::PrintTimestamp.
    • dump_path: When enabling the operator Kernel debugging information Dump function, dump_path must be configured. Both absolute and relative paths are supported.

    In addition to the above method, you can also configure the Dump storage path through the environment variables ASCEND_DUMP_PATH and ASCEND_WORK_PATH. The priority of Dump file storage paths is as follows: ASCEND_DUMP_PATH > ASCEND_WORK_PATH > dump_path in the configuration file.