Pull Request已成功合入, 合并人@CANN-robot
(感谢 cy_hw 的贡献)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 |
|---|---|---|
| repo-cann/ops-math | ✅ 宋恺, wangrui_ (2/2) | ✅ 宋恺 (1/1) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)
CLA Signature Pass
caoyan_huawei, thanks for your pull request. All authors of the commits have signed the CLA. 👍


compile


流水线任务触发成功
任务链接 [9b85690c23c847aba56f74afe9d14ae8][流水线指导]
| 任务名称 | 状态 | 日志 | 下载链接 |
|---|---|---|---|
| Compile_Ascend_X86 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_X86_mobile_station | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_ARM | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_X86_experimental | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_ARM_experimental | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_single | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_X86_A5 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_ARM_A5 | ✅ SUCCESS | >>>>> | >>>>> |
| pre_comment | ✅ SUCCESS | >>>>> | |
| Compile_Ascend_X86_ubuntu24 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_X86_mobile_station_ubuntu24 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_X86_experimental_ubuntu24 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_X86_A5_ubuntu24 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_harmony-infer | ❌ FAILED | >>>>> | |
| Compile_Ascend_ARM_ubuntu24 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_ARM_experimental_ubuntu24 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_single_ubuntu24 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_ARM_A5_ubuntu24 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_X86_monitor_910b | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_X86_monitor_910c | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_X86_monitor_950 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_harmony-infer-chs-math | ✅ SUCCESS | >>>>> |


流水线任务触发成功
任务链接 [2a74e7b0ce9a4853b357f0e1d50f9ba6][流水线指导]
| 任务名称 | 状态 | 日志 | 下载链接 |
|---|---|---|---|
| codecheck | ✅ SUCCESS | >>>>> | |
| SCA | ✅ SUCCESS | >>>>> | |
| antipoison | ✅ SUCCESS | >>>>> | |
| codecheck_Pr | ✅ SUCCESS | ||
| StaticCheck_codespell_check | ✅ SUCCESS | ||
| StaticCheck_link_validity_check | ✅ SUCCESS | ||
| StaticCheck_resource_existence_check | ✅ SUCCESS | ||
| StaticCheck_tag_closed_check | ✅ SUCCESS | ||
| StaticCheck_markdownlint | ✅ SUCCESS | ||
| codecheck_codestyle | ⚠️ WARNING | >>>>> | |
| codecheck_precommit | ⚠️ WARNING | >>>>> | >>>>> |
[2026-06-25 12:07:51] CI执行结束


变更摘要
本PR为 SortWithIndex 算子在 arch35 架构上的 Tiling 模块补齐单元测试用例,将 test_sort_with_index_tiling_arch35.cpp 从仅含测试夹具骨架扩展为包含 7 个覆盖多种数据类型与排序模式的完整测试用例,通过 TilingContextPara 构造输入并校验 tilingKey、tilingData 及 workspaces 的预期值。
主要改动
-
新增 FLOAT16/FLOAT/BF16 小规模归并排序测试用例:分别新增
test_tiling_float16_small_size_merge_sort、test_tiling_float_small_size_merge_sort、test_tiling_bf16_small_size_merge_sort三个测试,覆盖浮点类型在排序轴长度 ≤512 时触发SMALL_SIZE_OPTIM_MODE归并排序的 tiling 逻辑,并验证对应的tilingKey(基数+10000偏移量)与tilingData正确性。 -
新增 INT32/INT64/UINT32 小规模单块基数排序测试用例:分别新增
test_tiling_int32_small_size_single_block、test_tiling_int64_small_size_single_block、test_tiling_uint32_small_size_single_block三个测试,覆盖整型/无符号整型在排序轴长度 ≤tileData阈值时触发SMALL_SIZE_MODE单块基数排序的 tiling 逻辑,其中 INT64 因 8 字节宽度使用独立的tileData=2048阈值。 -
新增 INT64 大规模多块基数排序测试用例:新增
test_tiling_int64_large_size_radix_multi_block,验证排序轴长度为 8192(超过tileData=2048)时触发MULT_CORE_MODE多核多块基数排序模式,并校验多块切分后的tilingData与 workspace 大小。 -
统一测试框架与断言模式:所有测试用例均使用
gert::TilingContextPara构造输入上下文,通过ExecuteTestCase统一校验ge::GRAPH_SUCCESS返回码、期望的tilingKey、tilingData字符串和workspaces向量,形成一致的测试风格。


compile


流水线任务触发成功
任务链接 [a2bc723bc88f46c59295377b1ca9a296][流水线指导]
| 任务名称 | 状态 | 日志 | 下载链接 |
|---|---|---|---|
| Compile_Ascend_X86 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_X86_mobile_station | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_ARM | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_X86_experimental | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_ARM_experimental | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_single | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_X86_A5 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_ARM_A5 | ✅ SUCCESS | >>>>> | >>>>> |
| pre_comment | ✅ SUCCESS | >>>>> | |
| Compile_Ascend_X86_ubuntu24 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_X86_mobile_station_ubuntu24 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_X86_experimental_ubuntu24 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_X86_A5_ubuntu24 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_harmony-infer | ✅ SUCCESS | >>>>> | |
| Compile_Ascend_ARM_ubuntu24 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_ARM_experimental_ubuntu24 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_single_ubuntu24 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_ARM_A5_ubuntu24 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_X86_monitor_910b | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_X86_monitor_910c | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_X86_monitor_950 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_harmony-infer-chs-math | ✅ SUCCESS | >>>>> | |
| UT_Test | ✅ SUCCESS | ||
| UT_Test_experimental | ✅ SUCCESS | ||
| UT_Test_kernel | ✅ SUCCESS | ||
| PreSmoke_A900 | ✅ SUCCESS | >>>>> | |
| API_Check | ✅ SUCCESS | >>>>> | |
| PreSmoke_ATK_Test_A2 | ✅ SUCCESS | >>>>> |
[2026-06-25 12:54:40] CI执行结束


