已合并
aclnnLogAddExp2 950芯片私有数据格式拦截 #3653
aclnnLogAddExp2 950芯片私有数据格式拦截 #3653
已合并
zhangqijia1创建于 6月30日
zhangqijia1成员
6月30日

描述

aclnnLogAddExp2 950芯片私有数据格式拦截

关联的Issue

#2093

测试

文档更新

类型标签

likedislike
Pull Request已成功合入, 合并人@CANN-robot
(感谢 zhangqijia1 的贡献)
Zzhangqijia1成员
6月30日 创建了 pull request,commit 4abf4c88
CANN-robotCANN-robot成员
6月30日 添加了label:cann-cla/yes
CANN-robot
CANN-robot成员
6月30日 评论:

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


PR Approval Progress

Congratulations! All modules have met the lgtm and approve requirements.

Module Approval Details

module lgtm status approve status
math/log_add_exp 唐燕峰, 冯彤 (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

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

likedislike
zhangqijia1成员
6月30日 评论:

compile

likedislike
Zzhangqijia1成员
6月30日 update merge request[project id: 7649531, iid: 3653, commit_id: 7180bdc7ab66488df6ee022fbb41ffcf12c4a097] virtual merging success
atomgit-bot
atomgit-bot
6月30日 评论:

变更摘要

该 PR 为 aclnnLogAddExp2 算子增加了对 950 芯片私有数据格式的拦截逻辑。通过在 CheckParams 中引入新的 CheckFormat 函数,在 IsRegBase() 条件下严格校验输入和输出张量的存储格式一致性,并直接拒绝私有格式;同时将原有的宽松格式检查重命名为 WarnFormat,仅在非 950 芯片场景下以警告方式执行。

主要改动

  • 新增私有格式拦截函数 CheckFormat: 添加了静态函数 CheckFormat,校验 selfotherout 三者的存储格式是否一致,并调用 IsPrivateFormat 拒绝私有格式,仅在 950 芯片(IsRegBase() 为真)时生效。
  • CheckParams 中集成格式校验: 在 CheckParams 函数的参数空指针、数据类型、shape 检查之后,增加了对 IsRegBase() 的条件判断,若为真则调用新的 CheckFormat 进行严格格式校验。
  • CheckFormat 重命名为 WarnFormat 并调整调用条件: 将原先仅打印警告的 CheckFormat 函数重命名为 WarnFormat,并在 aclnnLogAddExp2GetWorkspaceSize 中增加 !IsRegBase() 的条件判断,使其仅在非 950 芯片场景下执行。
  • 新增头文件引用: 引入了 op_api/aclnn_check.h,为 IsRegBaseIsPrivateFormat 等宏或函数的调用提供声明。
likedislike
clinglai0517成员6月30日进行代码检视2
math/log_add_exp/op_api/aclnn_logaddexp2.cpp
@@ -140,0 +139,4 @@
139+{
140+ if (self->GetStorageFormat() != out->GetStorageFormat()) {
141+ OP_LOGE(
142+ ACLNN_ERR_PARAM_INVALID, "Format of self and output should be equal. self [%s], out [%s].",
clinglai05176月30日评论:

考虑使用error message打印错误日志?

likedislike
zhangqijia1成员
6月30日 评论:

950芯片使用拦截报错

CANN-robotCANN-robot成员
6月30日 添加了label:ci-pipeline-running
CANN-robot
CANN-robot成员
6月30日 评论:

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

任务名称状态日志下载链接
pre_comment ✅ SUCCESS >>>>>
Compile_Ascend_X86_ubuntu24 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_X86_mobile_station_ubuntu24 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_X86_experimental_ubuntu24 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_X86_A5_ubuntu24 ✅ SUCCESS >>>>> >>>>>
Compile_harmony-infer ✅ SUCCESS >>>>>
Compile_Ascend_ARM_ubuntu24 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_ARM_experimental_ubuntu24 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_single_ubuntu24 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_ARM_A5_ubuntu24 ✅ SUCCESS >>>>> >>>>>
Compile_X86_monitor_910b ✅ SUCCESS >>>>> >>>>>
Compile_X86_monitor_910c ✅ SUCCESS >>>>> >>>>>
Compile_X86_monitor_950 ✅ SUCCESS >>>>> >>>>>
Compile_harmony-infer-chs-math ✅ SUCCESS >>>>>
Compile_kirin-harmony-infer-chs-math-1 ✅ SUCCESS >>>>>
UT_Test ✅ SUCCESS
UT_Test_experimental ✅ SUCCESS
UT_Test_kernel ✅ SUCCESS
PreSmoke_A900 ✅ SUCCESS >>>>>
API_Check ✅ SUCCESS >>>>>
PreSmoke_ATK_Test_A2 ✅ SUCCESS >>>>>

[2026-06-30 19:31:22]    CI执行结束

likedislike
CANN-robot
CANN-robot成员
6月30日 评论:

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

任务名称状态日志下载链接
codecheck ✅ SUCCESS >>>>>
SCA ✅ SUCCESS >>>>>
antipoison ✅ SUCCESS >>>>>
codecheck_Pr ✅ SUCCESS
StaticCheck_codespell_check ✅ SUCCESS
StaticCheck_link_validity_check ✅ SUCCESS
StaticCheck_resource_existence_check ✅ SUCCESS
StaticCheck_tag_closed_check ✅ SUCCESS
StaticCheck_markdownlint ✅ SUCCESS
codecheck_codestyle ⚠️ WARNING >>>>>
codecheck_precommit ⚠️ WARNING >>>>> >>>>>

[2026-06-30 19:25:31]    CI执行结束

likedislike
atomgit-bot
atomgit-bot
6月30日 评论:

代码审查

✅ 未发现问题

likedislike
CANN-robotCANN-robot成员
6月30日 添加了label:api-check-pass
CANN-robotCANN-robot成员
6月30日 删除了label:ci-pipeline-running
CANN-robotCANN-robot成员
6月30日 添加了label:ci-pipeline-passed
Cclinglai0517成员
6月30日 解决了最后一个问题
Zzhangqijia1成员
6月30日 关联了issue:[Bug-Report|缺陷反馈]: aclnnLogAddExp2 950芯片私有数据格式未拦截
Zzhangqijia1成员
6月30日 修改了pull request 的描述
rxtfeng成员
6月30日 评论:

/approve

likedislike
CANN-robotCANN-robot成员
6月30日 添加了label:approved
FelixTang7成员
6月30日 评论:

/lgtm
/approve

likedislike
CANN-robotCANN-robot成员
6月30日 添加了label:lgtm
CANN-robotCANN-robot成员
6月30日 合入了pull request