已合并
fix(arch35): scatter 类补 AutoContiguous;LambApplyOptimizerAssign infershape 与 tiling 对齐;foreach inplace 与 ScatterList 资料订正 #8767
fix(arch35): scatter 类补 AutoContiguous;LambApplyOptimizerAssign infershape 与 tiling 对齐;foreach inplace 与 ScatterList 资料订正 #8767
已合并
zl_hw创建于 8月17日
zl_hw成员
8月17日

描述

长尾算子问题优化:scatter 类补 AutoContiguous;LambApplyOptimizerAssign infershape 与 tiling 对齐;foreach inplace 与 ScatterList 资料订正

关联的Issue

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

测试

不涉及

文档更新

README

类型标签

AI/Agent生成声明

likedislike
Pull Request已成功合入, 合并人@CANN-robot
(感谢 zl_hw 的贡献)
Zzl_hw成员
8月17日 创建了 pull request,commit 6a61ea76
atomgit-bot
atomgit-bot
8月17日 评论:

变更摘要

本 PR 主要围绕 scatter 类算子和 LambApplyOptimizerAssign 算子进行修正。在 scatter_div、scatter_max、scatter_min、scatter_mul、scatter_list 的算子定义中,为各输入输出补加了 AutoContiguous(),用于统一处理非连续张量。同时,LambApplyOptimizerAssign 的 InferShape4LambApplyOptimizerAssign 推断逻辑与 tiling 对齐:明确 inputv 与 inputm 承载动量更新结果且形状必须一致,grad 与 input3 只能向上广播进动量形状,输出形状由 inputv/inputm 决定,并同步补充了相应单元测试。

主要改动

  • scatter 类算子补充 AutoContiguous():在 scatter_div_def.cpp、scatter_max_def.cpp、scatter_min_def.cpp、scatter_mul_def.cpp 中为 var、indices、updates 等输入输出统一追加 .AutoContiguous(),使这些算子支持非连续输入。
  • scatter_list 补充 AutoContiguous():在 scatter_list_def.cpp 的 910b、310p 及 kirin 三套配置中,为 var、indice、updates、mask 输入输出统一追加 .AutoContiguous(),覆盖不同平台的算子定义。
  • LambApplyOptimizerAssign 推断逻辑与 tiling 对齐:在 lamb_apply_optimizer_assign_infershape.cpp 中新增 INPUT3_IDX,要求 inputv 与 inputm 形状一致,并改为校验 grad、input3 能广播进动量形状,最终将 output0、outputv、outputm 的形状统一设置为动量形状。
  • 补充 LambApplyOptimizerAssign 推断单元测试:在 test_lamb_apply_optimizer_assign_infershape.cpp 中新增 RunInferShape 辅助函数,并新增测试覆盖「动量形状决定输出形状」「grad 大于动量形状被拒收」「input3 大于动量形状被拒收」「inputv/inputm 形状不一致被拒收」等场景。
likedislike
不准确?
atomgit-bot
atomgit-bot
8月17日 评论:

代码审查

✅ 未发现问题

