已合并
usm排序模板性能优化 #2445
jinpenghe创建于 3月9日
usm排序模板性能优化 #2445
已合并
jinpenghe创建于 3月9日
jinpenghe
jinpenghe成员
3月9日

描述

UnsortedSegmentMin算子的排序模板在进行Block切分时,过多切分列数,导致搬运资源浪费和vector计算间空隙较大;此外, 高位宽数据排序性能较差,根据情况将高位宽数据cast到低位宽数据进行排序。

关联的Issue

https://gitcode.com/cann/ops-nn/issues/1385

测试

image.png

文档更新

类型标签

likedislike
Pull Request已成功合入, 合并人@CANN-robot
(感谢 jinpenghe 的贡献)
jinpenghejinpenghe成员
3月9日 创建了 pull request,commit 963ee310
CANN-robot
CANN-robot成员
3月9日 评论:

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
index chenqi317, fanqirui (2/2) chenqi317 (1/1)

💡 Tip:

  • Committer can comment /approve or /lgtm
  • Commenting /approve implies both code review (lgtm) and intent to merge (approve)
likedislike
CANN-robotCANN-robot成员
3月9日 将FelixTang7,crystalhu,fanqirui,zhou-qilong,chenqi317,liubo75,tangweiwei2,wangyongguang,zhang-wu设为评审人
CANN-robotCANN-robot成员
3月9日 将FelixTang7,crystalhu,zhou-qilong,chenqi317,liubo75,tangweiwei2,wangyongguang,zhang-wu设为审查人
CANN-robotCANN-robot成员
3月9日 添加了label:cann-cla/yes
CANN-robot
CANN-robot成员
3月9日 评论:

🔵 source code change are detected, tasks labels is removed in this pull request!

likedislike
CANN-robot
CANN-robot成员
3月9日 评论:

问题/功能描述

本次PR旨在优化“未排序段”操作核函数的分块(Tiling)策略,以提升计算效率和资源利用率。主要解决了两个问题:一是动态排序分块算法的关键参数(如基础块大小)未能充分发挥硬件性能;二是分列(SplitCol)策略的启用条件存在逻辑错误,导致在某些数据规模下无法选择更优策略。

修改方案描述

修改方案包含三部分核心内容:1. 提升动态排序分块算法的基础块大小(BASE_A_SIZE)和列限制大小(COL_LIMIT_SIZE)至2048,并调整AutoTiling函数参数,以扩大单核处理数据块,减少核间通信。2. 修复分列策略的启用条件,将判断比率大于阈值改为小于阈值,确保在数据行数远小于输出段数时能正确启用该策略。3. 调整通用分块算法AutoTiling中的排序逻辑,优先比较行分块数(M)而非列分块数(N),以适配不同策略对分块形状的偏好。

likedislike
jinpenghejinpenghe成员
3月10日 修改了pull request 的描述
此处折叠了6条事件消息 查看更多
jinpenghejinpenghe成员
3月10日 update merge request[project id: 7665709, iid: 2445, commit_id: 17e906da8d19736aeebaf8dd0d24e10430d37e2f] virtual merging success
CANN-robot
CANN-robot成员
3月10日 评论:

🔵 source code change are detected, tasks labels is removed in this pull request!

likedislike
jinpenghejinpenghe成员
3月10日 update merge request[project id: 7665709, iid: 2445, commit_id: 56ce98ccbd2251fa841032c45ae72fa9daaebad9] virtual merging success
jinpenghejinpenghe成员
3月10日 强制推送  1 个提交:e07b79ce-usm切分逻辑优化
jinpenghejinpenghe成员
3月10日 update merge request[project id: 7665709, iid: 2445, commit_id: dbc87cc2683299065bb682bada3f08f9b5af2e2c] virtual merging success
CANN-robot
CANN-robot成员
3月10日 评论:

🔵 source code change are detected, tasks labels is removed in this pull request!

likedislike
jinpenghejinpenghe成员
3月10日 update merge request[project id: 7665709, iid: 2445, commit_id: 60dae9ca19a5d365adf5c69b6447761fedc6af96] virtual merging success
jinpenghejinpenghe成员
3月10日 强制推送  1 个提交:d527da46-usm切分逻辑优化
jinpenghejinpenghe成员
3月10日 update merge request[project id: 7665709, iid: 2445, commit_id: 8c66ea6e904ac423a408436926e69728ca3eb943] virtual merging success
CANN-robot
CANN-robot成员
3月10日 评论:

CLA Signature Pass

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

likedislike
CANN-robot
CANN-robot成员
3月10日 评论:

🔵 source code change are detected, tasks labels is removed in this pull request!

likedislike
jinpenghe
jinpenghe成员
3月10日 评论:

compile

likedislike
CANN-robotCANN-robot成员
3月10日 添加了label:ci-pipeline-running
CANN-robot
CANN-robot成员
3月10日 评论:

流水线任务触发成功
任务链接 [2e4b4a2e3bbd4718aa0669562c85d242][流水线指导]

任务名称状态日志下载链接
解析CI分支 ✅ SUCCESS
codecheck ✅ SUCCESS >>>>>
anti_virus ✅ SUCCESS >>>>>
Check_Pr ✅ SUCCESS >>>>>
Compile_Ascend_X86_ubuntu24 ✅ SUCCESS >>>>>
Compile_Ascend_X86_mobile_station ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_ARM ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_single ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_experimental ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_X86_950 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_ARM_950 ✅ SUCCESS >>>>> >>>>>
API_Check ✅ SUCCESS >>>>>
Pre_Compile ✅ SUCCESS
pre_comment ✅ SUCCESS >>>>>
Compile_Ascend_X86 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_X86_mobile_station_ubuntu24 ✅ SUCCESS >>>>>
Compile_Ascend_X86_950_ubuntu24 ✅ SUCCESS >>>>>
UT_Test_ophost ✅ SUCCESS
UT_Test_opapi ✅ SUCCESS
UT_Test_kernel ✅ SUCCESS
UT_Test_opgraph ✅ SUCCESS
Smoke_A900_npupool ✅ SUCCESS >>>>>

[2026-03-10 20:21:31]    CI执行结束

likedislike
CANN-robotCANN-robot成员
3月10日 添加了label:api-check-pass
CANN-robotCANN-robot成员
3月10日 删除了label:ci-pipeline-running
CANN-robotCANN-robot成员
3月10日 添加了label:ci-pipeline-passed
jinpenghejinpenghe成员
3月10日 修改了pull request 的描述
jinpenghejinpenghe成员
3月10日 修改了pull request 的描述
jinpenghejinpenghe成员
3月10日 修改了pull request 的描述
CANN-robot
CANN-robot成员
3月10日 评论:
检查项 状态 详情
接口管理
通过
likedislike
chenqi317成员
3月11日 评论:

/lgtm
/approve

likedislike
CANN-robotCANN-robot成员
3月11日 添加了label:approved
范其瑞
范其瑞成员
3月11日 评论:

/lgtm

likedislike
CANN-robotCANN-robot成员
3月11日 添加了label:lgtm
CANN-robot
CANN-robot成员
3月11日 评论:

Review Guide

This pull-request passes review.
Committers who wrote a comment of /approve are: chenqi317.
Reviewers who wrote a comment of /lgtm are: chenqi317, fanqirui.

likedislike
CANN-robotCANN-robot成员
3月11日 关闭了关联的issue
CANN-robotCANN-robot成员
3月11日 合入了pull request