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.
|
Product |
Supported |
|---|---|
|
|
√ |
|
|
√ |
|
|
√ |
|
|
√ |
|
|
x |
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.
source /usr/local/Ascend/cann/set_env.sh
source ${HOME}/Ascend/cann/set_env.shshow_kernel_debug_data -h
show_kernel_debug_data <bin_file_path> [<output_path>]
|
Parameter |
Required |
Description |
|---|---|---|
|
<bin_file_path> |
Yes |
Path of the .bin file for flushing kernel debugging information to the disk, for example, /input/dump_workspace.bin. |
|
<output_path> |
No |
Path for saving the parsing result, for example, /output_dir. The default path is the path where the current command is executed. |
|
Prototype |
def show_kernel_debug_data(bin_file_path: str, output_path: str = './') -> None |
|||
|---|---|---|---|---|
|
Function |
Obtains the debugging information on the kernel and parses the information into a readable file. |
|||
|
Input Parameter |
bin_file_path |
Path of the .bin file for flushing kernel debugging information to the disk. The value is of the string type. |
||
|
output_path |
Path for saving the parsed result. The value is of the string type. The default path is the path where the current API calling script is located. |
|||
|
Output Parameter |
N/A |
- |
||
|
Returns |
N/A |
- |
||
|
Constraints |
None |
|||
|
Example |
|
|||
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.