已开启
BNInfer,InplaceApplyRMSProp以及ApplyCamePart1算子检视意见闭环 #9453
tianyu52创建于 3 小时前
BNInfer,InplaceApplyRMSProp以及ApplyCamePart1算子检视意见闭环 #9453
已开启
tianyu52创建于 3 小时前
tianyu52成员
3 小时前

描述

BNInfer,InplaceApplyRMSProp以及ApplyCamePart1算子检视意见闭环

关联的Issue

测试

BNInfer:泛化测试1000条均PASS
InplaceApplyRMSProp:泛化测试1000条均PASS
ApplyCamePart1:泛化测试1000条均PASS

文档更新

类型标签

AI/Agent生成声明

likedislike
合并受阻
Ttianyu52成员
3 小时前 创建了 pull request,commit 7fb373a1
Ttianyu52成员
3 小时前 关联了issue:[Bug-Report|缺陷反馈]: BNInferGrad kernel 与 GEIR Golden 计算逻辑不一致
atomgit-bot
atomgit-bot
3 小时前 评论:

变更摘要

本 PR 针对 BNInferInplaceApplyRMSPropApplyCamePart1 三个算子的检视意见进行闭环整改,涉及算子原型文档、tiling/内核实现、公共代码抽取及测试用例调整。BNInfer 扩展了输入格式支持范围并对 last-channel tiling 增加 UB 容量校验;ApplyCamePart1 支持带 batch 维度的 grad 输入并删除独立的 InferDataType 实现;InplaceApplyRMSProp 将同步机制从 PipeBarrier 改为事件同步,并将 use_locking 属性改为可选。此外两个优化算子的测试基准从 cross_check 调整为 stat_rel_err

主要改动

  • BNInfer 算子文档与格式支持扩展: 在 bn_infer_proto.h 中更新注释,输入 x 支持 NC1HWC0NULLNDNCHWNCDHWNHWCNDHWC 等多种格式,输出 yx 格式一致,epsilon 由可选改为必选属性;同时新增 nchw-like 与 ndhwc-like 的 infer shape 单测。

  • BNInfer last-channel tiling 增加 UB 容量校验: 在 bn_infer_tiling_infer_last_channel_arch35.cppFillLastChannelTilingForBSplit 中新增 requiredUbBytesubSize 的容量判断,超出可用 UB 时返回 GRAPH_FAILED,并补充了 rejectLastChannelWhenChannelCacheExceedsUb 测试用例。

  • ApplyCamePart1 支持 batch 维度与标量 eps: 更新 apply_came_part1_proto.h 中 grad(rank ≥ 2,形如 [batch..., n, m])与三个输出的形状描述;删除 apply_came_part1_infershape_datatype.cpp 中独立的 InferDataType 实现,并新增 SupportsHigherRankBatchGradSupportsScalarEps 单测。

  • ApplyCamePart1 抽取公共数据拷贝函数: 在 apply_came_part1_common.h 中新增 CopyOutReductionWorkspaceApplyCamePart1,将 fp16 与 fp32 两个内核中重复的事件同步及 workspace 数据拷贝逻辑收敛到该公共函数。

  • InplaceApplyRMSProp 同步机制与属性调整: 在 inplace_apply_rms_prop.hLoadScalarF32 中用 MTE2_VV_S 事件同步替代 PipeBarrier,并用常量 kFp16CastAlignment 表达 fp16 转换对齐;tiling 单测中 use_locking 属性改为可选,新增缺省该属性时 tiling 仍成功的用例;golden.py 中该算子及 ApplyCamePart1 的测试容差标准均从 cross_check 改为 stat_rel_err

likedislike
atomgit-bot
atomgit-bot
3 小时前 评论:

代码审查

✅ 未发现问题

likedislike
CANN-robotCANN-robot成员
3 小时前 添加了label:cann-cla/yes
CANN-robot
CANN-robot成员
3 小时前 评论:

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

⚠️ This PR does not yet meet the following requirements:lgtm (requires ≥ 2 person(s) per module)、approve (requires ≥ 1 person(s) per module)

Module Approval Details

module lgtm status approve status
*/*/README.md ❌ (0/2)(You can also ask: 汤平川, 冯英, 蔡雯雯, 杨阳, 陈娇) ❌ (0/1)(You can also ask: 陈娇, 杜慧萍, 冯英, 蔡雯雯, 杨露)
*/*/op_graph/*_proto.h ❌ (0/2)(You can also ask: 汤磊, 范其瑞, 汤平川, 王永光, 陈琦) ❌ (0/1)(You can also ask: 王永光, 汤磊)
norm ❌ (0/2)(You can also ask: 唐玮玮, 杨阳, 曾娟, 王星, 刘波) ❌ (0/1)(You can also ask: 王瑞, 汤平川, 任如海, 王星, 刘杰)
optim ❌ (0/2)(You can also ask: 唐玮玮, 唐超, 钱泽洪, 陈风, 杨阳) ❌ (0/1)(You can also ask: 陈风, 王星, 苏跃明, 汤平川, 钱泽洪)

💡 Tip:

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

CLA Signature Pass

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

likedislike
CANN-robotCANN-robot成员
3 小时前 将zengjuan,chenfeng61,chaotang233,kevin_huang1234,crystalhu,yu-xinjie62,yangyang016,fanqirui,gitee-duhuiping,wangrui_,renruhai,su-yueming,zhajianqing123,tang-lei01,chenqi317,wang-xing001,liubo75,tangweiwei2,gitcode-chenjiao,liujie12345678,pingchuantang,Chen_HaoWen,qianzehong,wangyongguang,fengying555682,caiwenwen,yanglu-1设为评审人
此处折叠了10条事件消息 查看更多
CANN-robotCANN-robot成员
3 小时前 添加了label:cann-cla/yes
tianyu52成员
3 小时前 评论:

compile

likedislike
Ttianyu52成员
3 小时前 update merge request[project id: 7665709, iid: 9453, commit_id: 9fc9f48021f9fe56c9099dd69d8b249b9b3a31a0] virtual merging success
CANN-robotCANN-robot成员
3 小时前 添加了label:ci-pipeline-running
CANN-robot
CANN-robot成员
3 小时前 评论:

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

任务名称状态日志下载链接
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-28 17:43:23]    CI执行结束

likedislike
CANN-robot
CANN-robot成员
3 小时前 评论:

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

任务名称状态日志下载链接
antipoison ✅ SUCCESS >>>>>
codecheck_checkpr ✅ SUCCESS
codecheck_precommit ✅ SUCCESS >>>>>
SCA ✅ SUCCESS >>>>>
StaticCheck_md ⚠️ WARNING >>>>>

[2026-08-28 17:32:39]    CI执行结束

likedislike
CANN-robotCANN-robot成员
2 小时前 添加了label:api-check-pass
CANN-robotCANN-robot成员
2 小时前 删除了label:ci-pipeline-running
CANN-robotCANN-robot成员
2 小时前 添加了label:ci-pipeline-passed