Closed
[Requirement|需求建议]: aclnn 手写框架支持按算子级上报 profiling #532
ren-botaoAdd on Oct 19Closed at Oct 20
Oct 19 Added label: requirement
ren-botao
Oct 19 Comments:
Oct 19 Comments:
/assign @ren-botao


Oct 19 Assign ren-botao as responsible person
Oct 19 Modify description of issue
Oct 20 Close issue
Oct 20 Added label: resolved
Oct 20 Associated pull request
Background(背景信息)
aclnn 手写框架需要支持按算子级(opType)控制 profiling 上报。原实现中 tiling、kernel launch、addition info、cache 上报等路径只受全局 profiling 开关控制,无法按算子粒度筛选采集与上报。
本次引入算子级 profiling 开关状态与查询接口:通过 ProfilingCallBack 依据 PROF_OP_MASK 更新总开关,依赖弱符号 MsprofCheckOpSwitch 判断具体算子是否命中配置;同时把 opType 贯通到 kernel launch 配置与 cache 结构,并在 rts_arg 中按需下发 ACL_RT_LAUNCH_KERNEL_ATTR_ENABLE_PROFILING 属性。此外,将版本相关宏从 op_feature.cpp 上移到 op_feature_internal.h,新增 NNOPBASE_RUNTIME_VERSION_SUPPORT_OP_PROFILING 等编译期开关。
Origin(信息来源)
维测工具模块内部需求
Benefit / Necessity(价值/作用)
支持按算子粒度控制 profiling 的采集与上报,避免全局开启 profiling 时对所有算子无差别采集;tiling、kernel launch、addition info、cache 回放等路径仅在算子命中配置时上报,可降低 profiling 开销与数据量。
同时通过弱符号加编译期版本宏的方式兼容旧版本 msprof/runtime:符号不存在或运行时版本低于 9.2.0 时安全降级,不阻断正常执行。
Design(设计方案)
关联 PR:https://gitcode.com/cann/opbase/pull/934