合并受阻
变更摘要
本 PR 修复 AcosGrad、AsinGrad 两个算子在 arch35 架构下的共性问题,将 dtype 编码方式从 TilingKey 模板参数改为 def 驱动模式:dtype 由 def.cpp 的 DataType 列表驱动,构建系统注入 DTYPE_Y 编译宏,kernel 直接使用 DTYPE_Y 获取实际类型,TilingKey 不再重复编码 dtype。同时补齐了 arch35 子目录下缺失的 tiling_key.h 最新版本,并修复 AsinGrad tiling 函数缺少 ASCENDC_TPL_SEL_PARAM 调用的问题,使算子在 Ascend950 (arch35) 上能够正确构建。改动后两个算子的编译变体从 6 个(3 dtype × 2 buffer_mode)减少到 3 个(dtype 由 def 驱动)。
主要改动
- tiling_key 移除 dtype 模板参数:
acos_grad_tiling_key.h删除ASCENDC_TPL_DATATYPE_DECL(D_T, ...)及相关ASCENDC_TPL_SEL选择列表,asin_grad_tiling_key.h同样移除D_T声明与三个 dtype 分支,仅保留BUFFER_MODE作为 TilingKey 编码项。 - tiling 函数仅编码 BUFFER_MODE:
asin_grad_tiling_arch35.cpp中ASCENDC_TPL_SEL_PARAM(context, dType, useDoubleBuffer)改为ASCENDC_TPL_SEL_PARAM(context, useDoubleBuffer),acos_grad_tiling_arch35.cpp删除两处ASCENDC_TPL_SEL_PARAM(context, dTypeX)调用,TilingKey 不再编码 dtype。 - kernel 改用
DTYPE_Y宏:acos_grad_apt.cpp移除模板参数D_T,以NsAcosGrad::KernelAcosGrad<DTYPE_Y>实例化;asin_grad.cpp中AsinGrad<D_T, float, BUFFER_MODE>改为AsinGrad<DTYPE_Y, float, BUFFER_MODE>,实际类型由构建系统注入的DTYPE_Y宏提供。


Thanks for your pull-request.
The full list of commands accepted by me can be found at here.
You can get sig-info at here.
You can self-configure the PR merge rules for this repository. For more details, please refer to Here.
For more, you also can visit HICANN.
PR Approval Progress
✅ Congratulations! All modules have met the lgtm and approve requirements.
Module Approval Details
| module | lgtm status | approve status |
|---|---|---|
| repo-cann/ops-math | ✅ 周奇龙, andong_hw (2/2) | ✅ 周奇龙, andong_hw (2/1) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)
CLA Signature Pass
ZJYzjy-shine, thanks for your pull request. All authors of the commits have signed the CLA. 👍


已基于本 PR 实际 head rebase 到最新 master,并完成 math/acos_grad/op_host/arch35/acos_grad_tiling_arch35.cpp 超 50 行函数整改;替代 PR:#5268 https://gitcode.com/cann/ops-math/pull/5268


描述
AcosGrad、AsinGrad 算子共性问题修改
AcosGrad 和 AsinGrad 两个算子缺少 arch35 子目录下的 tiling_key.h、tiling_data.h、kernel 头文件及源文件的最新版本,导致:
本次改动补充了 arch35 子目录下的完整源码,采用 def 驱动 dtype 设计:
改动后 AsinGrad 编译变体从 6 个(3 dtype × 2 buffer_mode)减少到 3 个(dtype 由 def 驱动),AcosGrad 同理。
关联的Issue
https://gitcode.com/cann/ops-math/issues/2735
文档更新
无
类型标签