Pull Request已成功合入, 合并人@CANN-robot
(感谢 胡一航 的贡献)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 |
|---|---|---|
| pooling | ✅ 刘闯, 范其瑞 (2/2) | ✅ 刘闯 (1/1) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)
CLA Signature Pass
huyihang1117, thanks for your pull request. All authors of the commits have signed the CLA. 👍


流水线任务触发成功
任务链接 [9bafe78e0a1e4b3090ede9967928ffb9][流水线指导]
| 任务名称 | 状态 | 日志 | 下载链接 |
|---|---|---|---|
| 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_X86_monitor_910b | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_X86_monitor_910c | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_X86_monitor_950 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_harmony-infer-chs-nn | ✅ SUCCESS | >>>>> | |
| UT_Test_ophost | ✅ SUCCESS | ||
| UT_Test_opapi | ✅ SUCCESS | ||
| UT_Test_kernel | ✅ SUCCESS | ||
| UT_Test_opgraph | ✅ SUCCESS | ||
| PreSmoke_A900 | ✅ SUCCESS | >>>>> | |
| PreSmoke_ATK_Test_A2 | ✅ SUCCESS | >>>>> |
[2026-06-30 19:18:20] CI执行结束


变更摘要
此PR修复了 AdaptiveMaxPool3dGrad 算子在 Ascend A5 平台上的性能问题。主要改动是优化 AdaptiveMaxPool3dGradTilingSimt::PostTiling() 中的 blockNum 计算逻辑:移除了对线程数的硬编码上限 MAX_THREAD_NUM(1024),使得输出数据量较小的场景也能充分利用更多计算核,从而提升性能。
主要改动
- 移除
MAX_THREAD_NUM常量:删除了static constexpr int64_t MAX_THREAD_NUM = 1024,不再将线程数硬性限制在1024以内,避免小规模输出任务无法充分利用硬件资源。 - 重构
blockNum计算逻辑:将原来threads = min(outDataCount, MAX_THREAD_NUM)再CeilDiv的方式,改为blockNum = (outDataCount == 0) ? 1 : min(outDataCount, coreNum_),使小输出点的case尽可能使用与输出数据量相等的 block 数(以coreNum_为上限)。 - 调整
blockNum钳位顺序:将std::max与std::min的调用顺序对调——先以coreNum_为上限截断,再以1为下限截断,确保边界语义一致。


流水线任务触发成功
任务链接 [314afb5be5174217bbe1fbc513baf2ac][流水线指导]
| 任务名称 | 状态 | 日志 | 下载链接 |
|---|---|---|---|
| codecheck | ✅ SUCCESS | >>>>> | |
| antipoison | ✅ SUCCESS | >>>>> | |
| codecheck_checkpr | ✅ SUCCESS | ||
| StaticCheck_codespell_check | ✅ SUCCESS | ||
| StaticCheck_link_validity_check | ✅ SUCCESS | ||
| StaticCheck_resource_existence_check | ✅ SUCCESS | ||
| StaticCheck_tag_closed_check | ✅ SUCCESS | ||
| StaticCheck_markdownlint | ✅ SUCCESS | ||
| codecheck_style | ✅ SUCCESS | >>>>> | |
| codecheck_precommit | ⚠️ WARNING | >>>>> | >>>>> |
| SCA | ✅ SUCCESS | >>>>> |
[2026-06-30 19:13:46] CI执行结束


代码审查
结束总结
| 优先级 | 数量 |
|---|---|
| P0 | 0 |
| P1 | 0 |
| P2 | 0 |
| P3 | 1 |
已审查文件:pooling/adaptive_max_pool3d_grad/op_host/adaptive_max_pool3d_grad_simt_tiling.cpp — 发现1个P3级别的冗余操作(非确定性分支中 blockNum 已由第53行限制在 coreNum_ 以内,第55行重复进行了相同的上限约束)。
整体风险评估:该变更风险较低。核心变更是将非确定性分支中 blockNum 的计算方式从 CeilDiv(outDataCount, min(outDataCount, 1024)) 改为 min(outDataCount, coreNum_),并正确处理了 outDataCount == 0 的边界情况(旧代码在输入为0时 CeilDiv(0, 0) 会触发除零)。min/max 约束顺序的互换在语义上是等价的(coreNum_ ≥ 1 由基类保证)。该变更符合PR描述中"对输出点小的用例尽可能使用更多核心"的性能优化目标。
⚠️ 已识别出整体风险,但无法提取行内评论,请参考整体评估。


/lgtm
/approve


The following users do not have permission to comment /lgtm or /approve on any module in this PR:
唐燕峰


The following users do not have permission to comment /lgtm or /approve on any module in this PR:
唐燕峰


/lgtm
/approve


The following users do not have permission to comment /lgtm or /approve on any module in this PR:
唐燕峰


The following users do not have permission to comment /lgtm or /approve on any module in this PR:
唐燕峰


/approve


The following users do not have permission to comment /lgtm or /approve on any module in this PR:
唐燕峰


描述
adaptivemaxpool3dgradxA5上性能问题修复,对于输出点小的case也尽可能的使用更多的核
关联的Issue
https://gitcode.com/cann/ops-nn/issues/3724
测试
atk
文档更新
类型标签
AI/Agent生成声明