Merged
fix(opration): Repair Alerts #6371
zhangchenAdd on Sep 16
fix(opration): Repair Alerts #6371
Merged
zhangchenAdd on Sep 16
zhangchen
zhangchen
Sep 16

fix(opration): Repair Alerts
issue:https://gitcode.com/cann/pypto/issues/3314

likedislike
Pull Request has been successfully merged by CANN-robot.
(Thank you for zhangchen's contribution.)
zhangchenzhangchen
Sep 16 Created pull request, commit d0b992ff
zhangchenzhangchen
Sep 16 Associated issue: pr告警修复
atomgit-bot
atomgit-bot
Sep 16 Comments:

变更摘要

本 PR 旨在修复卷积算子实现中的编译告警(Alerts),主要方式是对 conv_operation_impl.cpp 和 conv_load_nz2nz_impl.h 中的大函数进行拆分与抽取,将形状计算、偏移计算等逻辑提取为独立静态辅助函数,以降低函数复杂度、消除重复代码。涉及 Conv1D 结果张量构造、Conv1D 输入输出 reshape、Fmap/Weight 的 L1 加载与 CopyOut 分块逻辑的重构,以及 Conv3D NZ2NZ 加载函数按 fmap/weight 拆分,整体为无行为变更的代码整理。

主要改动

  • 抽取 Conv1D 结果张量构造逻辑:新增静态函数 ConstructConv1DResTensor,将 ConstructTensorGraphNZ2NZ 中原本内联的 Conv1D 结果张量由 NC1HWC0 重塑为 3 维输出的逻辑(含 OP_RESHAPE 算子创建、isConv/groupReshapeNoSplit 属性设置)提取为独立函数并复用。
  • 抽取 Conv1D 输入输出 reshape 逻辑:新增静态函数 ConstructConv1DOperandReshape(将 fmap/weight 升维为 4 维、输出降维为 NCL)与 AddConv1DOutReshapeOp(对 Conv1D 输出执行 OP_RESHAPE),替换 ConstructTensorGraph 中内联的重复实现。
  • 重构 SetCopyInAL1Op/SetCopyInBL1Op:将 GM 源数据偏移与形状计算分别抽取为 CalFmapSrcGmInfo/CalWeightSrcGmInfo,并将原先按平台分支分别设置的 copyInMode 属性收敛为一条基于 IsArch32Platform() 的三元表达式(COPY_MOD_NZ2NZ/COPY_MOD_DN2NZ)。
  • 重构 L1 tile 与 CopyOut 形状计算:将 ConstructFmapL1Tile/ConstructWeightL1Tile 中的 L1 目标形状与 GM 有效形状计算抽取为 CalFmapL1Shapes/CalWeightL1Shapes,将 ConstrucCopyOutTile 中的 L0C 结果形状与动态有效形状计算抽取为 CalL0CTileResShape。
  • 拆分 Conv3D NZ2NZ 加载模板:在 conv_load_nz2nz_impl.h 中将原单一模板 TLoadConv3DNZ2NZ 拆分为 TLoadConv3DFmapNZ2NZ(NDC1HWC0 布局)与 TLoadConv3DWeightNZ2NZ(FRACTAL_Z_3D 布局),原模板改为按 isFmap 模板参数分发调用。
likedislike
Incorrect?
atomgit-bot
atomgit-bot
Sep 16 Comments:

代码审查

✅ 未发现问题

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

compile

likedislike
CANN-robot
CANN-robotCollaborators
Sep 16 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
framework/src/interface/operation ✅ xinweiliu, dai-zhentao (2/2) ✅ xinweiliu (1/1)
framework/src/interface/tileop/conv ✅ xinweiliu, dai-zhentao (2/2) ✅ xinweiliu (1/1)

💡 Tip:

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

CLA Signature Pass

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

likedislike
zhangchenzhangchen
Sep 16 Pre merge succeeded (commit_id: 1e3adcf764ebfc2641189183ea526ff286c23504)
CANN-robotCANN-robotCollaborators
Sep 16 Set xinweiliu,cam_bxh,dai-zhentao,lululu40888,shi-dingkun,gguuaanngg,codehjp423,gaoxiang618,wangzheng97,DCGDDD,syfeng,jason_yuan_ye,foundea,ym-HW,hw_zhangzhiqi,yinjie27_,congqiannan,zhangyuebing,tsungl4,gaoxingwang,zhiweiyuan,caodongdong,make_pto,zhoubotcam,linjiashu,wangbing110,WenboCodes as approver
CANN-robotCANN-robotCollaborators
Sep 16 Set xinweiliu,cam_bxh,dai-zhentao,shi-dingkun,gguuaanngg,yinjie27_,tsungl4,make_pto,linjiashu as approver
CANN-robot
CANN-robotCollaborators
Sep 16 Comments:
🚀 CI 流水线已启动
📋 执行详情: 点击查看流水线
likedislike
CANN-robotCANN-robotCollaborators
Sep 16 Added label: ci-pipeline-running
CANN-robotCANN-robotCollaborators
Sep 16 Removed label: ci-pipeline-running
CANN-robotCANN-robotCollaborators
Sep 16 Added label: ci-pipeline-passed
dai-zhentao
dai-zhentaoCollaborators
Sep 17 Comments:

/lgtm

likedislike
xinweiliu
xinweiliuCollaborators
Sep 18 Comments:

/approve

likedislike
CANN-robotCANN-robotCollaborators
Sep 18 Added label: lgtmapproved
CANN-robotCANN-robotCollaborators
Sep 18 Merged pull request