| update aicpu op tile register func to v2.
Co-authored-by: liu-wei<lovline.liuwei@huawei.com>
# message auto-generated for no-merge-commit merge:
!2844 merge master into master
update aicpu op tile register func to v2.
Created-by: liu-wei
Commit-by: liu-wei
Merged-by: cann-robot
Description: ## 描述
本 PR 调整 Tile AICPU kernel 的注册方式,补充 host constant folding 场景下的 V2 注册兼容封装。
主要改动如下:
- 新增 common/inc/aicpu/math_aicpu_register.h,封装 OPS_MATH_REGISTER_CPU_KERNELV2 注册宏。
- math/tile/op_kernel_aicpu/tile_aicpu.cpp 改为通过封装宏注册 Tile AICPU kernel。
- host constant folding 编译目标增加 OPS_MATH_AICPU_HOST_KERNEL 宏;该路径在 host 库存在 RegistCpuKernelV2 时注册到 V2,旧版本 libaicpu_context_host.a 不提供 V2 注册符号时注册到 V1。
- 非 host AICPU 编译路径继续展开为原 REGISTER_CPU_KERNEL,保持 device/custom AICPU 注册行为不变。
- AICPU_INCLUDE 补充 ${OPS_MATH_DIR}/common/inc,保证新增公共头文件可被 AICPU 编译目标引用。
改动目的:
- 支持 Tile 在 host constant folding 产物中优先接入 V2 注册能力,配合新版 opbase的“V2 优先、V1 兜底”调度逻辑:Tile 若成功注册到 V2,则运行时命中 V2;未注册到 V2 时仍走 V1。
- 兼容新旧 AICPU host context 库:当 host 库存在 RegistCpuKernelV2 时注册到 V2;旧库缺少该符号时注册到 V1,配合 opbase 的 V1 兜底路径保持可运行。
## 关联的Issue
关联Issue #1634:https://gitcode.com/cann/ops-math/issues/1634
## 测试
- 已执行静态 diff 检查:git diff --check 7fac2495 96de8df2,结果通过。
- 已检查变更范围和引用关系:
- aicpu/math_aicpu_register.h 可通过新增的 AICPU_INCLUDE 被 AICPU 目标引用。
- Tile AICPU 源码仅调整注册入口,未改动参数校验、数据类型分发、广播计算和并行拷贝逻辑。
- host constant folding 路径通过 OPS_MATH_AICPU_HOST_KERNEL 触发 V2 优先注册逻辑。
- 已结合 opbase 注册/调度逻辑检查:新版 opbase 通过 IsRegisteredV2 判断是否走 V2 路径;V2 查询未命中时由调度层选择 V1 路径,RunCpuKernelV2 内部不再回退 V1。
- 未在本地执行完整 CMake 配置和编译验证,需结合 CI 流水线继续确认 host constant folding 产物链接结果。
## 文档更新
无文档更新。
## 类型标签
<!-- [x] 表示选中 -->
- [ ] Bug修复
- [ ] 新特性
- [ ] 性能优化
- [ ] 文档更新
- [x] 其他,请描述:AICPU Tile 注册兼容逻辑调整
See merge request: cann/ops-math!2844 | 13 天前 |