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


compile


流水线任务触发成功
任务链接 [6aa7b1dac64749399d0c36c6ddc2e3f6][流水线指导]
| 任务名称 | 状态 | 日志 | 下载链接 |
|---|---|---|---|
| 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_harmony-infer | ✅ SUCCESS | >>>>> | |
| Compile_X86_monitor_910b | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_X86_monitor_910c | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_X86_monitor_950 | ✅ SUCCESS | >>>>> | >>>>> |
[2026-06-22 12:46:35] CI执行结束


compile


流水线任务触发成功
任务链接 [414a51b53f42449b8f37b1a621118845][流水线指导]
| 任务名称 | 状态 | 日志 | 下载链接 |
|---|---|---|---|
| codecheck | ❌ FAILED | None | |
| SCA | ✅ SUCCESS | >>>>> | |
| antipoison | ❌ FAILED | ||
| 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_precommit | ⚠️ WARNING | >>>>> | >>>>> |


流水线任务触发成功
任务链接 [c180251b1a9e4012986617ac3a8d90a8][流水线指导]
| 任务名称 | 状态 | 日志 | 下载链接 |
|---|---|---|---|
| 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_harmony-infer | ✅ SUCCESS | >>>>> | |
| Compile_X86_monitor_910b | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_X86_monitor_910c | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_X86_monitor_950 | ✅ SUCCESS | >>>>> | >>>>> |
| UT_Test | ✅ SUCCESS | ||
| UT_Test_experimental | ✅ SUCCESS | ||
| UT_Test_kernel | ✅ SUCCESS | ||
| PreSmoke_A900 | ✅ SUCCESS | >>>>> | |
| PreSmoke_ATK_Test_A2 | ✅ SUCCESS | >>>>> |
[2026-06-22 12:57:12] CI执行结束


变更摘要
此 PR 针对 cumsum_twoway_sklansky.h 中双向折叠 cumsum 算子的非对齐数据拷出逻辑与 gather 偏移计算进行修复,主要解决 rFoldCount 为 1(无多次折叠场景)时因错误进入脏数据处理分支导致的测试用例失败问题。核心改动包括:引入折叠次数门控常量跳过不必要的非对齐处理、精确化非对齐拷贝长度、以及为 VfGatherBeforeSecondSkalansky 的偏移计算增加无符号下溢保护。
主要改动
- 新增门控常量
kMinMultiFoldCount:值为 1,在BaseCopyOut中以rFoldCount > kMinMultiFoldCount条件控制dirtyDataNum的计算,仅在多次折叠(rFoldCount ≥ 2)时才进入脏数据对齐处理分支,避免单次折叠场景下的错误行为。 VfNoAlignCopyOut签名扩展:新增uint32_t actualNum参数,内部blockLen由固定的BLOCK_SIZE改为actualNum * sizeof(DataType),使DataCopyPad仅拷贝实际需要的补齐元素数而非整块,避免过拷贝导致的偏移错位。BaseCopyOut中变量作用域与计算顺序调整:将dirtyDataNum和mixDataLen提升到外层作用域并初始化零值;remainder计算移至VfNoAlignCopyOut调用之前,确保传入的actualNum(mixDataLen - remainder)正确反映对齐补齐量。VfGatherBeforeSecondSkalansky偏移安全计算:将原先rFoldCount * foldOneElem_ - numAlignBlock_(可能无符号下溢)拆分为先判断rFoldCount * foldOneElem_ < numAlignBlock_再决定baseOffset为 0 或差值,仅在isReverse时使用该偏移,防止因折叠元素数小于对齐块数导致的巨大偏移错误。


流水线任务触发成功
任务链接 [a1b3b98f09364000b246c4b0382e63fc][流水线指导]
| 任务名称 | 状态 | 日志 | 下载链接 |
|---|---|---|---|
| codecheck | ❌ FAILED | None | |
| 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 | None | |
| codecheck_precommit | ⚠️ WARNING | >>>>> | >>>>> |


