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


流水线任务触发成功
任务链接 [365a98c1550641e791daf4a08940c8ea][流水线指导]
| 任务名称 | 状态 | 日志 | 下载链接 |
|---|---|---|---|
| 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 | >>>>> | >>>>> |
| Compile_Pre | ✅ SUCCESS | >>>>> | |
| pre_comment | ✅ SUCCESS | >>>>> | |
| Compile_Ascend_X86 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_X86_monitor_910b | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_X86_monitor_910c | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_X86_monitor_950 | ✅ SUCCESS | >>>>> | >>>>> |
| UT_Test_ophost | ✅ SUCCESS | ||
| UT_Test_opapi | ✅ SUCCESS | ||
| UT_Test_kernel | ✅ SUCCESS | ||
| UT_Test_opgraph | ✅ SUCCESS | ||
| PreSmoke_A900 | ✅ SUCCESS | >>>>> | |
| PreSmoke_ATK_Test_A2 | ✅ SUCCESS | >>>>> |
[2026-06-18 15:40:35] CI执行结束


流水线任务触发成功
任务链接 [0c048de3333049e2bbbb24cf440f0673][流水线指导]
| 任务名称 | 状态 | 日志 | 下载链接 |
|---|---|---|---|
| codecheck | ✅ SUCCESS | >>>>> | |
| antipoison | ✅ SUCCESS | >>>>> | |
| codecheck_checkpr | ✅ SUCCESS | ||
| StaticCheck_codespell_check | ✅ SUCCESS | ||
| StaticCheck_link_validity_check | ✅ SUCCESS | ||
| StaticCheck_resource_existence_check | ✅ SUCCESS | ||
| StaticCheck_tag_closed_check | ✅ SUCCESS | ||
| StaticCheck_markdownlint | ✅ SUCCESS | ||
| codecheck_style | ✅ SUCCESS | >>>>> | |
| codecheck_precommit | ⚠️ WARNING | >>>>> | >>>>> |
| SCA | ✅ SUCCESS | >>>>> |
[2026-06-18 15:37:28] CI执行结束


流水线任务触发成功
任务链接 [3c8effc372364699a095c8a83a45e611][流水线指导]
| 任务名称 | 状态 | 日志 | 下载链接 |
|---|---|---|---|
| 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 | >>>>> | >>>>> |
| Compile_Pre | ✅ SUCCESS | >>>>> | |
| pre_comment | ✅ SUCCESS | >>>>> | |
| Compile_Ascend_X86 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_X86_monitor_910b | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_X86_monitor_910c | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_X86_monitor_950 | ✅ SUCCESS | >>>>> | >>>>> |
| UT_Test_ophost | ✅ SUCCESS | ||
| UT_Test_opapi | ✅ SUCCESS | ||
| UT_Test_kernel | ✅ SUCCESS | ||
| UT_Test_opgraph | ✅ SUCCESS | ||
| PreSmoke_A900 | ✅ SUCCESS | >>>>> | |
| PreSmoke_ATK_Test_A2 | ✅ SUCCESS | >>>>> |
[2026-06-18 16:00:11] CI执行结束


流水线任务触发成功
任务链接 [afd429b861374b9e946576c89e47caa0][流水线指导]
| 任务名称 | 状态 | 日志 | 下载链接 |
|---|---|---|---|
| codecheck | ✅ SUCCESS | >>>>> | |
| antipoison | ✅ SUCCESS | >>>>> | |
| codecheck_checkpr | ✅ SUCCESS | ||
| StaticCheck_codespell_check | ✅ SUCCESS | ||
| StaticCheck_link_validity_check | ✅ SUCCESS | ||
| StaticCheck_resource_existence_check | ✅ SUCCESS | ||
| StaticCheck_tag_closed_check | ✅ SUCCESS | ||
| StaticCheck_markdownlint | ✅ SUCCESS | ||
| codecheck_style | ✅ SUCCESS | >>>>> | |
| codecheck_precommit | ⚠️ WARNING | >>>>> | >>>>> |
| SCA | ✅ SUCCESS | >>>>> |
[2026-06-18 15:55:27] CI执行结束


/lgtm
/approve


