昇腾社区首页
中文
注册

核切换

参考以下操作可将当前聚焦的核切换至指定的核,切核后会展示指定核所处中断的代码位置。

  • 如果当前运行的核为aiv的“core 1”,指定切换的核为aiv的“core 2”
    (msdebug) ascend aiv 2
    [Switching to focus on Kernel add_custom, CoreId 2, Type aiv]
    * thread #1, name = 'add_custom_npu', stop reason = breakpoint 1.1
        frame #0: 0x000000000000380c device_debugdata`::add_custom(uint8_t *__restrict, uint8_t *__restrict, uint8_t *__restrict) [inlined] KernelAdd::CopyOut(this=0x000000000016e9b8, progress=0) at add_custom.cpp:85:9
       82  	        // copy progress_th tile from local tensor to global tensor
       83  	        DataCopy(zGm[progress * TILE_LENGTH], zLocal, TILE_LENGTH);
       84  	        // free output tensor for reuse
    -> 85  	        outQueueZ.FreeTensor(zLocal);
       86  	    }
       87  	
       88  	private:
    完成切换后,再次查询核信息可看到已切换至新指定的核id所在行。
    (msdebug) ascend info cores
      CoreId  Type  Device Stream Task Block         PC               Exception
        1     aiv      1     3     0     0     0x1240c001a80c         f0000000
    *   2     aiv      1     3     0     1     0x1240c001a80c         f0000000
    
    (msdebug)
  • 如果当前运行的核为aiv的“core 5”,指定切换的核为aic的“core 4”
    (msdebug) ascend aic 4
    [Switching to focus on Kernel _Z23matmul_leakyrelu_customPhS_S_S_S_S_S_, CoreId 4, Type aic]
    * thread #1, name = 'npu_ok', stop reason = breakpoint 1.1
        frame #0: 0x0000000000006ba4 device_debugdata`_Z23matmul_leakyrelu_customPhS_S_S_S_S_S__mix_aic at kernel_rpc.h:59:19
       56               rpcCommSrv[i].eventIDMmProcesss = eventIDMmProcesss;
       57           }
       58           SetFlag<HardEvent::MTE3_MTE2>((event_t)eventIDMmCnt);
    -> 59           SetFlag<HardEvent::MTE3_MTE2>((event_t)eventIDMmProcesss);
       60       }
       61
       62       __aicore__ inline void InitNormal(GM_ADDR workspaceGM, int32_t quitSizeReserved)
    完成切换后,再次查询核信息可看到已切换至新指定的核id所在行。
    (msdebug) ascend info cores
      CoreId  Type  Device Stream Task Block         PC               Exception
    *   4     aic      0     105     0     0     0x1240c00f0c04         f0000000
        4     aiv      0     105     0     0     0x1240c012117c         f0000000
        5     aiv      0     105     0     0     0x1240c01201fc         f0000000