Pull Request已成功合入, 合并人@CANN-robot
(感谢 zhongheng 的贡献)变更摘要
本 PR 主要修复 ops-transfer-test-scan 检查发现的转测准入问题:一是将 Relu6D 从基于 TilingKey 的 dtype 分发改为 def 驱动 dtype,二是通过统一宏保护修复 Relu6D 与 SmoothL1LossGrad 算子原型的重复定义问题。改动涉及 Relu6D 的 tiling、kernel 入口、proto 定义及对应 Host/Kernel 单元测试,并同步更新了公共扩展头。
主要改动
- Relu6D 改为 def 驱动 dtype:在
relu6_d.cpp中移除核函数模板参数D_T_X,入口改为使用DTYPE_X直接实例化KernelRelu6D<DTYPE_X>,使 dtype 由 def 配置驱动。 - 移除 TilingKey dtype 分发并固定 tiling key:在
relu6_d_tiling_arch35.cpp中删除dTypeX及ASCENDC_TPL_SEL_PARAM调用,统一通过context->SetTilingKey(0)设置固定 tiling key;同时relu6_d_tiling_key.h删除ASCENDC_TPL_ARGS_DECL、ASCENDC_TPL_SEL等模板参数声明,不再声明 dtype 维度。 - 新增算子原型防重复定义宏:在
relu6_d_proto.h中以OPS_PROTO_DEF_RELU6D保护REG_OP(Relu6D),在smooth_l1_loss_grad_proto.h与op_nn_proto_extend.h中以OPS_PROTO_DEF_SMOOTHL1LOSSGRAD保护REG_OP(SmoothL1LossGrad),避免多份 proto 合并时重复展开同名定义。 - 同步更新 Host/Kernel 单元测试:
test_relu6_d_tiling.cpp在 tiling 成功后新增GetTilingKey() == 0U断言;test_relu6_d.cpp移除ICPU_SET_TILING_KEY(...)调用及__RELU6_D_TILING_KEY_H__宏定义,使测试逻辑与 def 驱动 dtype 的实现一致。


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.
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 |
|---|---|---|
| */*/op_graph/*_proto.h | ✅ 汤磊, 唐玮玮 (2/2) | ✅ 汤磊 (1/1) |
| */*/op_graph/*_proto_extend.h | ✅ 汤磊, 唐玮玮 (2/2) | ✅ 汤磊 (1/1) |
| activation | ✅ 唐玮玮, 王星 (2/2) | ✅ 王星 (1/1) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)
CLA Signature Pass
zhongheng, thanks for your pull request. All authors of the commits have signed the CLA. 👍


流水线任务触发成功
任务链接 [026e91feb8604677a5f6b9d5a3ce5fa5][流水线指导]
| 任务名称 | 状态 | 日志 | 下载链接 |
|---|---|---|---|
| Compile_Ascend_X86_ubuntu24 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_X86_mobile_station | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_ARM | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_single | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_experimental | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_X86_950 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_ARM_950 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Pre | ✅ SUCCESS | >>>>> | |
| pre_comment | ✅ SUCCESS | >>>>> | |
| Compile_Ascend_X86 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_X86_mobile_station_ubuntu24 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_X86_950_ubuntu24 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_ARM_ubuntu24 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_single_ubuntu24 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_experimental_ubuntu24 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_ARM_950_ubuntu24 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_X86_monitor_910b | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_X86_monitor_910c | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_X86_monitor_950 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_classify | ✅ SUCCESS | >>>>> | |
| Compile_Ascend_X86_mobile_station_9030_ubuntu24 | ✅ SUCCESS | >>>>> | >>>>> |
| UT_Test_ophost | ✅ SUCCESS | ||
| UT_Test_opapi | ✅ SUCCESS | ||
| UT_Test_kernel | ✅ SUCCESS | ||
| UT_Test_opgraph | ✅ SUCCESS | ||
| PreSmoke_A900 | ✅ SUCCESS | >>>>> | |
| API_Check | ⚠️ WARNING | >>>>> | |
| PreSmoke_ATK_Test_A2 | ✅ SUCCESS | >>>>> | |
| UT_Test_report_lcov | ✅ SUCCESS | >>>>> |
[2026-08-13 17:12:57] CI执行结束


流水线任务触发成功
任务链接 [5ed28ff97e8b4bfc9bb394de09bff79a][流水线指导]
| 任务名称 | 状态 | 日志 | 下载链接 |
|---|---|---|---|
| antipoison | ✅ SUCCESS | >>>>> | |
| codecheck_checkpr | ✅ SUCCESS | ||
| StaticCheck_codespell | ✅ SUCCESS | ||
| StaticCheck_link_validity | ✅ SUCCESS | ||
| StaticCheck_resource_existence | ✅ SUCCESS | ||
| StaticCheck_tag_closed | ✅ SUCCESS | ||
| StaticCheck_markdownlint | ✅ SUCCESS | ||
| codecheck_precommit | ✅ SUCCESS | >>>>> | |
| SCA | ✅ SUCCESS | >>>>> |
[2026-08-13 16:57:18] CI执行结束


/approve


/lgtm
/approve


/lgtm
/approve


The following label is not ready.
ci-pipeline-passed: The ci-pipeline-passed label is expired as added over 72 hours. Please use /compile to recompile.


流水线任务触发成功
任务链接 [9cb34355e20d4baaa4196fa5ad7ce96c][流水线指导]
| 任务名称 | 状态 | 日志 | 下载链接 |
|---|---|---|---|
| Compile_Ascend_X86_ubuntu24 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_X86_mobile_station | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_ARM | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_single | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_experimental | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_X86_950 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_ARM_950 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Pre | ✅ SUCCESS | >>>>> | |
| pre_comment | ✅ SUCCESS | >>>>> | |
| Compile_Ascend_X86 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_X86_mobile_station_ubuntu24 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_X86_950_ubuntu24 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_ARM_ubuntu24 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_single_ubuntu24 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_experimental_ubuntu24 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_ARM_950_ubuntu24 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_X86_monitor_910b | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_X86_monitor_910c | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_X86_monitor_950 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_classify | ✅ SUCCESS | >>>>> | |
| Compile_Ascend_X86_mobile_station_9030_ubuntu24 | ✅ SUCCESS | >>>>> | >>>>> |
| UT_Test_ophost | ✅ SUCCESS | ||
| UT_Test_opapi | ✅ SUCCESS | ||
| UT_Test_kernel | ✅ SUCCESS | ||
| UT_Test_opgraph | ✅ SUCCESS | ||
| PreSmoke_A900 | ✅ SUCCESS | >>>>> | |
| API_Check | ⚠️ WARNING | >>>>> | |
| PreSmoke_ATK_Test_A2 | ✅ SUCCESS | >>>>> | |
| UT_Test_report_lcov | ✅ SUCCESS | >>>>> |
[2026-08-18 10:02:49] CI执行结束


流水线任务触发成功
任务链接 [ed27bc5e8d304b07a07c823715ff44de][流水线指导]
| 任务名称 | 状态 | 日志 | 下载链接 |
|---|---|---|---|
| antipoison | ✅ SUCCESS | >>>>> | |
| codecheck_checkpr | ✅ SUCCESS | ||
| StaticCheck_codespell | ✅ SUCCESS | ||
| StaticCheck_link_validity | ✅ SUCCESS | ||
| StaticCheck_resource_existence | ✅ SUCCESS | ||
| StaticCheck_tag_closed | ✅ SUCCESS | ||
| StaticCheck_markdownlint | ✅ SUCCESS | ||
| codecheck_precommit | ✅ SUCCESS | >>>>> | |
| SCA | ✅ SUCCESS | >>>>> |
[2026-08-18 09:49:06] CI执行结束


描述
本 PR 修复 ops-transfer-test-scan 检查发现的以下转测准入问题:
DTYPE_X实例化KernelRelu6D<DTYPE_X>。修复后,FP16、FP32、INT32、BF16 四种类型均可通过 def 配置生成并完成正式二进制编译。
参考 PR 8552 的处理方式,不删除已有
REG_OP定义,而是增加统一的宏保护:OPS_PROTO_DEF_RELU6DOPS_PROTO_DEF_SMOOTHL1LOSSGRAD宏保护已添加至对应算子 proto 及公共扩展头,避免多份 proto 合并或共同包含时重复展开同名算子定义。
关联的Issue
https://gitcode.com/cann/ops-nn/issues/4780
测试
完成以下验证:
Relu6D Host/Proto UT
Relu6D Kernel UT
Proto 合并及编译
Relu6D 正式二进制编译
[SUCCESS] Build binary success!冒烟已过
代码检查
git diff --check通过。文档更新
类型标签
AI/Agent生成声明