已合并
UnsortedSegmentMin支持空tensor #1438
jinpenghe创建于 2月3日
UnsortedSegmentMin支持空tensor #1438
已合并
jinpenghe创建于 2月3日
jinpenghe
jinpenghe成员
2月3日

描述

UnsortedSegmentMin支持空tensor。

关联的Issue

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

测试

空tensor用例[[11, 2, 15, 5756, 2, 2, 0], [11, 2, 15, 5756, 2, 2, 0], [1]]测试通过

文档更新

类型标签

likedislike
Pull Request已成功合入, 合并人@CANN-robot
(感谢 jinpenghe 的贡献)
CANN-robotCANN-robot成员
2月3日 将FelixTang7,crystalhu,zhou-qilong,chenqi317,liubo75,tangweiwei2,wangyongguang,zhang-wu设为审查人
CANN-robot
CANN-robot成员
2月3日 评论:

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, tangweiwei2 (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成员
2月3日 添加了label:cann-cla/yes
CANN-robot
CANN-robot成员
2月3日 评论:

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

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

问题/功能描述

本次PR主要修复了 unsorted_segment_min 算子中 uint32_t 数据类型最大值常量定义错误的问题,该错误可能导致数据溢出或比较逻辑异常。同时,移除了对 uint32_tuint64_tint64_t 数据类型在SIMD非排序、动态排序等计算路径中的不必要限制,从而扩展了算子在多种场景下的支持范围,提升了其通用性和正确性。

修改方案描述

核心修改包括两点:一是在公共头文件中,将 uint32_t 类型的最大值常量从 INT32_MAX 修正为 UINT32_MAX,确保 GetDtypeMax 函数返回正确的无符号整数最大值。二是在算子主函数中,移除了针对上述三种数据类型在 TEMPLATE_SIMD_NON_SORTTEMPLATE_SIMD_DYN_SORT 等关键分支中的提前返回逻辑,使这些数据类型能够正常使用对应的SIMD和全负载优化计算路径,并优化了空张量场景的处理。

likedislike
jinpenghejinpenghe成员
2月3日 修改了pull request 的描述
jinpenghejinpenghe成员
2月3日 强制推送  1 个提交:c72f2396-usm支持空tensor
CANN-robot
CANN-robot成员
2月3日 评论:

CLA Signature Pass

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

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

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

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

compile

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

流水线任务触发成功 [流水线指导]
任务链接 [7e4dae9e269d4f6084e2028ca11407cd]

任务名称状态日志下载链接
codecheck ✅ SUCCESS >>>>>
anti_virus ✅ SUCCESS >>>>>
Check_Pr ✅ SUCCESS >>>>>
Compile_Ascend_X86 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_X86_mobile_station ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_ARM ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_single ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_experimental ✅ SUCCESS >>>>> >>>>>
API_Check ⚠️ WARNING >>>>>
UT_Test_ophost ✅ SUCCESS
UT_Test_opapi ✅ SUCCESS
UT_Test_kernel ✅ SUCCESS
UT_Test_opgraph ✅ SUCCESS
Smoke_A900 ✅ SUCCESS >>>>> >>>>>

[2026-02-03 15:03:54]    CI执行结束

likedislike
CANN-robotCANN-robot成员
2月3日 删除了label:ci-pipeline-running
此处折叠了5条事件消息 查看更多
CANN-robotCANN-robot成员
2月3日 添加了label:ci-pipeline-passed
chenqi317成员
2月6日 评论:

/approve

likedislike
CANN-robotCANN-robot成员
2月6日 添加了label:approved
tangweiwei2成员
2月6日 评论:

/lgtm

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

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, tangweiwei2.

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