Displaying the Debugging Information

ascend info devices

Run the following command to query the information about the device where the operator is running. The line where * is located indicates the target device.
1
2
3
(msdebug) ascend info devices
  Device Aic_Num Aiv_Num Aic_Mask Aiv_Mask
*    1      1       2      0x10000     0x3
The following table describes the key information.
Table 1 Information description

Field

Definition

Device

Logical device ID.

Aic_Num

Number of used cube cores.

Aiv_Num

Number of used vector cores.

Aic_Mask

Used cube mask, which is represented by 64 bits. If the nth bit is 1, cube n is used.

Aiv_Mask

Used vector mask, which is represented by 64 bits. If the nth bit is 1, vector n is used.

ascend info cores

Run the following command to query the information about the core where the operator is running. The line where * is located indicates the target core. In the following example, the target core is core 0 of the AIV.
1
2
3
4
5
(msdebug) ascend info cores
  CoreId  Type  Device Stream Task Block         PC               stop reason
   16     aic      1     3     0     0     0x12c0c00f1fc0         breakpoint 1.1
*   0     aiv      1     3     0     0     0x12c0c00f8fcc         breakpoint 1.1
    1     aiv      1     3     0     0     0x12c0c00f8d3c         breakpoint 1.1
For details about the command output, see the following table.
Table 2 Information description

Field

Definition

CoreId

Core ID of the AIV or AIC, starting from 0.

Type

Core type, which can be AIC or AIV.

Device

Logical device ID.

Stream

Stream ID delivered by the current kernel function. A stream consists of a series of tasks.

Task

Task ID in the current stream. It indicates the task delivered to the task scheduler for processing.

Block

Core on which the kernel function will be executed. Each core that executes the kernel function is assigned a logical ID, that is, block ID.

PC

Logic absolute address of the PC on the current core.

Stop Reason

Reason why the program stops, including breakpoint, step in, step over, or Ctrl+C.

ascend info tasks

Run the following command to query the task information of the operator. The line where * is located indicates the target task, including device ID, stream ID, task ID, and kernel function name (Invocation).
1
2
3
(msdebug) ascend info tasks
  Device Stream Task Invocation
*   1       3     0  matmul_leakyrelu_custom

ascend info stream

Run the following command to query the stream information of the operator. The line where * is located indicates the target stream, including the device ID, stream ID, and core type (AIC or AIC).
1
2
3
(msdebug) ascend info stream
  Device Stream Type
*   1      3    aiv

ascend info blocks

Run the following command to query the block information of the operator. The line where * is located indicates the target block, including device ID, stream ID, task ID, and block ID.
1
2
3
4
5
(msdebug) ascend info blocks
  Device Stream Task Block
    1      3     0     0
*   1      3     0     0
    1      3     0     0

Run the following command to display the code of the running block at the current breakpoint:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
(msdebug) ascend info blocks -d
Current stop state of all blocks:
 
[CoreId 16, Block 0]
* thread #1, name = 'matmul_leakyrel', stop reason = breakpoint 1.1
    frame #0: 0x0000000000008fc0 device_debugdata`_ZN7AscendC14KfcMsgGetStateEj_mix_aic(flag=0) at kfc_comm.h:188
   185      return static_cast<KFC_Enum>((flag & 0xffff0000) >> KFC_MSG_BYTE_OFFSET);
   186  }
   187  __aicore__ inline uint32_t KfcMsgGetState(uint32_t flag)
-> 188  {
   189      return (flag & 0x00008000);
   190  }
   191  __aicore__ inline uint32_t KfcMsgMakeFlag(KFC_Enum funID, uint16_t instID)
 
[* CoreId 0, Block 0]
* thread #1, name = 'matmul_leakyrel', stop reason = breakpoint 1.1
    frame #0: 0x000000000000ffcc device_debugdata`_ZN17MatmulLeakyKernelIDhDhffE7CopyOutEj_mix_aiv(this=0x0000000000167b60, count=0) at matmul_leakyrelu_kernel.cpp:116:1
   113          (uint16_t)((tiling.N - tiling.baseN) * sizeof(cType) / DEFAULT_C0_SIZE)};
   114      DataCopy(cGlobal[startOffset], reluOutLocal, copyParam);
   115      reluOutQueue_.FreeTensor(reluOutLocal);
-> 116  }
   117
   118  template <typename aType, typename bType, typename cType, typename biasType>
   119  __aicore__ inline void MatmulLeakyKernel<aType, bType, cType, biasType>::CalcOffset(int32_t blockIdx,
 
[CoreId 1, Block 0]
* thread #1, name = 'matmul_leakyrel', stop reason = breakpoint 1.1
    frame #0: 0x000000000000fd3c device_debugdata`_ZN7AscendC13WaitEventImplEt_mix_aiv(flagId=1) at kernel_operator_sync_impl.h:142:5
   139
   140  __aicore__ inline void WaitEventImpl(uint16_t flagId)
   141  {
-> 142      wait_flag_dev(flagId);
   143  }
   144
   145  __aicore__ inline void SetSyncBaseAddrImpl(uint64_t config)