已合并
池化类算子proto新增宏隔离 #8435
池化类算子proto新增宏隔离 #8435
已合并
小王!创建于 19 天前
小王!
小王!成员
19 天前

描述

池化类算子proto新增宏隔离

关联的Issue

https://gitcode.com/cann/ops-nn/issues/4729

测试

本地采用xrun工具验证图模式,无异常,冒烟已通过

文档更新

类型标签

AI/Agent生成声明

likedislike
Pull Request已成功合入, 合并人@CANN-robot
(感谢 小王! 的贡献)
小王!小王!成员
19 天前 创建了 pull request,commit 08be9281
atomgit-bot
atomgit-bot
19 天前 评论:

变更摘要

此 PR 为 9 个 pooling 相关的算子 proto 头文件中的 REG_OP 注册调用添加了 OPS_PROTO_DEF_* 宏守卫(#ifndef/#define/#endif),使得这些算子的编译注册可通过预定义宏进行条件控制。每个宏名称与对应的算子名一一对应,遵循统一的 OPS_PROTO_DEF_<OPNAME> 命名规范。

主要改动

  • REG_OP 调用添加条件编译守卫:在 9 个 pooling proto 头文件中,使用 #ifndef OPS_PROTO_DEF_* / #define OPS_PROTO_DEF_* / #endif 包裹 REG_OP(...) 算子注册调用,允许外部在包含头文件前通过定义对应宏来跳过特定算子的注册编译。
  • 覆盖的算子:包括 AdaptiveAvgPool2dAdaptiveAvgPool2dGradAvgPoolGradAvgPoolV2GradMaxPool3DGradMaxPoolGradWithArgmaxV1MaxPoolWithArgmaxV1MaxPoolGradMaxPool 共 9 个 pooling 算子及其梯度算子。
  • 改动模式一致:所有 9 个文件的改动方式完全一致——仅在 REG_OP(...) 调用前后插入宏守卫,不修改任何算子定义逻辑、输入输出参数或属性配置。
likedislike
atomgit-bot
atomgit-bot
19 天前 评论:

代码审查

✅ 未发现问题

likedislike
CANN-robotCANN-robot成员
19 天前 添加了label:cann-cla/yes
CANN-robot
CANN-robot成员
19 天前 评论:

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


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)

💡 Tip:

  • Committer can comment /approve or /lgtm
  • Commenting /approve implies both code review (lgtm) and intent to merge (approve)

CLA Signature Pass

qq_52056150, thanks for your pull request. All authors of the commits have signed the CLA. 👍

likedislike
CANN-robotCANN-robot成员
19 天前 将zengjuan,chaotang233,crystalhu,yangyang016,fanqirui,tang-lei01,chenqi317,liubo75,tangweiwei2,pingchuantang,wangyongguang设为评审人
CANN-robotCANN-robot成员
19 天前 将tang-lei01,wangyongguang设为审查人
小王!
小王!成员
19 天前 评论:

compile

likedislike
小王!小王!成员
19 天前 update merge request[project id: 7665709, iid: 8435, commit_id: 313406379ddad3d8f058f4070df492a68bc7fde7] virtual merging success
CANN-robotCANN-robot成员
19 天前 添加了label:ci-pipeline-running
CANN-robot
CANN-robot成员
19 天前 评论:

流水线任务触发成功
任务链接 [8b135b50c04e456ab79fffcbf21d15bf][流水线指导]

任务名称状态日志下载链接
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 ✅ SUCCESS >>>>>
PreSmoke_ATK_Test_A2 ✅ SUCCESS >>>>>
UT_Test_harmony-infer-chs-nn ✅ SUCCESS
UT_Test_harmony-infer-chs-nn-1 ✅ SUCCESS
UT_Test_harmony-infer-cpro-nn ✅ SUCCESS
UT_Test_report_lcov ⚠️ WARNING >>>>>

[2026-08-08 12:23:23]    CI执行结束

likedislike
CANN-robot
CANN-robot成员
19 天前 评论:

流水线任务触发成功
任务链接 [6713eb558987442fb5f1be7eef876724][流水线指导]

任务名称状态日志下载链接
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 ❌ FAILED >>>>> >>>>>
SCA ✅ SUCCESS >>>>>
likedislike
CANN-robotCANN-robot成员
19 天前 添加了label:api-check-pass
此处折叠了6条事件消息 查看更多
CANN-robotCANN-robot成员
19 天前 添加了label:cann-cla/yes
小王!
小王!成员
19 天前 评论:

compile

likedislike
小王!小王!成员
19 天前 update merge request[project id: 7665709, iid: 8435, commit_id: b5bb3a514a27e68bd45d2689582fadc3a89669fe] virtual merging success
CANN-robotCANN-robot成员
19 天前 删除了label:ci-pipeline-failedapi-check-pass
CANN-robotCANN-robot成员
19 天前 添加了label:ci-pipeline-running
CANN-robot
CANN-robot成员
19 天前 评论:

流水线任务触发成功
任务链接 [1bacc05ce24e4092a8e32b5673d0b0b6][流水线指导]

任务名称状态日志下载链接
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 ✅ SUCCESS >>>>>
PreSmoke_ATK_Test_A2 ✅ SUCCESS >>>>>
UT_Test_harmony-infer-chs-nn ✅ SUCCESS
UT_Test_harmony-infer-chs-nn-1 ✅ SUCCESS
UT_Test_harmony-infer-cpro-nn ✅ SUCCESS
UT_Test_report_lcov ⚠️ WARNING >>>>>

[2026-08-08 14:39:14]    CI执行结束

likedislike
CANN-robot
CANN-robot成员
19 天前 评论:

流水线任务触发成功
任务链接 [99817adc0b4c4745920ffaa185653ddf][流水线指导]

任务名称状态日志下载链接
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-08 14:20:55]    CI执行结束

likedislike
CANN-robotCANN-robot成员
19 天前 添加了label:api-check-pass
CANN-robotCANN-robot成员
19 天前 删除了label:ci-pipeline-running
CANN-robotCANN-robot成员
19 天前 添加了label:ci-pipeline-passed
小王!小王!成员
15 天前 修改标题为 “池化类算子proto新增宏隔离”,原标题为“Add OPS_PROTO_DEF_* macro guards to 9 pooling proto files”
小王!小王!成员
15 天前 修改了pull request 的描述
小王!小王!成员
15 天前 修改了pull request 的描述
wangyongguang成员
15 天前 评论:

/approve

likedislike
CANN-robotCANN-robot成员
15 天前 添加了label:approved
wangyongguang成员
15 天前 评论:

/approve

likedislike
tangweiwei2成员
15 天前 评论:

/lgtm
/approve

likedislike
CANN-robotCANN-robot成员
15 天前 添加了label:lgtm
CANN-robotCANN-robot成员
15 天前 删除了label:ci-pipeline-passed
CANN-robot
CANN-robot成员
15 天前 评论:

The following label is not ready.

ci-pipeline-passed: The ci-pipeline-passed label is expired. Please compile again.

likedislike
小王!
小王!成员
15 天前 评论:

compile

likedislike
小王!小王!成员
15 天前 update merge request[project id: 7665709, iid: 8435, commit_id: a7a6c2d414a0829a2bf0f1dcff0754d5c8806ed8] virtual merging success
CANN-robotCANN-robot成员
15 天前 删除了label:api-check-pass
CANN-robotCANN-robot成员
15 天前 添加了label:ci-pipeline-running
CANN-robot
CANN-robot成员
15 天前 评论:

流水线任务触发成功
任务链接 [076cb0ddf5174860ab08c456a8acfd49][流水线指导]

任务名称状态日志下载链接
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 ✅ SUCCESS >>>>>
PreSmoke_ATK_Test_A2 ✅ SUCCESS >>>>>
UT_Test_harmony-infer-chs-nn ✅ SUCCESS
UT_Test_harmony-infer-chs-nn-1 ✅ SUCCESS
UT_Test_harmony-infer-cpro-nn ✅ SUCCESS
UT_Test_report_lcov ⚠️ WARNING >>>>>

[2026-08-12 10:20:10]    CI执行结束

likedislike
CANN-robot
CANN-robot成员
15 天前 评论:

流水线任务触发成功
任务链接 [fbe0132ae7164994a1d335f10454a998][流水线指导]

任务名称状态日志下载链接
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-12 09:55:17]    CI执行结束

likedislike
CANN-robotCANN-robot成员
15 天前 添加了label:api-check-pass
CANN-robotCANN-robot成员
15 天前 删除了label:ci-pipeline-running
CANN-robotCANN-robot成员
15 天前 添加了label:ci-pipeline-passed
CANN-robotCANN-robot成员
15 天前 关闭了关联的issue
CANN-robotCANN-robot成员
15 天前 合入了pull request