Closed
[Requirement|需求建议]: 新增unsorted_segment_sum算子支持Ascend950 #1912
Huang-PengAdd on  Apr 2Closed at  Apr 13
Huang-PengCollaborators
Apr 2 Create

Thanks for sending an requirement! Please fill in the following template to help quickly solve your problem.

Backgroud(背景信息)

UnsortedSegmentSum算子是索引算子,相同索引的数值进行原子累加再输出,原子累加同地址的写请求需要在MATA上排队,是性能瓶颈所在。在推荐网络中同地址的情况非常多,index一般按照powerlaw分布,重复度非常高,这种场景利用原子累加性能很差。但是对索引进行排序去重的方式消除核内相同地址的写请求。

Origin(信息来源)

vector

Benefit / Necessity (价值/作用)

实测在1%ID占总数80%的场景中,可以减少95%的atomic写请求。

Design(设计方案)

output[i] = {\sum}_{j...} data[j...]
segment_ids 不需要排序;分段索引,指示当前分段的值加到哪个段上。

segment_ids 不需要覆盖整个有效范围内所有值;

如果给定段 ID i 的和为空,,则输出output[i] = 0;

如果给定的分段 ID i 为负值,则该值将被删除并且不会被添加到该段的总和中.

likedislike
HHuang-PengCollaborators
Apr 2 Added label: requirement
HHuang-PengCollaborators
Apr 2 Associated pull request
jiangjiaweiCollaborators
Apr 2 Comments:

/assign @Huang-Peng

likedislike
CANN-robotCANN-robotCollaborators
Apr 2 Assign Huang-Peng as responsible person
CANN-robotCANN-robotCollaborators
Apr 13 Close issue
CANN-robotCANN-robotCollaborators
Apr 13 Added label: resolved