基于三个文件的完整审查,所有更改都是一致且干净的:
文件 1: index/unsorted_segment_sum/op_host/arch35/unsorted_segment_sum_deterministic_tiling.h — 已审查。移除了 TILING_DATA_FIELD_DEF(uint32_t, dequantCoreNum) 和 uint32_t dequantCoreNum_ 成员变量,无残留引用,无问题。
文件 2: index/unsorted_segment_sum/op_host/arch35/unsorted_segment_sum_deterministic_tiling.cpp — 已审查。SetTilingData() 不再设置 dequantCoreNum,DoOpTiling() 不再赋值 dequantCoreNum_,PostTiling() 直接使用 static_cast<uint32_t>(totalCoreNum_) 替代,DumpTilingInfo() 移除了 dequantCoreNum_ 和 outputOuterDim 的日志输出(后者是无关的附带清理)。无问题。
文件 3: index/unsorted_segment_sum/op_kernel/arch35/uss_deterministic.h — 已审查。移除了 uint32_t dequantCoreNum_{1} 成员变量,Init() 不再读取 tilingData_.dequantCoreNum,ThirdUbProcess() 将 GetBlockNum() 传递给 Dequantize() 函数。GetBlockNum() 返回值与之前通过 SetBlockDim(static_cast<uint32_t>(totalCoreNum_)) 设置的块数一致,语义等价。Dequantize 函数内部的参数名 dequantCoreNum 保留但仅为局部形参名称,不影响功能。无问题。
变更摘要
此 PR 移除了 dequantCoreNum_ 这一冗余字段,该字段原本存储的值与 totalCoreNum_ 完全一致(均表示总核数)。通过直接使用 totalCoreNum_(host 端)和 GetBlockNum()(kernel 端),消除了数据在 tiling 数据结构、host 类成员和 kernel 类成员之间重复存储和传递的冗余。同时附带清理了 DumpTilingInfo() 中 outputOuterDim 的调试日志输出。
主要改动
- 移除 tiling 数据字段
dequantCoreNum:从UnsortedSegmentSumDetermTilingData结构体中删除TILING_DATA_FIELD_DEF(uint32_t, dequantCoreNum)定义,相应的tilingData_.set_dequantCoreNum()调用和tilingData_.dequantCoreNum读取均已移除 - 移除 host 端成员变量
dequantCoreNum_:从UnsortedSegmentSumDetermTiling类中删除该成员,PostTiling()中直接用static_cast<uint32_t>(totalCoreNum_)替代原context_->SetBlockDim(dequantCoreNum_)调用 - 移除 kernel 端成员变量并改用
GetBlockNum():从KernelUSSDeterministic类中删除dequantCoreNum_成员,ThirdUbProcess()在调用Dequantize()时传入GetBlockNum()替代原dequantCoreNum_,语义等价


代码审查
审查结论
发现汇总
| 优先级 | 数量 |
|---|---|
| P0 | 0 |
| P1 | 0 |
| P2 | 1 |
| P3 | 0 |
各文件审查结果
index/unsorted_segment_sum/op_host/arch35/unsorted_segment_sum_deterministic_tiling.cpp— 发现 1 个问题:DumpTilingInfo()中误删了与dequantCoreNum清理无关的outputOuterDim日志输出行。index/unsorted_segment_sum/op_host/arch35/unsorted_segment_sum_deterministic_tiling.h— 无问题。dequantCoreNum从 tiling data 定义和类成员变量中的移除是干净且一致的。index/unsorted_segment_sum/op_kernel/arch35/uss_deterministic.h— 无问题。内核中对dequantCoreNum_成员变量、Init()赋值以及ThirdUbProcess()中替换为GetBlockNum()的修改语义等价,逻辑正确。
整体风险评估
低风险。本次改动是一个重构清理:将冗余的 dequantCoreNum 中间变量移除,直接使用 totalCoreNum_ / GetBlockNum()。核心逻辑语义等价。唯一的缺陷是 DumpTilingInfo() 中误删了一条无关的日志行,属于可观测性退化,不影响运行时正确性。
| 类型 | 数量 |
|---|---|
| 🔴 阻塞 | 0 |
| 🟡 建议 | 1 |
💬 仅评论


🟡 Medium Priority
在清理 dequantCoreNum 相关代码时,diff 同时删除了 DumpTilingInfo() 中以下无关行:
outputOuterDim 字段仍然存在于 tiling data 定义中(TILING_DATA_FIELD_DEF(uint64_t, outputOuterDim);,见 unsorted_segment_sum_deterministic_tiling.h 第 25 行),并且在 SetTilingData() 中正常设置(第 65 行),在 kernel 的 Init() 中也正常使用(segmentNum_ = tilingData_.outputOuterDim;)。该字段与本次 dequantCoreNum 清理完全无关。
在同一模块的所有其他 tiling 类(simd_dyn_sort_tiling.cpp、deterministic_small_innerdim_tiling.cpp、simd_spilt_col_tiling.cpp、sort_simt_tiling.cpp、deterministic_big_innerdim_tiling.cpp、output_fullload_tiling.cpp、simt_tiling.cpp、simd_non_sort_tiling.cpp)中,DumpTilingInfo() 均正常输出 outputOuterDim,仅本文件被误删。
失败模式:调试/问题定位时缺少关键 tiling 参数 outputOuterDim 的日志,降低可观测性,增加排障难度。
建议:在 info << ", inputOuterDim: " << ... 之后、info << ", innerDim: " << ... 之前,恢复 outputOuterDim 的日志输出行。
|
167 | + info << ", inputOuterDim: " << tilingData_.get_inputOuterDim(); |
| 167
| - info << ", outputOuterDim: " << tilingData_.get_outputOuterDim(); |
|
168 | + info << ", outputOuterDim: " << tilingData_.get_outputOuterDim(); |
|
169 | + info << ", innerDim: " << tilingData_.get_innerDim(); |


描述
修复unsorted_segment_sum算子存在的功能问题
关联的Issue
测试
david冒烟,st pass
文档更新
index/unsorted_segment_sum/op_host/arch35/unsorted_segment_sum_deterministic_tiling.cpp
index/unsorted_segment_sum/op_host/arch35/unsorted_segment_sum_deterministic_tiling.h
index/unsorted_segment_sum/op_kernel/arch35/uss_deterministic.h
类型标签