目录

Parameter Description for the ascendebug Debugging Tool

Overview

You can use ascendebug -h or ascendebug --help to view all debugging modes supported by the tool. For details, see Table 1.

Table 1 Supported CLI-based debugging modes

Parameter Mode Description Remarks
tiling Debugs the operator tiling code. For details, see Tiling Debugging Function. Use the ascendebug tiling -h or ascendebug tiling --help command to view all parameters involved in tiling debugging.
kernel Debugs the accuracy and performance of the operator kernel code on a device, covering the CPU, NPU, and simulator. For details, see CPU Twin Debugging Function and Simulator Performance Simulation Function.

Use the ascendebug kernel -h or ascendebug kernel --help command to view all parameters involved in CPU, NPU, and simulator debugging.

Note: The NPU parameter is not supported currently.

json

Generates an operator JSON configuration template during data preparation. For details, see Obtaining the Operator JSON Configuration Template.

Note: Currently, this function applies only to the standard custom operator project and built-in project scenarios.

Use ascendebug json convert -h or ascendebug json convert --help to view all involved parameters.
mc2parse Reserved. -
op_compiler Reserved. -

Tiling Debugging Parameters

Parameter (Case Sensitive) Description Mandatory Default Value Remarks
tiling Fixed parameter for enabling tiling debugging. Yes None None
--chip-version Version of the Kirin AI processor. Yes None

Obtained from the command line in the operating environment:

hdc -t {target} shell param get ohos.boot.chiptype

target: SN of the device. You can run the hdc list targets command to obtain the SNs of all devices in the current environment.

-i, --install-path Path for storing files after the CANN software is installed. No The UniSTAR Designer automatically obtains the value. Not supported. Developers do not need to pay attention to this function.
-w, --work-dir Directory for storing debugging results. No The default value is /debug_workspace/${op_type} in the current execution path. If the folder does not exist, it will be automatically created. It is the debugging working directory, used to store temporary files and result files during debugging, for example, /home/debug_workspace/AddCustom/tiling.
-j, --json-file Operator JSON configuration file, which is used to configure the inputs, outputs, and attributes of an operator. Yes None The JSON configuration file must be an absolute path. For details about the configuration items, see Preparing Input Data and Golden Data.
--log-level Log level. No info The debug, info, warning, and error levels are supported.
--log-file Log file path. No Defaulted to the debug_op.log file in the current directory. If this file does not exist, it will be created. It stores log information generated during program execution based on --log-level.
--repo-type Operator development scenario type. No customize

Set this parameter as needed.

- minimalist: kernel launch project.

- customize: standard custom operator project.

--customize-path Installation path of the custom operator package. No None

Ignore it. Currently, the value is fixed to ${install_path}/ddk/ tools/tools_ascendc/custom_op/${chip-version}.

Note: This parameter is valid only when --repo-type is set to customize.

--tiling-json Tiling .json file path (absolute path) used to generate custom tiling data. No None

Reserved.

--repo-path Absolute path of the operator source repository. No None

Reserved.

--recompile-tiling Whether to recompile the tiling .so file (does not need to be configured). No None

Reserved.

CPU Debugging Parameters

Parameter (Case Sensitive) Description Mandatory Default Value Remarks
kernel Fixed parameter for enabling CPU debugging. Yes None None
-b, --backend Operator debugging type. No npu

For CPU debugging, set cpu.

- cpu: CPU debugging.

- npu: NPU debugging.

- simulator: simulator debugging.

Note: The NPU parameter is not supported currently.

--chip-version Version of the SoC NPU IP accelerator of the Kirin AI processor. No Automatically obtained by the tool.

Obtained from the command line in the operating environment:

hdc -t {target} shell param get ohos.boot.chiptype

target: SN of the device. You can run the hdc list targets command to obtain the SNs of all devices in the current environment.

-i, --install-path Path for storing files after the DDK software is installed. No Automatically obtained by the tool. Not supported. Developers do not need to pay attention to this function.
-w, --work-dir Directory for storing debugging results. No The default value is /debug_workspace/${op_type} in the current execution path. If the folder does not exist, it will be automatically created. It is the debugging working directory, used to store temporary files and result files during debugging, for example, /home/debug_workspace/AddCustom/cpu.
-j, --json-file Operator JSON configuration file, which is used to configure the inputs, outputs, and attributes of an operator. Yes None The JSON configuration file must be an absolute path. For details about the configuration items, see Preparing Input Data and Golden Data.
--log-level Log level. No info The debug, info, warning, and error levels are supported.
--log-file Log file path. No Defaulted to the debug_op.log file in the current directory. If this file does not exist, it will be created. It stores log information generated during program execution based on --log-level.
--repo-type Operator development scenario type. No customize

