已合并
kth_value: 新增radix_select和small_axis_short_rank_select调度策略 #3804
黄晓彬创建于 7月5日
kth_value: 新增radix_select和small_axis_short_rank_select调度策略 #3804
已合并
黄晓彬创建于 7月5日
黄晓彬成员
7月5日

描述

当前 KthValue 算子已支持多种排序/选择策略,但在部分典型场景仍存在性能优化空间:

大型 last-axis 场景下,现有 radix_more_core 路径需要完成较完整的 radix sort 流程,再提取第 k 个元素。对于 kth_value 只需要单个 kth value/index 的语义而言,全量排序存在冗余计算。
小轴 int64/uint64 场景下,若 k 靠近头部或尾部,现有 small-axis two-stage / insertion 路径仍会完成完整排序,再提取第 k 个元素。对于短 rank 场景,可以只维护少量候选元素,避免全排序开销。

本需求在现有 KthValue 多策略框架基础上新增两条专项选择路径:radix_select 和 small_axis_short_rank_select,进一步减少不必要排序计算,提升大轴和小轴短 rank 场景性能。

关联的Issue

https://gitcode.com/cann/ops-math/issues/2155

测试

1 kthvalue 108个ST用例功能、性能达标
2 sort 331个ST用例功能、性能达标
3 二级冒烟通过

文档更新

不涉及

类型标签

likedislike
Pull Request已成功合入, 合并人@CANN-robot
(感谢 黄晓彬 的贡献)
黄晓彬成员
7月5日 创建了 pull request,commit 324bd11e
CANN-robotCANN-robot成员
7月5日 添加了label:cann-cla/yes
CANN-robot
CANN-robot成员
7月5日 评论:

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
math/sort wangrui_, 宋恺 (2/2) 宋恺 (1/1)
repo-cann/ops-math 宋恺, wangrui_ (2/2) 宋恺 (1/1)

💡 Tip:

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

CLA Signature Pass

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

likedislike
黄晓彬成员
7月5日 评论:

compile

likedislike
黄晓彬成员
7月5日 update merge request[project id: 7649531, iid: 3804, commit_id: 6138aeb7586d51278a8d9c7aa32219da0e03c309] virtual merging success
此处折叠了59条消息 查看更多
RuiWang_成员
7月6日 评论:

/lgtm

likedislike
songkai111成员
7月6日 评论:

/approve

likedislike
CANN-robotCANN-robot成员
7月6日 添加了label:lgtmapproved
CANN-robotCANN-robot成员
7月6日 关闭了关联的issue
CANN-robotCANN-robot成员
7月6日 合入了pull request