已合并
A5增加scatter_add_with_sorted算子 #4175
wkkk0528创建于 4月24日
A5增加scatter_add_with_sorted算子 #4175
已合并
Pull Request已成功合入, 合并人@CANN-robot
(感谢 wkkk0528 的贡献)CANN-robot
4月24日 评论:
4月24日 评论:
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 |
|---|---|---|
| */*/README.md | ✅ 周奇龙, 陈娇, 陈琦 (3/2) | ✅ 陈娇 (1/1) |
| */*/op_host/*_def.cpp | ✅ 周奇龙, 陈琦, 王永光 (3/2) | ✅ 王永光 (1/1) |
| index | ✅ 周奇龙, 陈琦, 王永光 (3/2) | ✅ 王永光, 周奇龙, 陈琦 (3/1) |
| scripts | ✅ 周奇龙, 陈琦 (2/2) | ✅ 周奇龙, 陈琦 (2/1) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)
CLA Signature Pass
wkkk0528, thanks for your pull request. All authors of the commits have signed the CLA. 👍


4月24日 添加了label:cann-cla/yes
4月24日 将chenfeng61,FelixTang7,crystalhu,yangyang016,fanqirui,zhou-qilong,chenqi317,liubo75,tangweiwei2,wangyongguang,zhang-wu设为评审人
4月24日 将chenfeng61,FelixTang7,crystalhu,yangyang016,fanqirui,zhou-qilong,chenqi317,liubo75,tangweiwei2,wangyongguang,zhang-wu设为评审人
4月24日 将chenfeng61,FelixTang7,crystalhu,yangyang016,fanqirui,zhou-qilong,chenqi317,liubo75,tangweiwei2,wangyongguang,zhang-wu设为审查人
4月24日 将chenfeng61,FelixTang7,crystalhu,yangyang016,fanqirui,zhou-qilong,chenqi317,liubo75,tangweiwei2,wangyongguang,zhang-wu设为审查人
此处折叠了349条消息 查看更多
4月29日 添加了label:approved
4月29日 关闭了关联的issue
4月29日 合入了pull request
描述
背景一:scatter类算子在索引重复的时候会涉及到同一个gm地址写数据,而david芯片同地址写性能远低于竞品(相差100倍),因此为了性能考虑要尽可能规避同地址写问题。对于scatter这类算子一个解决方法就是在将相同索引对应的计算(累加、替换等)在核内完成。在核内完成同索引的处理,就希望同索引尽可能的挨在一次,因此期望索引是有序的。
背景二:scatter类算子当多核切分在scatter轴时,为了保证确定性计算,需要每个核之间搬出的数据是有序的,一种做法是每个核顺序搬出,这样会有较大的等待开销,相当于开单核,为了提升性能,另外一种做法是对索引做全局排序,然后按索引序搬出。
从性能的角度,希望在部分场景将 scatter_add替换位 sort(索引) + scatter_add_with_sorted两个算子,因此开发了 scatter_add_with_sorted算子,以增强scatter_add在确定性场景的性能。
代码结构
关联的Issue
关联Issue #2351
测试
出包测试200条泛化用例,精度均pass,aclnn接口的的性能较之前调用scatteradd的方式提升3.9倍;通过冒烟测试
文档更新
类型标签