Closed
[Task|任务跟踪]: Remove DeviceRunner class and redistribute init flow to KernelBinary/HostProf/DevicePerf/DeviceLauncher #2967
wan_jianfenAdd on  Aug 13Closed at  Aug 14
wan_jianfen
wan_jianfenCollaborators
Aug 13 Create

任务描述

当前 DeviceRunner 类作为单例承担了过多职责:设备初始化、HostProf 管理、DevicePerf 管理、Stream 同步、AiCpu .so 加载等。需要将其拆解并清除,将各职责归还到对应的模块中。

任务目标

  1. Init 流程 → 移入 KernelBinary(EnsureInitialized / InitMetaData / GetEnableDumpDevPref / InitDeviceArgs / InitDeviceArgsCore / GetAicoreRegs / InitAiCpuSoBin / SetAiCpuSoOverride)
  2. HostProf 相关(SetHostProfFunction / GetHostProfType / ReportHostProfInfo)→ 移入 HostProf::GetInstance() 单例
  3. DevicePerf 相关(ResetPerData / SyncProfData / SetDebugEnable)→ 移入 DevicePerf::GetInstance() 单例
  4. DynamicLaunchSynchronize → 移入 DeviceLauncher::DynamicLaunchSynchronize
  5. KernelLaunchInfo 结构体 → 移入 device_launcher_types.h
  6. 删除 device_runner.h 和 device_runner.cpp
  7. 更新所有调用方(device_launcher.cpp、kernel_bundle_launch.cpp、pypto_bundle_api.cpp、test_dev_func_runner.h、UT 文件等)

变更范围

文件 变更
device_runner.h / .cpp 删除
kernel_binary.h / .cpp 新增 EnsureInitialized / InitMetaData / GetEnableDumpDevPref,移入 init 流程
host_prof.h / .cpp 新增 GetInstance / GetHostProfType / ReportHostProfInfo
device_perf.h / .cpp 新增 GetInstance
device_launcher.h / .cpp 新增 DynamicLaunchSynchronize / InitDevArgs,更新所有调用
device_launcher_types.h 移入 KernelLaunchInfo
kernel_bundle_launch.cpp 更新调用
pypto_bundle_api.cpp 更新 SetAiCpuSoOverride 调用
CMakeLists.txt 移除 device_runner.h 安装项
UT / ST 文件 更新调用
likedislike
wan_jianfenwan_jianfenCollaborators
Aug 13 Associated pull request
wan_jianfenwan_jianfenCollaborators
Aug 13 Assign wan_jianfen as responsible person
wan_jianfen
wan_jianfenCollaborators
Aug 13 Comments:

开发中

likedislike
CANN-robotCANN-robotCollaborators
Aug 14 Close issue
CANN-robotCANN-robotCollaborators
Aug 14 Added label: resolved