Pull Request has been successfully merged by CANN-robot.
(Thank you for shilulu's contribution.)变更摘要
本次变更主要围绕 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之一为空时,按空侧补齐为selfdtype 的规则比较两者等效 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_silukernel 头文件补上缺失的文件末尾换行。
🧩 本次 Review 已使用自定义 Skill:




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
/approveor/lgtm- Commenting
/approveimplies 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. 👍


compile


| 🚀 CI 流水线已启动 |
|---|
| 📋 执行详情: 点击查看流水线 |


/lgtm
/approve


/lgtm
/approve


/lgtm


描述
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生成声明