Merged
CombinedNMS性能优化 #1712
wuxiyuanAdd on Sep 20
CombinedNMS性能优化 #1712
Merged
wuxiyuanAdd on Sep 20
wuxiyuan
wuxiyuanCollaborators
Sep 20

描述

对 CombinedNonMaxSuppression(Ascend950 / arch35 SIMT 实现)做性能优化,不改变计算语义,输出与基线一致。

  1. warp 两级归约替代共享内存树形归约:新增 WarpArgMax(asc_shfl_down 寄存器内归约)与 BlockArgMax(仅各 warp 胜者跨 UB),三处热点循环统一替换;单次归约从 11 次块同步(1024 线程)降为 2 次,保持 (score, index) 全序与确定性 tie-break,结果不变。
  2. UB 热路径扩容 4096 → 8704(tiling 与 kernel 同步):8704 box 热数据 ≈178.5KB,加固定 buffer 仍在 TPipe 可用 UB 内;4097~8704 的输入切回 UB 热路径,fallback 行为不变。
  3. staging 按 score_threshold 过滤:不达阈值(含 NaN)的 box 不再搬运坐标,suppressed 初始化谓词与选择循环一致。
  4. 跳过末轮 IoU 抑制扫描:最后一个输出后直接 break,省一次 O(numBoxes) 扫描。
  5. tiling 封顶 maxPerClass = min(maxPerClass, numBoxes, outputSize):缩小 workspace 与每任务 MTE3 写回量,其余 tiling 字段不变。
文件 改动量
op_host/arch35/combined_non_max_suppression_tiling.cpp +5/−1
op_kernel/arch35/combined_non_max_suppression_simt.h +63/−40
tests/ut/op_host/arch35/test_combined_non_max_suppression_tiling.cpp +19/−0

关联的Issue

https://gitcode.com/cann/ops-cv/issues/1007

测试

文档更新

无需更新。

类型标签

likedislike
Pull Request has been successfully merged by CANN-robot.
(Thank you for wuxiyuan's contribution.)
wuxiyuanwuxiyuanCollaborators
Sep 20 Created pull request, commit d50cb775
CANN-robotCANN-robotCollaborators
Sep 20 Added label: cann-cla/yes
CANN-robot
CANN-robotCollaborators
Sep 20 Comments:

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-cv ✅ 汤平川, yue-ma (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

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

likedislike
CANN-robotCANN-robotCollaborators
Sep 20 Set yue-ma,zhou-qilong,rxtfeng,loov1,zhangzijie,yourealize,zl_hw,liu-wei,pingchuantang,llimwang,gubaocheng as approver
CANN-robotCANN-robotCollaborators
Sep 20 Set yue-ma,zhou-qilong,rxtfeng,loov1,zhangzijie,yourealize,zl_hw,liu-wei,pingchuantang,llimwang,gubaocheng as approver
wuxiyuanwuxiyuanCollaborators
Sep 20 Modify description of pull request
wuxiyuanwuxiyuanCollaborators
Sep 20 Modify description of pull request
wuxiyuanwuxiyuanCollaborators
Sep 20 Modify description of pull request
wuxiyuan
wuxiyuanCollaborators
Sep 20 Comments:

compile

likedislike
wuxiyuanwuxiyuanCollaborators
Sep 20 Pre merge succeeded (commit_id: 3c37dbb29cf80562c7f8385df23ab3185e3c4b15)
CANN-robot
CANN-robotCollaborators
Sep 20 Comments:
🚀 CI 流水线已启动
📋 执行详情: 点击查看流水线
likedislike
CANN-robotCANN-robotCollaborators
Sep 20 Added label: ci-pipeline-running
CANN-robotCANN-robotCollaborators
Sep 20 Removed label: ci-pipeline-running
CANN-robotCANN-robotCollaborators
Sep 20 Added label: ci-pipeline-failed
wuxiyuan
wuxiyuanCollaborators
Sep 20 Comments:

compile

likedislike
CANN-robot
CANN-robotCollaborators
Sep 20 Comments:
🚀 CI 流水线已启动
📋 执行详情: 点击查看流水线
likedislike
CANN-robotCANN-robotCollaborators
Sep 20 Removed label: ci-pipeline-failed
8 event messages are collapsed here。 See more
CANN-robotCANN-robotCollaborators
Sep 20 Added label: cann-cla/yes
wuxiyuan
wuxiyuanCollaborators
Sep 20 Comments:

compile

likedislike
wuxiyuanwuxiyuanCollaborators
Sep 20 Pre merge succeeded (commit_id: f344c1e4cdaf6f5aaeccceea538f54f0ca1605ca)
CANN-robot
CANN-robotCollaborators
Sep 20 Comments:
🚀 CI 流水线已启动
📋 执行详情: 点击查看流水线
likedislike
CANN-robotCANN-robotCollaborators
Sep 20 Removed label: ci-pipeline-failed
CANN-robotCANN-robotCollaborators
Sep 20 Added label: ci-pipeline-running
TangPC
TangPCCollaborators
Sep 20 Comments:

/lgtm
/approve

likedislike
CANN-robotCANN-robotCollaborators
Sep 20 Added label: approved
CANN-robotCANN-robotCollaborators
Sep 20 Removed label: ci-pipeline-running
CANN-robotCANN-robotCollaborators
Sep 20 Added label: ci-pipeline-passed
yue-ma
yue-maCollaborators
Sep 20 Comments:

/lgtm

likedislike
CANN-robotCANN-robotCollaborators
Sep 20 Added label: lgtm
CANN-robotCANN-robotCollaborators
Sep 20 Closed associated issue
CANN-robotCANN-robotCollaborators
Sep 20 Merged pull request