Merged
feat(scatter_reduce): 完善 amax true/false、正确性与宽通道性能 #13812
feat(scatter_reduce): 完善 amax true/false、正确性与宽通道性能 #13812
Merged
liushucheng4Add on 15 days ago
liushucheng4
liushucheng4Collaborators
15 days ago

描述

为 Atlas A2/A3 的 aclnnScatterReduce 和 aclnnInplaceScatterReduce 开放 FP32/FP16/BF16 的 max(reduce=3)、includeSelf=true/false,支持图最大值池化与 PointNet 等宽通道聚合。

改动包含三部分:

  1. 按 reduction 选择展开索引分支,修复 max/min 的 NaN 传播。true 将 self 纳入比较;false 在首次命中时使用 src;未命中位置和空 index 保留 self。
  2. 适配输出行块向量更新:保留 E 个行索引,每个输出块扫描一次索引,筛选命中边后沿通道比较和选择。
  3. Host 统一选择输入分片或输出分片。输入分片依据 UB 容量、对齐和源位置编码条件启用 AtomicMax;输出分片按索引布局选择块内实现。资源预算包含 SDK 固定临时区,并保持 BF16 特殊值、首次命中、原地保护及跨核正负零顺序处理。

支持范围为一维/二维、dim=0 及等价负维度、INT64 index、index/src 同形,覆盖展开索引和独立列索引。index 非空时,self/src 的各维大小及元素总数不超过 4294967295。

关联的Issue

共同需求 #7692。本 PR 完成 amax true/false、正确性修复及宽通道适配。

文档更新

同步更新中英文 ACLNN 文档中的 max 支持范围、includeSelf 参数和形状约束;示例展示 amax true/false 的输出。

类型标签

AI/Agent生成声明

likedislike
Pull Request has been successfully merged by CANN-robot.
(Thank you for liushucheng4's contribution.)
liushucheng4liushucheng4Collaborators
15 days ago Created pull request, commit b7743743
liushucheng4liushucheng4Collaborators
15 days ago Associated issue: [Requirement|需求建议]: 完善 A2/A3 ScatterReduce 的 includeSelf、amax 支持与临时显存
atomgit-bot
atomgit-bot
15 days ago Comments:

🤖 正在生成合并请求摘要,请稍候…

likedislike
Incorrect?
atomgit-bot
atomgit-bot
15 days ago Comments:

🤖 AI 代码检视正在进行中,请稍候…

likedislike
Incorrect?
liushucheng4
liushucheng4Collaborators
15 days ago Comments:

compile

likedislike
153 messages are collapsed here。 See more
CANN-robotCANN-robotCollaborators
4 days ago Added label: ci-pipeline-running
CANN-robotCANN-robotCollaborators
4 days ago Removed label: ci-pipeline-running
CANN-robotCANN-robotCollaborators
4 days ago Added label: ci-pipeline-passed
CANN-robotCANN-robotCollaborators
4 days ago Merged pull request
CANN-robot
CANN-robotCollaborators
4 days ago Comments:

Pull Request 已合并或已关闭。

If you want to solve this problem, you can click here to do it in the FAQs.

likedislike