Merged
fix(Conv): Skip split reshape for group conv1d with group_reshape_no_split flag #6348
fix(Conv): Skip split reshape for group conv1d with group_reshape_no_split flag #6348
Merged
xinweiliuAdd on Sep 15
xinweiliu
xinweiliuCollaborators
Sep 15

A2A3 Conv1d group场景,reshape算子感知不到group属性,与Transdata算子处理如果split会无法推导正确的shape关系

likedislike
Pull Request has been successfully merged by CANN-robot.
(Thank you for xinweiliu's contribution.)
xinweiliuxinweiliuCollaborators
Sep 15 Created pull request, commit bb937684
xinweiliuxinweiliuCollaborators
Sep 15 Associated issue: [Bug-Report|缺陷反馈]: conv1d group op 存在精度问题
atomgit-bot
atomgit-bot
Sep 15 Comments:

变更摘要

该 PR 修复 A2A3 Conv1d 分组(group)场景下 reshape 算子无法感知 group 属性、与 Transdata 算子 split 后无法推导正确 shape 关系的问题。核心思路是新增 group_reshape_no_split 标志位(OpAttributeKey::groupReshapeNoSplit):在 conv_operation_impl.cpp 构造图时,当 convAttrParam.groups > 1 为相关 reshape 算子打上该标志,并在 SplitReshape 拆分优化中遇到带此标志的 reshape 时跳过拆分,同时配套补充防御性检查和单元测试。

主要改动

  • 新增 groupReshapeNoSplit 属性键: 在 operation.cpp / operation.h 中为 OpAttributeKey 增加 groupReshapeNoSplit = "group_reshape_no_split" 常量,作为该标志位的统一标识。
  • Conv 图构造阶段设置标志位: 在 conv_operation_impl.cpp 的 ConstructTensorGraphNZ2NZ 与 ConstructTensorGraph 中,当 convAttrParam.groups > 1 时,为 OP_RESHAPE 算子(包括 reshapeFmapOp、reshapeWeightOp、reshapeResOp)设置 groupReshapeNoSplit 属性。
  • 标志位在展开阶段透传: 在 operation_impl.cpp 中为 TiledInnerReshape 增加 groupReshapeNoSplit 参数并写入 TILE_RESHAPE 算子属性,ExpandOperationInto 在处理 OP_RESHAPE 时读取该属性并透传,确保标志位在展开后不丢失。
  • SplitReshape 跳过带标志的拆分: 在 split_reshape.cpp / split_reshape.h 中新增 groupReshapeNoSplitRawMagics_ 集合记录带标志的 reshape 输出,并在 CheckReshapeSkip 中检测到该标志时直接跳过 split reshape,避免错误推导 shape 关系。
  • 存储边界防御及单元测试: 在 conv_store_nz2nz_impl.h 的 TStoreConv2DNZ2NZ 中对 realCutW <= 0 提前返回,避免非法分块搬出;test_splitreshape.cpp 新增两个用例,分别验证带标志的 reshape 在 SPLIT_RESHAPE pass 中被跳过拆分、以及标志位能跨 EXPAND_FUNCTION pass 保留。
likedislike
Incorrect?
atomgit-bot
atomgit-bot
Sep 15 Comments:

代码审查

✅ 未发现问题

likedislike
Incorrect?
xinweiliu
xinweiliuCollaborators
Sep 15 Comments:

compile

likedislike
CANN-robotCANN-robotCollaborators
Sep 15 Added label: stat/needs-squash
xinweiliuxinweiliuCollaborators
Sep 15 Pre merge succeeded (commit_id: 773b71c523a352b7a1ecff5f516910897d1bf0b4)
CANN-robotCANN-robotCollaborators
Sep 15 Added label: cann-cla/yes
CANN-robot
CANN-robotCollaborators
Sep 15 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 ✅ 尹杰, dai-zhentao (2/2) ✅ 尹杰 (1/1)
framework/src/interface/tileop/conv ✅ 尹杰, dai-zhentao (2/2) ✅ 尹杰 (1/1)
framework/src/passes ✅ dai-zhentao, zhangyuebing, 尹杰 (3/2) ✅ zhangyuebing, 尹杰 (2/1)
repo-cann/pypto ✅ zhangyuebing, 尹杰, dai-zhentao (3/2) ✅ zhangyuebing, 尹杰 (2/1)

💡 Tip:

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

CLA Signature Pass

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

likedislike
CANN-robotCANN-robotCollaborators
Sep 15 Set 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 15 Set 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-robot
CANN-robotCollaborators
Sep 15 Comments:
🚀 CI 流水线已启动
📋 执行详情: 点击查看流水线
likedislike
CANN-robotCANN-robotCollaborators
Sep 15 Added label: ci-pipeline-running
CANN-robotCANN-robotCollaborators
Sep 15 Removed label: ci-pipeline-running
CANN-robotCANN-robotCollaborators
Sep 15 Added label: ci-pipeline-passed
lileizheng
lileizheng
Sep 15 Comments:

/reject

likedislike
conv2d_ci
conv2d_ci
Sep 15 Comments:
pipeline history
TimeNameResultLink
2026-09-15 20:21:13Start_PipelineMR_19
likedislike
zhangyuebing
zhangyuebingCollaborators
Sep 15 Comments:

/approve

likedislike
zhangyuebing
zhangyuebingCollaborators
Sep 15 Comments:

✅ 已将本 PR 下你提交的未解决检视意见标记为已解决(无未解决的检视意见)。

likedislike
Jie Yin
Jie YinCollaborators
Sep 15 Comments:

/approve

likedislike
CANN-robotCANN-robotCollaborators
Sep 15 Added label: approved
dai-zhentao
dai-zhentaoCollaborators
Sep 16 Comments:

/lgtm

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