When the tool is used for operator debugging, the tensor at a specified offset position can be printed. Compared with DumpTensor (cannkit-commissioning-function-dumptensor.md), this function is similar but more flexible.
When the tensor data is large, you can use DumpAccChkPoint to specify the offset position and truncate the element value of the specified length for printing.
The dump offset position tensor in the simulator debugging scenario is controlled by the dump mode parameter.
The maximum available space allocated to each core for printing data is fixed at 1 MB. If the printing size exceeds 1 MB, the printed content will not be displayed. Therefore, the amount of data to be printed needs to be controlled.
In the kernel code, call the DumpAccChkPoint API where the tensor offset data needs to be printed as required. For details, see the API description. The following is an example:
DumpAccChkPoint(srcLocal,5,32,dataLen);
In the simulator debugging scenario, run the following command to enable the dump function:
ascendebug kernel --backend simulator --dump-mode acc_chk ... {other simulator debugging parameters} --Set dump-mode to acc_chk to enable the function of printing tensors at the offset position. Configure other parameters by referring to NPU Debugging Parameters as required.
View the dump result.
The tensor data at the dump offset position is stored in the *${root}/${work_dir}/npu* directory. The directory structure and result description are similar to those of DumpTensor.
The DumpAccChkPoint API is described as follows:
Function prototype:
Function description: Prints tensors at a specified offset position.
Parameter (IN):
Parameter (OUT): N/A
Return value: N/A
Restrictions:
Calling example:
DumpAccChkPoint(srcLocal, 7, 32 , 128);