likedislike
不准确?
CANN-robotCANN-robot成员
8月17日 添加了label:cann-cla/yes
CANN-robot
CANN-robot成员
8月17日 评论:

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.
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
*/*/README.md ✅ 陈娇, 汤平川 (2/2) ✅ 陈娇 (1/1)
*/*/docs/acl*.md ✅ 陈娇, 汤平川 (2/2) ✅ 陈娇 (1/1)
*/*/op_host/*_def.cpp ✅ 王永光, 汤平川 (2/2) ✅ 王永光 (1/1)
docs ✅ 陈娇, 汤平川 (2/2) ✅ 陈娇 (1/1)
optim ✅ 陈风, 汤平川 (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

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

likedislike
CANN-robotCANN-robot成员
8月17日 将zengjuan,chenfeng61,chaotang233,crystalhu,yu-xinjie62,yangyang016,fanqirui,gitee-duhuiping,su-yueming,tang-lei01,chenqi317,wang-xing001,liubo75,tangweiwei2,gitcode-chenjiao,pingchuantang,zhouwenfang,qianzehong,wangyongguang,wuyao51511,caiwenwen设为评审人
此处折叠了15条事件消息 查看更多
CANN-robotCANN-robot成员
8月17日 添加了label:cann-cla/yes
zl_hw成员
8月17日 评论:

compile

likedislike
Zzl_hw成员
8月17日 预合并成功(commit_id: 9f7abbd1a200395d32d78370d2bf25e1b5cc8d32)
CANN-robotCANN-robot成员
8月17日 添加了label:ci-pipeline-running
CANN-robot
CANN-robot成员
8月17日 评论:

流水线任务触发成功
任务链接 [de8a040bd27647aebf0627fb03dbac22][流水线指导]

任务名称状态日志下载链接
Compile_Ascend_X86_ubuntu24 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_X86_mobile_station ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_ARM ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_single ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_experimental ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_X86_950 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_ARM_950 ✅ SUCCESS >>>>> >>>>>
Compile_Pre ✅ SUCCESS >>>>>
pre_comment ✅ SUCCESS >>>>>
Compile_Ascend_X86 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_X86_mobile_station_ubuntu24 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_X86_950_ubuntu24 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_ARM_ubuntu24 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_single_ubuntu24 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_experimental_ubuntu24 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_ARM_950_ubuntu24 ✅ SUCCESS >>>>> >>>>>
Compile_X86_monitor_910b ✅ SUCCESS >>>>> >>>>>
Compile_X86_monitor_910c ✅ SUCCESS >>>>> >>>>>
Compile_X86_monitor_950 ✅ SUCCESS >>>>> >>>>>
Compile_classify ✅ SUCCESS >>>>>
Compile_Ascend_X86_mobile_station_9030_ubuntu24 ✅ SUCCESS >>>>> >>>>>
UT_Test_ophost ✅ SUCCESS
UT_Test_opapi ✅ SUCCESS
UT_Test_kernel ✅ SUCCESS
UT_Test_opgraph ✅ SUCCESS
PreSmoke_A900 ✅ SUCCESS >>>>>
API_Check ✅ SUCCESS >>>>>
PreSmoke_ATK_Test_A2 ✅ SUCCESS >>>>>
UT_Test_report_lcov ✅ SUCCESS >>>>>

[2026-08-17 22:07:17]    CI执行结束

likedislike
CANN-robot
CANN-robot成员
8月17日 评论:

流水线任务触发成功
任务链接 [ff618f5d737548b4ac00c0ab48498b6e][流水线指导]

任务名称状态日志下载链接
antipoison ✅ SUCCESS >>>>>
codecheck_checkpr ✅ SUCCESS
StaticCheck_codespell ✅ SUCCESS
StaticCheck_link_validity ✅ SUCCESS
StaticCheck_resource_existence ✅ SUCCESS
StaticCheck_tag_closed ✅ SUCCESS
StaticCheck_markdownlint ✅ SUCCESS
codecheck_precommit ✅ SUCCESS >>>>>
SCA ✅ SUCCESS >>>>>

[2026-08-17 21:52:43]    CI执行结束

likedislike
CANN-robotCANN-robot成员
8月17日 添加了label:api-check-pass
CANN-robotCANN-robot成员
8月17日 删除了label:ci-pipeline-running
CANN-robotCANN-robot成员
8月17日 添加了label:ci-pipeline-passed
Zzl_hw成员
8月18日 修改了pull request 的描述
TangPC
TangPC成员
8月18日 评论:

/lgtm
/approve

likedislike
chenfeng
chenfeng成员
8月18日 评论:

/lgtm
/approve

likedislike
wangyongguang成员
8月18日 评论:

/approve

likedislike
chenjiao成员
8月18日 评论:

/approve

likedislike
CANN-robotCANN-robot成员
8月18日 添加了label:lgtmapproved
CANN-robotCANN-robot成员
8月18日 关闭了关联的issue
CANN-robotCANN-robot成员
8月18日 合入了pull request