Merged
fix: 修复GroupNormSilu校验与NaN、GeluBackward出参校验、SwiGluGrad错误码表 #13166
shiluluAdd on 22 days ago
fix: 修复GroupNormSilu校验与NaN、GeluBackward出参校验、SwiGluGrad错误码表 #13166
Merged
shiluluAdd on 22 days ago
shilulu
shiluluCollaborators
22 days ago

描述

fix: 修复GroupNormSilu校验与NaN、GeluBackward出参校验、SwiGluGrad错误码表

关联的Issue

关联Issue #7334 https://gitcode.com/cann/ops-nn/issues/7334
关联Issue #7316 https://gitcode.com/cann/ops-nn/issues/7316
关联Issue #7173 https://gitcode.com/cann/ops-nn/issues/7173
关联Issue #7157 https://gitcode.com/cann/ops-nn/issues/7157

测试

文档更新

更新了activation/swi_glu_grad/docs/aclnnSwiGluGrad.md文件

类型标签

AI/Agent生成声明

likedislike
Pull Request has been successfully merged by CANN-robot.
(Thank you for shilulu's contribution.)
shilulushiluluCollaborators
22 days ago Created pull request, commit 9fa06a02
atomgit-bot
atomgit-bot
22 days ago Comments:

变更摘要

本次变更主要围绕 group_norm_silu 算子的数值稳定性与参数校验进行清理性修复,同时对 gelu 反向算子的出参数据类型校验做补齐。在 kernel 侧,涉及 GroupNormSilu 的各模板实现统一将方差计算拆出并做非负钳位,避免浮点抵消导致 sqrt 产生 NaN;在 host 侧,aclnnGroupNormSilu 增加非 RegBase 平台上 gamma/beta 单侧为空时的等效 dtype 一致性校验,aclnnGeluBackward 增加对出参 gradInput 的 dtype 支持列表检查。

主要改动

  • group_norm_silu 方差非负钳位:在 group_norm_silu_b16.h、group_norm_silu_b32.h、group_norm_silu_g16.h、group_norm_silu_g32.h、group_norm_silu_hw1_b16.h、group_norm_silu_hw1_b32.h、group_norm_silu_sd.h、group_norm_silu_small_b16.h、group_norm_silu_small_b32.h 的各 Compute* 路径中,将 rstd * numRec - mean * mean 提取为 var 并在为负时置 0,再与 tiling->epsilon 相加后取倒数平方根,避免数值异常输出。
  • gamma/beta 等效 dtype 校验:aclnn_group_norm_silu.cpp 的 CheckDtypeValid 新增分支,在非 IsRegbase 平台且 gamma、beta 之一为空时,按空侧补齐为 self dtype 的规则比较两者等效 dtype,不一致则返回 ACLNN_ERR_PARAM_INVALID 并上报 EZ0021 错误信息。
  • aclnnGeluBackward 出参 dtype 校验:aclnn_gelu_backward.cpp 的 CheckPromoteType 恢复使用 gradInput 形参并新增 OP_CHECK_DTYPE_NOT_SUPPORT(gradInput, DTYPE_SUPPORT_LIST, return false),使出参数据类型不合法时提前以参数错误返回。
  • 注释与文件尾修正:同步更新 aclnn_gelu_backward.cpp 中关于参数检查步骤的注释说明,并为多个 group_norm_silu kernel 头文件补上缺失的文件末尾换行。

🧩 本次 Review 已使用自定义 Skill:

likedislike
Incorrect?
atomgit-bot
atomgit-bot
22 days ago Comments:

代码审查

✅ 未发现问题


🧩 本次 Review 已使用自定义 Skill:

likedislike
Incorrect?
CANN-robotCANN-robotCollaborators
22 days ago Added label: stat/needs-squash
CANN-robotCANN-robotCollaborators
22 days ago Added label: cann-cla/yes
CANN-robot
CANN-robotCollaborators
22 days ago 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
*/*/docs/acl*.md ✅ 冯英, 查建青, 杨东 (3/2) ✅ 冯英 (1/1)
activation ✅ 杨东, 查建青 (2/2) ✅ 杨东 (1/1)
norm ✅ 杨东, 查建青 (2/2) ✅ 杨东 (1/1)

💡 Tip:

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

CLA Signature Pass

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

likedislike
shilulu
shiluluCollaborators
22 days ago Comments:

compile

likedislike
CANN-robotCANN-robotCollaborators
22 days ago Set zengjuan,u010470851,chaotang233,kevin_huang1234,crystalhu,yangyang016,fanqirui,gitee-duhuiping,wangrui_,renruhai,su-yueming,zhajianqing123,yourealize,chenqi317,wang-xing001,liubo75,tangweiwei2,gitcode-chenjiao,chenxingyu18,liujie12345678,east_yang,pingchuantang,Chen_HaoWen,qianzehong,fengying555682,caiwenwen,yanglu-1 as approver
CANN-robotCANN-robotCollaborators
22 days ago Set u010470851,kevin_huang1234,gitee-duhuiping,wangrui_,renruhai,su-yueming,zhajianqing123,yourealize,wang-xing001,gitcode-chenjiao,chenxingyu18,liujie12345678,east_yang,pingchuantang,Chen_HaoWen,qianzehong,fengying555682,caiwenwen,yanglu-1 as approver
shilulushiluluCollaborators
22 days ago Pre merge succeeded (commit_id: f5423b266d071e62d4a7447642396328e5e7b3ee)
CANN-robot
CANN-robotCollaborators
22 days ago Comments:
🚀 CI 流水线已启动
📋 执行详情: 点击查看流水线
likedislike
CANN-robotCANN-robotCollaborators
22 days ago Added label: ci-pipeline-running
8 event messages are collapsed here。 See more
shilulushiluluCollaborators
22 days ago Modify description of pull request
fengying555682
fengying555682Collaborators
22 days ago Comments:

/lgtm
/approve

likedislike
east_yang
east_yangCollaborators
22 days ago Comments:

/lgtm
/approve

likedislike
CANN-robotCANN-robotCollaborators
22 days ago Added label: approved
zhajianqing123
zhajianqing123Collaborators
22 days ago Comments:

/lgtm

likedislike
CANN-robotCANN-robotCollaborators
22 days ago Added label: lgtm
CANN-robotCANN-robotCollaborators
22 days ago Closed associated issue
CANN-robotCANN-robotCollaborators
22 days ago Merged pull request