已合并
fix(cleancode): AICPU算子告警整改(第二批) #10662
fix(cleancode): AICPU算子告警整改(第二批) #10662
已合并
liu-wei创建于 25 天前
liu-wei
liu-wei成员
25 天前

描述

ops-nn AICPU算子告警整改第二批,修复3类告警。

改动内容

  • G.EXP.15: reinterpret_cast → PtrToPtr (scatter_nd_min/scatter_nd_max/sparse_segment_sum/sparse_to_dense/sparse_fill_empty_rows)
  • G.CLS.12: 析构函数加 override (index_to_addr)
  • G.RES.06: lambda默认捕获改为显式捕获 (scatter_nd_max/log_softmax_v2)

关联的Issue

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

测试

  • pre-commit 全部 Passed
  • aicpu kernel UT: 80/80 PASSED
  • graph example: 7/7 success
  • eager example: log_softmax_v2 success

类型标签

likedislike
Pull Request已成功合入, 合并人@CANN-robot
(感谢 liu-wei 的贡献)
liu-weiliu-wei成员
25 天前 创建了 pull request,commit 1ef889f9
liu-weiliu-wei成员
25 天前 关联了issue:[Bug-Report|缺陷反馈]: conv3d_backprop_input_v2 arch35 tiling多申请workspace内存问题修复
atomgit-bot
atomgit-bot
25 天前 评论:

变更摘要

本 PR 是 ops-nn AICPU 算子告警整改的第二批,主要围绕三类静态检查告警进行重构与代码清理:将类型转换从 reinterpret_cast 统一替换为 PtrToPtr,为派生类析构函数补充 override,并将 lambda 的默认捕获改为显式捕获。涉及 scatter_nd_min、scatter_nd_max、sparse_segment_sum、sparse_to_dense、sparse_fill_empty_rows、log_softmax_v2、index_to_addr 等算子,属于不改变外部行为的等价改写。

主要改动

  • reinterpret_cast 替换为 PtrToPtr: 在 scatter_nd_min、scatter_nd_max、sparse_segment_sum、sparse_to_dense、sparse_fill_empty_rows 中将输入/输出及索引张量的裸指针转换改为 PtrToPtr<void, T>,对应 G.EXP.15 告警整改。
  • 析构函数补充 override: 在 index_to_addr_aicpu.h 中为 IndexToAddrCpuKernel 的析构函数加上 override,对应 G.CLS.12 告警整改。
  • lambda 默认捕获改为显式捕获: 在 log_softmax_v2 的 ComputeSequential、ComputeParallel 及 scatter_nd_max 的 copy_output_shard 中,将 [&] 改为显式列出所捕获的变量,对应 G.RES.06 告警整改。
  • 宏与代码格式调整: 调整 DO_SCATTER_ND_MAX_COMPUTE_CASE、DO_SCATTER_ND_MIN_COMPUTE_CASE 宏定义的缩进对齐,并整理部分 KERNEL_CHECK_FALSE 调用与三元表达式的换行排版。
likedislike
不准确?
atomgit-bot
atomgit-bot
25 天前 评论:

代码审查

✅ 未发现问题

likedislike
不准确?
CANN-robotCANN-robot成员
25 天前 添加了label:cann-cla/yes
CANN-robot
CANN-robot成员
25 天前 评论:

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.
You can self-configure the PR merge rules for this repository. For more details, please refer to Here.
For more, you also can visit HICANN.


PR Approval Progress

✅ Congratulations! All modules have met the lgtm and approve requirements.

Module Approval Details

module lgtm status approve status
activation ✅ 陈展熹, 陈琦 (2/2) ✅ 陈展熹 (1/1)
index ✅ 陈展熹, 陈琦 (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

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

likedislike
CANN-robotCANN-robot成员
25 天前 将zengjuan,u010470851,chenfeng61,chaotang233,kevin_huang1234,FelixTang7,crystalhu,yangyang016,fanqirui,wangrui_,renruhai,su-yueming,zhajianqing123,yourealize,chenqi317,wang-xing001,liubo75,tangweiwei2,chenxingyu18,liujie12345678,pingchuantang,Chen_HaoWen,qianzehong设为评审人
CANN-robotCANN-robot成员
25 天前 将u010470851,chenfeng61,kevin_huang1234,FelixTang7,wangrui_,renruhai,su-yueming,zhajianqing123,yourealize,wang-xing001,chenxingyu18,liujie12345678,pingchuantang,Chen_HaoWen,qianzehong设为审查人
liu-wei
liu-wei成员
25 天前 评论:

compile

likedislike
liu-weiliu-wei成员
25 天前 预合并成功(commit_id: afdab5aa047feca74cb0dbe3033a167926c6ddbb)
CANN-robot
CANN-robot成员
25 天前 评论:
🚀 CI 流水线已启动
📋 执行详情: 点击查看流水线
likedislike
CANN-robotCANN-robot成员
25 天前 添加了label:ci-pipeline-running
CANN-robotCANN-robot成员
25 天前 删除了label:ci-pipeline-running
CANN-robotCANN-robot成员
25 天前 添加了label:ci-pipeline-passed
yuning_chen
yuning_chen成员
25 天前 评论:

您好,pr合入已准备就绪,请尽快联系committer进行检视,谢谢!

likedislike
liu-weiliu-wei成员
24 天前 修改了pull request 的描述
liu-weiliu-wei成员
24 天前 修改了pull request 的描述
陈展熹成员
24 天前 评论:

/lgtm
/approve

likedislike
CANN-robotCANN-robot成员
24 天前 添加了label:approved
chenqi317成员
24 天前 评论:

/lgtm
/approve

likedislike
CANN-robot
CANN-robot成员
24 天前 评论:

The following users do not have permission to comment /lgtm or /approve on any module in this PR:
/approve: 陈琦

likedislike
CANN-robotCANN-robot成员
24 天前 添加了label:lgtm
CANN-robotCANN-robot成员
24 天前 合入了pull request