Merged
add aligned_type example #2297
add aligned_type example #2297
Merged
CaiBinbinAdd on May 19
CaiBinbin
CaiBinbinCollaborators
May 19

描述

新增SIMT最佳实践样例:通过类型对齐提升搬运效率

关联的Issue

测试

线下样例测试通过

文档更新

类型标签

likedislike
Pull Request has been successfully merged by CANN-robot.
(Thank you for CaiBinbin's contribution.)
CaiBinbinCaiBinbinCollaborators
May 19 Created pull request, commit ae66c1c1
CANN-robot
CANN-robotCollaborators
May 19 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


PR Approval Progress

✅ Congratulations! All modules have met the lgtm and approve requirements.

Module Approval Details

module lgtm status approve status
docs ✅ ai_xin, wulinyu (2/2) ✅ ai_xin (1/1)
examples ✅ ai_xin, wulinyu (2/2) ✅ ai_xin (1/1)

💡 Tip:

  • Committer can comment /approve or /lgtm
  • Commenting /approve implies both code review (lgtm) and intent to merge (approve)

CLA Signature Pass

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

likedislike
CANN-robotCANN-robotCollaborators
May 19 Added label: cann-cla/yes
CANN-robotCANN-robotCollaborators
May 19 updated PR
CANN-robotCANN-robotCollaborators
May 19 Set xun_zhuge,bianque,YANXI_ZHAO,munanhw,ai_xin as approver
172 messages are collapsed here。 See more
ai_xinCollaboratorsJun 1Start code review2
docs/guide/算子实践参考/SIMT算子性能优化/内存访问/通过类型对齐提升搬运效率.md
@@ -0,0 +69,4 @@
69+| 16B | 32983.77 (alignof=4) | 38353.60 (alignof=4) | **1.16x** |
70+| 32B | 60901.24 (alignof=4) | 77790.93 (alignof=4) | **1.28x** |
71+ 
72+测试结果表明:**在数据总量不变的时候,相同大小的结构体,类型对齐可以提升搬运效率**。以4B结构体为例,随着对齐位宽从1B提升至4B,非对齐相对对齐的耗时倍数逐步下降。8B结构体受编译器自动优化影响,无论是否对齐,均以8B位宽完成搬运。此外,同大小的4B结构体,字段组合形式、有无填充位,都不会对搬运效率产生影响。
ai_xinJun 1Comments:

随着结构体位宽从1B对齐提升至4B,非对齐Task Duration/对齐Task Duration的耗时倍数逐步下降。

likedislike
CaiBinbin
CaiBinbinCollaborators
Jun 1 Comments:

下个pr修改

ai_xinCollaborators
Jun 1 Comments:

/approve

likedislike
CANN-robotCANN-robotCollaborators
Jun 1 Added label: lgtmapproved
CANN-robot
CANN-robotCollaborators
Jun 1 Comments:

The MR can not be merged, because of CodeReview discussion not resolved

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

likedislike
CANN-robotCANN-robotCollaborators
Jun 1 Merged pull request