代码审查
审查总结
| 优先级 | 数量 |
|---|---|
| P0 | 0 |
| P1 | 0 |
| P2 | 0 |
| P3 | 1 |
已审查的文件:
math/cumsum/op_kernel/arch35/cumsum_base/cumsum_twoway_sklansky.h— 发现 1 个 P3 命名规范问题(常量kMinMultiFoldCount应改为MIN_MULTI_FOLD_COUNT以与文件中其他 UPPER_CASE 常量保持一致)。
整体风险评估:低。 此 diff 的核心逻辑变更(VfGatherBeforeSecondSkalansky 的无符号下溢保护、BaseCopyOut 中 rFoldCount <= 1 时跳过非对齐拷贝、VfNoAlignCopyOut 中精确的 blockLen 计算)均为正确的边界情况修复,与 PR 描述"修改不过的用例"目标一致。未发现正确性、安全性或可靠性方面的回归问题。唯一报告的问题是常量命名的风格不一致,不影响运行时行为。
| 类型 | 数量 |
|---|---|
| 🔴 阻塞 | 0 |
| 🟡 建议 | 1 |
💬 仅评论


🔵 Low Priority
该文件中所有其他类级常量均使用 UPPER_CASE 命名(如 BLOCK_SIZE、MAX_N、VL_SIZE、MAX_FOLD 等),但新增的常量 kMinMultiFoldCount 使用了 k 前缀 + PascalCase 风格,与文件内一致的 UPPER_CASE 命名规范不符。根据该文件的审查规则"constants in UPPER_CASE",应统一命名风格。
建议:将常量重命名为 MIN_MULTI_FOLD_COUNT,与文件中其他常量(BLOCK_SIZE、MAX_N、VL_SIZE、MAX_FOLD 等)的 UPPER_CASE 风格保持一致。同时更新第 318 行引用处。
| 59
| - constexpr static uint32_t M |
|
59 | + constexpr static uint32_t MIN_MULTI_FOLD_COUNT = 1; |


compile


流水线任务触发成功
任务链接 [2b30adbfc9984e21a620669657e970b1][流水线指导]
| 任务名称 | 状态 | 日志 | 下载链接 |
|---|---|---|---|
| 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_harmony-infer | ✅ SUCCESS | >>>>> | |
| Compile_X86_monitor_910b | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_X86_monitor_910c | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_X86_monitor_950 | ✅ SUCCESS | >>>>> | >>>>> |
| UT_Test | ✅ SUCCESS | ||
| UT_Test_experimental | ✅ SUCCESS | ||
| UT_Test_kernel | ✅ SUCCESS | ||
| PreSmoke_A900 | ✅ SUCCESS | >>>>> | |
| PreSmoke_ATK_Test_A2 | ✅ SUCCESS | >>>>> |
[2026-06-22 14:54:19] CI执行结束


流水线任务触发成功
任务链接 [cc9039fd0fcd41f9902c154d07e45654][流水线指导]
| 任务名称 | 状态 | 日志 | 下载链接 |
|---|---|---|---|
| codecheck | ✅ SUCCESS | >>>>> | |
| SCA | ✅ SUCCESS | >>>>> | |
| antipoison | ❌ FAILED | >>>>> | |
| 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 | ✅ SUCCESS | >>>>> | |
| codecheck_precommit | ⚠️ WARNING | >>>>> | >>>>> |


compile


流水线任务触发成功
任务链接 [e94a859be98044098fa38b049cda13c1][流水线指导]
| 任务名称 | 状态 | 日志 | 下载链接 |
|---|---|---|---|
| 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_harmony-infer | ✅ SUCCESS | >>>>> | |
| Compile_X86_monitor_910b | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_X86_monitor_910c | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_X86_monitor_950 | ✅ SUCCESS | >>>>> | >>>>> |
| UT_Test | ✅ SUCCESS | ||
| UT_Test_experimental | ✅ SUCCESS | ||
| UT_Test_kernel | ✅ SUCCESS | ||
| PreSmoke_A900 | ✅ SUCCESS | >>>>> | |
| PreSmoke_ATK_Test_A2 | ✅ SUCCESS | >>>>> |
[2026-06-22 19:46:46] CI执行结束


流水线任务触发成功
任务链接 [05ba5b0fc3064e23a51c8734da186551][流水线指导]
| 任务名称 | 状态 | 日志 | 下载链接 |
|---|---|---|---|
| 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 | ✅ SUCCESS | >>>>> | |
| codecheck_precommit | ⚠️ WARNING | >>>>> | >>>>> |
[2026-06-22 19:43:49] CI执行结束


描述
关联的Issue
测试
文档更新
类型标签