流水线任务触发成功
任务链接 [738558f108374bed957a32356a7c5a8d][流水线指导]
| 任务名称 | 状态 | 日志 | 下载链接 |
|---|---|---|---|
| codecheck | ✅ SUCCESS | >>>>> | |
| SCA | ✅ SUCCESS | >>>>> | |
| antipoison | ✅ SUCCESS | >>>>> | |
| codecheck_Pr | ✅ SUCCESS | ||
| StaticCheck_codespell_check | ✅ SUCCESS | ||
| StaticCheck_link_validity_check | ✅ SUCCESS | ||
| StaticCheck_resource_existence_check | ✅ SUCCESS | ||
| StaticCheck_tag_closed_check | ✅ SUCCESS | ||
| StaticCheck_markdownlint | ✅ SUCCESS | ||
| codecheck_codestyle | ⚠️ WARNING | >>>>> | |
| codecheck_precommit | ⚠️ WARNING | >>>>> | >>>>> |
[2026-06-25 12:46:42] CI执行结束


代码审查
我已全面审查完所有变更。以下是审查总结。
审查总结
- 已审查文件:
math/sort_with_index/tests/ut/op_host/arch35/test_sort_with_index_tiling_arch35.cpp - 发现数量:P0: 0, P1: 0, P2: 1, P3: 0
P2(1 项)
| 标题 | 位置 |
|---|---|
| INT64 与 UINT32 小规模测试用例的预期 Tiling 数据完全相同,疑似复制粘贴错误 | 第 268–309 行 |
整体风险评估
本次变更为 SortWithIndex 算子新增了 6 个 Tiling 单元测试用例(覆盖 FLOAT16/FLOAT/BF16 小规模归并排序、INT32/INT64/UINT32 小规模基数排序、INT64 大规模多核基数排序),并对原有 1 个 INT32 测试用例进行了重命名和参数更新。
测试用例结构规范、测试向量覆盖了不同数据类型和排序模式(SMALL_SIZE_OPTIM_MODE / SMALL_SIZE_MODE / MULT_CORE_MODE),tilingKey 的预期值与 Tiling 实现逻辑一致。
唯一的关注点是 INT64 与 UINT32 两个小规模测试的 expectTilingData 完全相同。由于这两个测试使用不同元素大小的数据类型(8 字节 vs 4 字节),而 SetSortTmpSizeOfIdx 会调用 AscendC::GetSortMaxMinTmpSize 传入各自的实际 dataType,其临时缓冲区大小可能不同,两份预期数据相同存在复制粘贴未独立验证的风险。建议分别独立验证两者的实际 Tiling 输出。
| 类型 | 数量 |
|---|---|
| 🔴 阻塞 | 0 |
| 🟡 建议 | 1 |
💬 仅评论


🟡 Medium Priority
变更行:第 268 行(INT64 测试的 expectTilingData)与第 309 行(UINT32 测试的 expectTilingData)内容完全一致,均为:
"4294967296 2 2 4294967297 2 4294967296 4294967298 2 0 0 0 4294967296 "
这两个测试用例分别使用 DT_INT64(8 字节元素)和 DT_UINT32(4 字节元素)作为输入数据类型,均进入 SMALL_SIZE_MODE 分支。在 Tiling 流程中,SetSortTmpSizeOfIdx(sort_with_index_tiling.cpp 第 104-124 行)会调用 AscendC::GetSortMaxMinTmpSize,传入各自的实际 dataType,该函数返回的 maxValue 会影响 sortAcApiNeedBufferSize 和 tmpUbSize 字段。由于 INT64 和 UINT32 的元素大小不同(8B vs 4B),排序 API 所需的临时缓冲区大小通常也会不同。
两份预期数据完全一致可能意味着:某个测试的预期值未经独立验证,直接复制了另一个测试的预期数据。若预期数据本身有误,该测试将无法有效捕获对应数据类型的 Tiling 回归。
建议:分别验证 INT64 和 UINT32 在 shape [2,2], descending=false 条件下 Tiling 函数的实际输出,确保两份 expectTilingData 分别反映各自数据类型的真实 Tiling 结果。若确认两者确实输出相同,则可在注释中说明原因。


/lgtm
/approve


描述
本PR为 SortWithIndex 算子在 arch35 架构上的 Tiling 模块补齐单元测试用例,将 test_sort_with_index_tiling_arch35.cpp 从仅含测试夹具骨架扩展为包含 7 个覆盖多种数据类型与排序模式的完整测试用例,通过 TilingContextPara 构造输入并校验 tilingKey、tilingData 及 workspaces 的预期值。
关联的Issue
https://gitcode.com/cann/ops-math/issues/2048
测试
UT测试通过
文档更新
类型标签