Pull Request已成功合入, 合并人@CANN-robot
(感谢 hahaha22 的贡献)变更摘要
本 PR 为 5 个算子的 SoC 版本区间判断追加 Ops::NN::AclnnUtil::IsRegbase() 条件,使 ascend350(RegBase/DAV_3510)平台在 GetSocVersion() 处于 ASCEND910B~ASCEND910E 区间之外时,也能走 910B 支持分支(bf16 dtype 支持逻辑)。涉及 logsoftmaxv2、softmaxgrad、logsoftmaxgrad、batchNormElemt、batchNormGradV3 五个算子,同时为其中三个文件补充 op_api/aclnn_util.h 头文件引入,并修正 batchNormGradV3 中一处疑似笔误的恒真判断条件。
主要改动
CheckSocVersionIsSupportBf16()追加IsRegbase():在aclnn_logsoftmax_backward.cpp、aclnn_log_softmax.cpp、aclnn_softmax_backward.cpp中,将原910B <= version <= 910E的返回条件改为(910B <= version <= 910E) || Ops::NN::AclnnUtil::IsRegbase(),使 ascend350 平台也能返回 bf16 支持。batchNormElemtdtype 支持列表判断追加IsRegbase():在aclnn_batch_norm_elemt.cpp的CheckDtypeValid中,原有ASCEND910B~910E或ASCEND950的判断基础上追加Ops::NN::AclnnUtil::IsRegbase(),决定选用ASCEND910B_DTYPE_SUPPORT_LIST。- 修正
batchNormGradV3恒真条件并追加IsRegbase():在aclnn_fast_batch_norm_backward.cpp的GetDtypeSupportList()中,将原>= ASCEND910B || <= ASCEND910E(恒真,疑似笔误)修正为&&,并追加|| Ops::NN::AclnnUtil::IsRegbase(),使该算子返回ASCEND910B_DTYPE_DTYPE_SUPPORT_LIST的条件与其余算子一致。 - 补充头文件引入:为
aclnn_log_softmax.cpp、aclnn_batch_norm_elemt.cpp、aclnn_fast_batch_norm_backward.cpp补充#include "op_api/aclnn_util.h",以支持调用Ops::NN::AclnnUtil::IsRegbase()。


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 |
|---|---|---|
| activation | ✅ 钱泽洪, 王星 (2/2) | ✅ 钱泽洪, 王星 (2/1) |
| norm | ✅ 钱泽洪, 王星 (2/2) | ✅ 钱泽洪, 王星 (2/1) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)
CLA Signature Pass
hahaha22, thanks for your pull request. All authors of the commits have signed the CLA. 👍


/lgtm
/approve


Pull Request 已合并或已关闭。
If you want to solve this problem, you can click here to do it in the FAQs.


描述
以 RegBase 架构(NpuArch = DAV_3510,含 Ascend950 及后续 Regbase 芯片)兼容为目标,统一两类芯片判断写法:
GetSocVersion() >= ASCEND910B && GetSocVersion() <= ASCEND910E区间判断追加|| Ops::NN::AclnnUtil::IsRegbase(),使 RegBase 平台在 SocVersion 区间之外时也走 910B 支持分支IsArch3510)实现改为IsRegbase(),后续 Regbase 芯片无需逐文件修改修改内容一:区间判断追加(4 个文件,4 处)
CheckSocVersionIsSupportBf16追加IsRegbase();补 includeIsRegbase()并删除冗余== SocVersion::ASCEND950;补 include关于删除
== SocVersion::ASCEND950的说明SocVersion枚举中ASCEND950 = ASCEND910_95(值 3)位于ASCEND910B(1)与ASCEND910E(4)之间,区间判断本已覆盖 950,原|| == ASCEND950分支从不单独生效;且 Ascend950 的 NpuArch 即 DAV_3510,IsRegbase()对 950 同样为真。净效果为纯扩展,存量平台无收窄。修改内容二:硬编码判断统一(1 个文件,1 处)
IsArch3510()函数体改为Ops::NN::AclnnUtil::IsRegbase()(调用点不动)范围说明
IsSocVersion950()统一改名并实现为IsRegbase(),本次不改,与 upstream 保持零 diff关联的Issue
测试
== ASCEND950等价、layerNormV4 的 950 分支行为不变)文档更新
无
类型标签
关联issue