Closed
[Bug-Report|缺陷反馈]: CombinedNonMaxSuppression 存在多处性能瓶颈 #1007
wuxiyuanAdd on  Sep 20Closed at  Sep 20
wuxiyuan
wuxiyuanCollaborators
Sep 20 Create

环境信息

  • 芯片/架构:Ascend950(arch35,SIMT 实现)
  • CANN 版本:9.2.0

问题描述

  1. 块内 argmax 归约开销大:类内 NMS 主循环每轮选择都执行「全线程写 UB + log2(blockDim) 层树形归约」,1024 线程时需 11 次 asc_syncthreads,外层最多迭代 1000 轮,同步与共享内存流量成为热点。
  2. UB 热路径阈值偏保守(HOT_UB_MAX_BOXES=4096):numBoxes 在 4097~8704 的输入被迫走 GM fallback 路径,而该规模热数据(≈178.5KB)实际可完整放入 TPipe 可用 UB。
  3. staging 无效搬运:score ≤ score_threshold、不参与 NMS 的 box 坐标仍被搬入 UB,浪费带宽。
  4. 末轮抑制扫描冗余:最后一轮 IoU 抑制结果无后续消费者,仍执行 O(numBoxes) 扫描。
  5. tiling 未封顶 maxPerClass:未与 min(numBoxes, outputSize) 取小,导致 workspace 与每任务 GM 写回量冗余。

期望

块归约改为 warp shuffle 两级归约、热路径阈值提至 8704、staging 按阈值过滤、跳过末轮抑制扫描、封顶 maxPerClass;全部 UT 通过,输出与基线一致。

likedislike
wuxiyuanwuxiyuanCollaborators
Sep 20 Modify description of issue
sunhao_hwsunhao_hwCollaborators
Sep 20 Assign wuxiyuan as responsible person
sunhao_hwsunhao_hwCollaborators
Sep 20 Removed responsible person wuxiyuan
sunhao_hwsunhao_hwCollaborators
Sep 20 Assign wuxiyuan as responsible person
CANN-robotCANN-robotCollaborators
Sep 20 Close issue
CANN-robotCANN-robotCollaborators
Sep 20 Added label: resolved