Set this parameter as needed.

- minimalist: kernel launch project.

- customize: standard custom operator project.

--customize-path Installation path of the custom operator package. No None

Ignore it. Currently, the value is fixed to ${install_path}/ddk/ tools/tools_ascendc/custom_op/${chip-version}.

Note: This parameter is valid only when --repo-type is set to customize.

--dump-mode Mode of PRINTF/DumpTensor/DumpAccChkPoint/assert printing. No None

If this parameter is not set, the printing is disabled. Otherwise, the following printing modes are supported:

normal: enables the general printing.

For details about the printing function, see More Functions.

Note: For CPU debugging, printf uses the native C++ printing, which is not controlled by dump-mode.

--core-type Operator type. No AiCore

Set this parameter based on the actual operator. The options are AiCore, CubeCore, and VectorCore.

The operators in the Kirin 9020, Kirin 9030, and Kirin X90 series processors generally use the AI Cube compute unit, and the operator type is AiCore.

--rel-err-thd Relative error threshold of accuracy comparison. No 0.005 None
--abs-err-thd Absolute error threshold of accuracy comparison. No 0.005 None
--block-num Number of running cores. No None If the tiling.bin file exists, use the actual value of block_num. Otherwise, set this parameter as required.
--npucheck npucheck switch, which provides memory verification and exception detection on the CPU. No true

- true: The memory check function is enabled.

- false: The memory check function is disabled.

**Note: **This parameter and --dump-mode are mutually exclusive, because the printing function performs special processing on the memory.

--tiling-bin tiling.bin file, which is input for compilation. No None

The input tiling.bin file is named with an absolute path. The file naming rule is tiling_data_tiling_key_*${tiling_key}block_dim${block_num}workspace${workspace}*.bin. Make sure that tiling_key, block_num, and workspace match the tiling.bin file.

**Note: **This parameter conflicts with --tiling-so, --tiling-json and --recompile-tiling. Set only one of them.

--tiling-so liboptiling.so file, which is input for compilation. No None This parameter conflicts with --tiling-bin, --tiling-json and --recompile-tiling. Set only one of them.
--tiling-json Tiling .json file path (absolute path) used to generate custom tiling data. No None

Reserved.

--repo-path Absolute path of the operator source repository. No None

Reserved.

--recompile-tiling Whether to recompile the tiling .so file (does not need to be configured). No None

Reserved.

NPU Debugging Parameters

Parameter (Case Sensitive) Description Mandatory Default Value Remarks
kernel Fixed parameter for enabling NPU debugging. Yes None None
-b, --backend Operator debugging type. No npu

For NPU debugging, set npu.

- cpu: CPU debugging.

- npu: NPU debugging.

- simulator: simulator debugging.

--chip-version Version of the SoC NPU IP accelerator of the Kirin AI processor. No Automatically obtained by the tool.

Obtained from the command line in the operating environment:

hdc -t {target} shell param get ohos.boot.chiptype

target: SN of the device. You can run the hdc list targets command to obtain the SNs of all devices in the current environment.

-i, --install-path Path for storing files after the Ascend C software is installed. No The UniSTAR Designer automatically obtains the value. Not supported. Developers do not need to pay attention to this function.
-w, --work-dir Directory for storing debugging results. No The default value is /debug_workspace/${op_type} in the current execution path. If the folder does not exist, it will be automatically created. It is the debugging working directory, used to store temporary files and result files during debugging, for example, /home/debug_workspace/AddCustom/npu.
-j, --json-file Operator JSON configuration file, which is used to configure the inputs, outputs, and attributes of an operator. Yes None The JSON configuration file must be an absolute path. For details about the configuration items, see Preparing Input Data and Golden Data.
--log-level Log level. No info The debug, info, warning, and error levels are supported.
--log-file Log file path. No Defaulted to the debug_op.log file in the current directory. If this file does not exist, it will be created. It stores log information generated during program execution based on --log-level.
--repo-type Operator development scenario type. No customize

Set this parameter as needed.

- minimalist: kernel launch project.

- customize: standard custom operator project.

--customize-path Installation path of the custom operator package. No None

Ignore it. Currently, the value is fixed to ${install_path}/ddk/ tools/tools_ascendc/custom_op/${chip-version}.

Note: This parameter is valid only when --repo-type is set to customize.

--dump-mode Mode of printf/PRINTF/DumpTensor/DumpAccChkPoint/assert/timestamp printing. No None

If this parameter is not set, the printing is disabled. Otherwise, the following printing modes are supported:

normal: enables the general printing.

Note: When the value is normal, this function cannot be enabled together with --profiling.

