Merged
fix(function): Preserve normalized reshape copy valid shape #6683
fix(function): Preserve normalized reshape copy valid shape #6683
Merged
赵俊涵Add on Sep 23
赵俊涵
赵俊涵Collaborators
Sep 23

问题:

reshape_copy 的 validshape 归一化后未写回属性,导致动态 shape 尾块可能出现精度错误。

修改:

保存归一化后的 validshape 并写回 RESHAPE_COPY_IN/OUT 属性。卷积专用 Copy 仍收集 COA 参数并写回原始 validshape,避免影响卷积用例。

likedislike
Pull Request has been successfully merged by CANN-robot.
(Thank you for 赵俊涵's contribution.)
赵俊涵赵俊涵Collaborators
Sep 23 Created pull request, commit e65b95af
atomgit-bot
atomgit-bot
Sep 23 Comments:

变更摘要

本 PR 修复 reshape_copy 的 validshape 在归一化后未写回属性、导致动态 shape 尾块可能出现精度错误的问题。核心是让 MaybeNormalizeValue 在归一化时同步保存归一化后的结果,并在 NormalizeCoaForSpecialInfo 中将归一化后的 validshape 写回 RESHAPE_COPY_IN/RESHAPE_COPY_OUT 属性;同时卷积专用 Copy 改为收集 COA 参数时使用原始 validshape,避免影响卷积用例。

主要改动

  • MaybeNormalizeValue 回写归一化结果: 将循环改为遍历 values 引用,并在函数末尾通过 opImmList = OpImmediate::Specified(values) 把归一化后的值写回传入的 opImmList,使调用方拿到归一化后的 validshape。
  • NormalizeCoaForSpecialInfo 写回归一化后的 validshape: 针对 IsReshapeCopyIn/IsReshapeCopyOut 分支,将 SetFromDynValidShape/SetToDynValidShape 的参数由 OpImmediate::Specified(coaList) 改为 validshape,即写回归一化后的属性值。
  • 卷积专用 Copy 保持原始 validshape: 在 NormalizeCopyIn 的 OP_L1_COPY_IN_CONV 分支与 NormalizeCopyOut 的 OP_L0C_COPY_OUT_CONV 分支中,MaybeNormalizeValue 的 valueToIndex 参数由变量改为常量 false,使卷积场景仍收集 COA 参数并写回原始 validshape。
likedislike
Incorrect?
atomgit-bot
atomgit-bot
Sep 23 Comments:

代码审查

✅ 未发现问题

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

CLA Signature Pass

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

likedislike
CANN-robot
CANN-robotCollaborators
Sep 23 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
9.2.0 ✅ gcw_kUomxQ2l, DCGDDD (2/2) ✅ gcw_kUomxQ2l (1/1)

💡 Tip:

  • Committer can comment /approve or /lgtm
  • Commenting /approve implies both code review (lgtm) and intent to merge (approve)
likedislike
CANN-robotCANN-robotCollaborators
Sep 23 Set xinweiliu,cam_bxh,dai-zhentao,TianXL,lululu40888,shi-dingkun,gguuaanngg,codehjp423,jiangtao_rts,gitcode-chenjiao,hanxiaolong,gaoxiang618,wangzheng97,DCGDDD,syfeng,jason_yuan_ye,foundea,ym-HW,hw_zhangzhiqi,yinjie27_,congqiannan,zhangyuebing,tsungl4,gaoxingwang,zhiweiyuan,caodongdong,make_pto,zhoubotcam,linjiashu,wangbing110,gcw_kUomxQ2l,Andy-lb,WenboCodes as approver
CANN-robotCANN-robotCollaborators
Sep 23 Set TianXL,jiangtao_rts,gitcode-chenjiao,hanxiaolong,gcw_kUomxQ2l,Andy-lb as approver
赵俊涵
赵俊涵Collaborators
Sep 23 Comments:

/compile

likedislike
赵俊涵赵俊涵Collaborators
Sep 23 Pre merge succeeded (commit_id: bf104250269d989a9c42d7aca8c8943a705429cc)
CANN-robot
CANN-robotCollaborators
Sep 23 Comments:
🚀 CI 流水线已启动
📋 执行详情: 点击查看流水线
likedislike
CANN-robotCANN-robotCollaborators
Sep 23 Added label: ci-pipeline-running
5 event messages are collapsed here。 See more
CANN-robotCANN-robotCollaborators
Sep 23 Added label: AscendC-SUCC
杨旭
杨旭Collaborators
Sep 24 Comments:

/lgtm
/approve

likedislike
liulun0308
liulun0308Collaborators
Sep 24 Comments:

/approve

likedislike
CANN-robot
CANN-robotCollaborators
Sep 24 Comments:

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

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