Merged
fix: 1.越界问题;2.Clean Code;3. memset二级指针场景不展开 #838
fix: 1.越界问题;2.Clean Code;3. memset二级指针场景不展开 #838
Merged
ren-botaoAdd on Sep 10
ren-botao
ren-botaoCollaborators
Sep 10

描述

  1. 修改潜在的vector访问越界问题;
  2. Aclnn Debug 维测代码优化,开关初始化在so加载的时候赋值
  3. Clean Code整改;
  4. ASCEND950芯片,AscendC算子调用memset对输出参数清零时,统计输入参数时,二级指针场景不跳过tensorList

关联的Issue

测试

添加ut用例看护
二级冒烟

文档更新

类型标签

likedislike
Pull Request has been successfully merged by CANN-robot.
(Thank you for ren-botao's contribution.)
ren-botaoren-botaoCollaborators
Sep 10 Created pull request, commit ca035546
atomgit-bot
atomgit-bot
Sep 10 Comments:

变更摘要

该 PR 主要包含两类改动:一是修复 KernelGraphUtils::Link 中的索引越界判断逻辑;二是优化 aclnn 调试开关(维测代码)的实现方式,将 g_aclnnDebugEnabled 全局变量及其初始化逻辑收敛到 op_dfx.cpp 内部,并利用 __attribute__((constructor)) 在程序加载阶段自动完成开关初始化,从而移除原先依赖 std::call_once 的惰性初始化及在 op_executor.cpp 中的显式调用。

主要改动

  • 越界判断修复:在 src/nnopbase/composite_op/mem_mgr/kernel_graph_utils.cpp 的 KernelGraphUtils::Link 中,将 from 与 to 的合法性判断由 >(大于)改为 >=(大于等于),使索引等于容器大小时也能被判定为越界并返回 ACLNN_ERR_INNER,避免后续 at() 访问越界。
  • 调试开关初始化方式重构:在 op_dfx.cpp 中将 g_aclnnDebugEnabled 移入匿名命名空间,并把 InitAclnnDebugSwitch 改为 __attribute__((constructor)) 构造函数(加载即执行),移除 std::once_flag 与 std::call_once 机制。
  • 接口收敛:在 op_dfx_internal.h 中移除 g_aclnnDebugEnabled 的 extern 声明、InitAclnnDebugSwitch 声明及内联的 IsAclnnDebugEnabled,仅保留 bool IsAclnnDebugEnabled() 接口声明,并在 op_dfx.cpp 中提供其实现。
  • 移除冗余调用:在 op_executor.cpp 的 InitL2Phase1Context 中删除对 InitAclnnDebugSwitch() 的显式调用,改由构造函数自动初始化。
likedislike
Incorrect?
atomgit-bot
atomgit-bot
Sep 10 Comments:

代码审查

✅ 未发现问题

likedislike
Incorrect?
CANN-robotCANN-robotCollaborators
Sep 10 Added label: cann-cla/yes
CANN-robot
CANN-robotCollaborators
Sep 10 Comments:

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
repo-cann/opbase ✅ 汤平川, 张磊 (2/2) ✅ 汤平川, 张磊 (2/1)

💡 Tip:

  • Committer can comment /approve or /lgtm
  • Commenting /approve implies both code review (lgtm) and intent to merge (approve)

CLA Signature Pass

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

likedislike
CANN-robotCANN-robotCollaborators
Sep 10 Set pengjiahao96,zhou-qilong,wangrui_,rxtfeng,loov1,jia0liang,zl_hw,songkai111,pingchuantang,llimwang,gubaocheng as approver
23 event messages are collapsed here。 See more
CANN-robotCANN-robotCollaborators
Sep 12 Added label: cann-cla/yes
ren-botao
ren-botaoCollaborators
Sep 12 Comments:

/ai review

likedislike
ren-botao
ren-botaoCollaborators
Sep 12 Comments:

/ai summary

likedislike
ren-botao
ren-botaoCollaborators
Sep 14 Comments:

compile

likedislike
ren-botaoren-botaoCollaborators
Sep 14 Pre merge succeeded (commit_id: 3a26e437832d6b7c9522563b42f65306b3ecbe1f)
CANN-robot
CANN-robotCollaborators
Sep 14 Comments:
🚀 CI 流水线已启动
📋 执行详情: 点击查看流水线
likedislike
CANN-robotCANN-robotCollaborators
Sep 14 Added label: ci-pipeline-running
CANN-robotCANN-robotCollaborators
Sep 14 Removed label: ci-pipeline-running
CANN-robotCANN-robotCollaborators
Sep 14 Added label: ci-pipeline-passed
ren-botaoren-botaoCollaborators
Sep 14 Modify description of pull request
TangPC
TangPCCollaborators
Sep 14 Comments:

/lgtm
/approve

likedislike
CANN-robotCANN-robotCollaborators
Sep 14 Added label: approved
zl_hw
zl_hwCollaborators
Sep 14 Comments:

/lgtm
/approve

likedislike
CANN-robotCANN-robotCollaborators
Sep 14 Added label: lgtm
CANN-robotCANN-robotCollaborators
Sep 14 Closed associated issue
CANN-robotCANN-robotCollaborators
Sep 14 Merged pull request