For details about the printing function, see More Functions.

--core-type Operator type. No AiCore Set this parameter based on the actual operator. The options are AiCore, CubeCore, and VectorCore. These parameters are reserved and developers do not need to follow them.
--rel-err-thd Relative error threshold of accuracy comparison. No 0.005 None
--abs-err-thd Absolute error threshold of accuracy comparison. No 0.005 None
-d, --device-id Running device ID. No 0 None
-t, --timeout Running timeout, in seconds. No 600 None
--block-num Number of running cores. No None If the tiling.bin file exists, use the actual value of block_num. Otherwise, set this parameter as required.
--profiling Profiling switch. It does not need to be set to any value. No None

- Basic profiling: No configured value. PipeUtilization data (PMU data) is collected by default.

- Advanced profiling: Multiple types of running profile data can be collected by running --profiling ${profiling_metrics}. The values of ${profiling_metrics} are as follows:

Reserved.

--loop Board execution times with profiling enabled. No 10

Reserved.

--kernel-bin Compiled kernel .bin file. No None

When this parameter is valid, the compilation process is skipped and the specified kernel .bin file is used for execution.

Reserved.

--tiling-bin tiling.bin file, which is input for compilation. No None

The input tiling.bin file is named with an absolute path. The file naming rule is tiling_data_tiling_key_*${tiling_key}block_dim${block_num}workspace${workspace}*.bin. Make sure that tiling_key, block_num, and workspace match the tiling.bin file.

NOTE

- This parameter conflicts with --tiling-so, --tiling-json and --recompile-tiling. Set only one of them.

- Reserved.

--tiling-so liboptiling.so file, which is input for compilation. No None

This parameter conflicts with --tiling-bin, --tiling-json and --recompile-tiling. Set only one of them.

Reserved.

--tiling-json Tiling .json file path (absolute path) used to generate custom tiling data. No None

Reserved.

--repo-path Absolute path of the operator source repository. No None

Reserved.

--recompile-tiling Whether to recompile the tiling .so file (does not need to be configured). No None

Reserved.

--npu-compile-type Compilation type of the kernel.o file. No opc

When --repo-type is set to cann_dev or ops_adv, the compilation modes CCEC and opc are supported. By default, CCEC is used for minimalist, and opc is used for customize and op_contrib.

- opc: built-in mode of the Ascend C framework.

- CCEC: compilation mode obtained by automatically combining build options based on the BiSheng compiler. For details about the BiSheng compiler, see the BiSheng Compiler User Guide.

Reserved.

--compile-option Sets custom parameters in the OPC compilation scenario. No None

Reserved.

--syncall Enables or disables the hard synchronization function. No value needs to be configured. No None

Reserved.

--task-ration Allocation ratio of block number when the kernel function is running, for example, --task-ration 1:1. No None

This parameter is valid only when --repo-type is set to ops_adv or cann_dev and --npu-compile-type is set to CCEC.

Reserved.

--memory-check Whether to enable memory detection. No None

No configured value: This function is disabled by default.

- oom: enables memory exception detection to detect memory leakage, unauthorized release, unauthorized read/write, and out-of-bounds access.

- oob: enables memory exception detection to detect out-of-bounds access.

NOTE

- This parameter and --dump-mode are mutually exclusive. Set either of them.

- This parameter is valid only when --repo-type is set to cann_dev, customize, or ops_adv; and --npu-compile-type is set to opc.

- This parameter cannot be set when --repo-type is set to minimalist or op_contrib.

- Reserved.

Simulator Simulation Parameters

Parameter (Case Sensitive) Description Mandatory Default Value Remarks
kernel Fixed parameter for enabling simulation function. Yes None None
-b, --backend Operator debugging type. No npu

For simulator debugging, set simulator.

- cpu: CPU debugging.

- npu: NPU debugging.

- simulator: simulator debugging.

Note: The NPU parameter is not supported currently.

--chip-version Version of the SoC NPU IP accelerator of the Kirin AI processor. No Automatically obtained by the tool.

Obtained from the command line in the operating environment:

hdc -t {target} shell param get ohos.boot.chiptype

target: SN of the device. You can run the hdc list targets command to obtain the SNs of all devices in the current environment.

-i, --install-path Path for storing files after the Ascend C software is installed. No The UniSTAR Designer automatically obtains the value. Not supported. Developers do not need to pay attention to this function.
-w, --work-dir Directory for storing debugging results. No The default value is /debug_workspace/${op_type} in the current execution path. If the folder does not exist, it will be automatically created. It is the debugging working directory, used to store temporary files and result files during debugging, for example, /home/debug_workspace/AddCustom/simulator.
-j, --json-file Operator JSON configuration file, which is used to configure the inputs, outputs, and attributes of an operator. Yes None The JSON configuration file must be an absolute path. For details about the configuration items, see Preparing Input Data and Golden Data.
--log-level Log level. No info The debug, info, warning, and error levels are supported.
--log-file Log file path. No Defaulted to the debug_op.log file in the current directory. If this file does not exist, it will be created. It stores log information generated during program execution based on --log-level.
--repo-type Operator development scenario type. No customize

