Switching Cores

Perform the following operations to switch the current core to the specified core. After the core is switched, the position of the code interruption of the specified core is automatically displayed.

  • Assume that the running core is core 2 of the AIV, and the core to be switched is core 3 of the AIV.
     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    (msdebug) ascend aiv 3
    [Switching to focus on Kernel matmul_leakyrelu_custom, CoreId 3, Type aiv]
    * 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)
    
    After the switchover is complete, query the core information again. You can see that the core is switched to the line where the new core ID is located.
    1
    2
    3
    4
    5
    (msdebug) ascend info cores
      CoreId  Type  Device Stream Task Block         PC               stop reason
       17     aic      1     3     0     0     0x12c0c00f1f88         breakpoint 1.1
        2     aiv      1     3     0     0     0x12c0c00f8fbc         breakpoint 1.1
    *   3     aiv      1     3     0     0     0x12c0c00f8d3c         breakpoint 1.1
    
  • Assume that the running core is core 3 of the AIV, and the core to be switched is core 17 of the AIC.
     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    (msdebug) ascend aic 17
    [Switching to focus on Kernel matmul_leakyrelu_custom, CoreId 17, Type aic]
    * thread #1, name = 'matmul_leakyrel', stop reason = breakpoint 1.1
        frame #0: 0x0000000000008f88 device_debugdata`_ZN7AscendC7BarrierEv_mix_aic at kfc_comm.h:39
       36
       37   namespace AscendC {
       38   __aicore__ inline void Barrier()
    -> 39   {
       40   #if defined(__CCE_KT_TEST__) && __CCE_KT_TEST__ == 1
       41       __asm__ __volatile__("" ::: "memory");
       42   #else
    
    After the switchover is complete, query the core information again. You can see that the core is switched to the line where the new core ID is located.
    1
    2
    3
    4
    5
    (msdebug) ascend info cores
      CoreId  Type  Device Stream Task Block         PC               stop reason
    *  17     aic      1     3     0     0     0x12c0c00f1f88         breakpoint 1.1
        2     aiv      1     3     0     0     0x12c0c00f8fbc         breakpoint 1.1
        3     aiv      1     3     0     0     0x12c0c00f8d3c         breakpoint 1.1