Set this parameter as needed.

- minimalist: kernel launch project.

- customize: standard custom operator project.

--customize-path Installation path of the custom operator package. No None

Ignore it. Currently, the value is fixed to ${install_path}/ddk/ tools/tools_ascendc/custom_op/${chip-version}.

Note: This parameter is valid only when --repo-type is set to customize.

--dump-mode Mode of the printf/PRINTF/DumpTensor/DumpAccChkPoint/assert printing. No None

If this parameter is not set, the printing is disabled. Otherwise, the following printing modes are supported:

- normal: enables the general printing.

- acc_chk: enables the printing of tensor data at an offset position (DumpAccChkPoint printing). Enables phase-based printing.

For details about the printing function, see More Functions.

--core-type Operator type. No AiCore Set this parameter based on the actual operator. The options are AiCore, CubeCore, and VectorCore.
-t, --timeout Running timeout, in seconds. No 600 CAModel runs for a long time, so this parameter is typically set to 1200s. You can change the value as required.
--block-num Number of running cores. No None In the CAModel scenario, a single core is used. Therefore, set 1.
--kernel-bin Compiled kernel .bin file. No None When this parameter is valid, the compilation process is skipped and the specified kernel .bin file is used for execution.
--simulator-mode Simulator mode configuration. No camodel

The camodel, esl, and biprof modes are supported. Currently, only the camodel mode is supported.

Note: When --simulator-mode is set to biprof, the biprof analysis plugin is enabled to generate the result flowchart, which does not affect the Camodel/Esl simulation process.

--simu-pkg-path Path of the simulator installation package. No None

When --simulator-mode is set to camodel, you do not need to set this parameter. When running ESL simulation, you need to set this parameter to specify the ESL package path.

Reserved.

--tiling-bin tiling.bin file, which is input for compilation. No None

The input tiling.bin file is named with an absolute path. The file naming rule is tiling_data_tiling_key_*${tiling_key}block_dim${block_num}workspace${workspace}*.bin. Make sure that tiling_key, block_num, and workspace match the tiling.bin file.

NOTE

- This parameter conflicts with --tiling-so, --tiling-json and --recompile-tiling. Set only one of them.

- Reserved.

--tiling-so liboptiling.so file, which is input for compilation. No None

This parameter conflicts with --tiling-bin, --tiling-json and --recompile-tiling. Set only one of them.

Reserved.

--tiling-json Tiling .json file path (absolute path) used to generate custom tiling data. No None

This parameter is valid only when --repo-type is set to ops_adv or cann_dev.

NOTE

- This parameter conflicts with --tiling-so, --tiling-bin and --recompile-tiling. Set only one of them.

- Reserved.

--repo-path Absolute path of the operator source repository. No None

This parameter is valid only when --repo-type is set to ops_adv, cann_dev, or op_contrib.

Reserved.

--recompile-tiling Whether to recompile the tiling .so file (does not need to be configured). No None

- If this parameter is set, the tiling .so file is recompiled based on the operator source repository by default.

- If this parameter is not set, the tool automatically searches for .so files in the DDK package. You do not need to pay attention to this role.

NOTE

- This parameter is valid only when --repo-type is set to ops_adv, cann_dev, or op_contrib.

- This parameter conflicts with --tiling-so, --tiling-bin and --tiling-json. Set only one of them.

- Reserved.

--npu-compile-type Compilation type of the kernel.o file. No opc

When --repo-type is set to cann_dev or ops_adv, the compilation modes CCEC and opc are supported. By default, CCEC is used for minimalist, and opc is used for customize and op_contrib.

- opc: built-in mode of the Ascend C framework.

- CCEC: compilation mode obtained by automatically combining build options based on the BiSheng compiler. For details about the BiSheng compiler, see the BiSheng Compiler User Guide.

Reserved.

--compile-option Whether to enable the customized single-operator compilation and debugging capability during OPC compilation. No xx

Reserved.

--syncall Enables or disables the hard synchronization function. No value needs to be configured. No None

Reserved.

--task-ration Allocation ratio of block number when the kernel function is running, for example, --task-ration 1:1. No None

This parameter is valid only when --repo-type is set to ops_adv or cann_dev and --npu-compile-type is set to CCEC.

Reserved.