已合并
add logit A5 #1097
LSYlsy0214创建于 1月28日
add logit A5 #1097
已合并
LSYlsy0214创建于 1月28日
LSYlsy0214
1月28日

描述

logit算子新增支持A5

关联的Issue

https://gitcode.com/cann/ops-nn/issues/574

测试

文档更新

类型标签

likedislike
Pull Request已成功合入, 合并人@CANN-robot
(感谢 LSYlsy0214 的贡献)
CANN-robot
CANN-robot成员
1月28日 评论:

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

likedislike
CANN-robot
CANN-robot成员
1月28日 评论:

以下是根据您提交的修改文件推荐的Reviewer和Committer序列,需各模块评审通过后方可合入

Module List Reviewers Committers
*/*/op_host/*_def.cpp N/A wangyongguang, tang-lei01
scripts N/A fanqirui, tangweiwei2, chenqi317, liubo75, crystalhu
loss N/A zhou-qilong, zhang-wu, yu-xinjie62, tangweiwei2, chenqi317
likedislike
CANN-robotCANN-robot成员
1月28日 将crystalhu,yu-xinjie62,fanqirui,zhou-qilong,chenqi317,liubo75,tangweiwei2,wangyongguang,zhang-wu设为审查人
CANN-robotCANN-robot成员
1月28日 添加了label:cann-cla/yes
CANN-robot
CANN-robot成员
1月28日 评论:

🔵 source code change are detected, tasks labels is removed in this pull request!

likedislike
CANN-robot
CANN-robot成员
1月28日 评论:

CLA Signature Pass

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

likedislike
LSYlsy0214
1月28日 评论:

compile

likedislike
CANN-robot
CANN-robot成员
1月28日 评论:

问题/功能描述

本次PR主要为Logit算子新增对Ascend 910_95芯片架构的硬件支持,解决了该算子原先无法在此新硬件平台上运行的问题。通过扩展算子的硬件兼容性,确保了相关计算任务能在更多类型的设备上正确执行。

修改方案描述

修改方案主要包括配置扩展和代码适配两部分。首先,新增了针对ascend910_95架构的算子配置文件(logit_binary.json)和简化键定义(logit_simplified_key.ini),并更新了硬件配置映射文件(ascendc_config.json),将ascend910_95加入Logit算子的支持计算单元列表。其次,在算子内核代码(logit.cpp)和定义文件(logit_def.cpp)中修改了编译宏和架构列表,确保内核能在新架构上正确编译和识别。

likedislike
LSYlsy0214
1月28日 评论:

compile

likedislike
LLSYlsy0214
1月28日 修改了pull request 的描述
CANN-robotCANN-robot成员
1月28日 添加了label:ci-pipeline-running
CANN-robot
CANN-robot成员
1月28日 评论:

流水线任务触发成功,任务链接 [ca2838274c954328ae8d8af5bbd46856]

任务名称状态日志下载链接
codecheck ✅ SUCCESS >>>>>
anti_virus ✅ SUCCESS >>>>>
Check_Pr ✅ SUCCESS >>>>>
Compile_Ascend_X86 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_X86_mobile_station ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_ARM ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_single ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_experimental ✅ SUCCESS >>>>> >>>>>
API_Check ✅ SUCCESS >>>>>
UT_Test_ophost ✅ SUCCESS
UT_Test_opapi ✅ SUCCESS
UT_Test_kernel ✅ SUCCESS
Smoke_A900 ✅ SUCCESS >>>>> >>>>>

[2026-01-28 16:43:59]    CI执行结束

likedislike
CANN-robotCANN-robot成员
1月28日 添加了label:api-check-pass
CANN-robot
CANN-robot成员1月28日进行代码检视1
loss/logit/op_host/logit_def.cpp
@@ -39,6 +39,7 @@ public:
3939 
4040 this->AICore().AddConfig("ascend910b");
4141 this->AICore().AddConfig("ascend910_93");
42+ this->AICore().AddConfig("ascend910_95");
CANN-robot
CANN-robot1月28日评论:

代码结构与可维护性: 新增的配置项 'ascend910_95' 与现有配置项 'ascend910_93' 在命名上存在不一致性,缺乏明确的语义解释。'ascend910_93' 和 'ascend910_95' 看起来像是特定芯片型号或版本的内部代号,但未在代码中提供任何注释说明其含义、区别或使用场景。这种使用未解释的魔数(此处为字符串魔数)作为配置标识符的做法,降低了代码的可读性和可维护性,增加了后续维护人员理解代码意图的难度。

问题类型: 代码结构与可维护性
文件路径: loss/logit/op_host/logit_def.cpp
行号: 42
问题代码:

this->AICore().AddConfig("ascend910_95");

修改建议:

1. 为这些配置字符串定义有意义的命名常量,并添加清晰的注释说明每个配置对应的具体硬件型号、架构版本或特性支持。例如:
   constexpr const char* kConfigAscend910B = "ascend910b";
   constexpr const char* kConfigAscend910V93 = "ascend910_93"; // 注释:Ascend 910, version 9.3
   constexpr const char* kConfigAscend910V95 = "ascend910_95"; // 注释:Ascend 910, version 9.5
   然后在代码中使用这些常量。
2. 如果这些配置项有特定的依赖关系或使用限制,应在注释中一并说明。
3. 考虑是否需要一个集中的配置定义文件来管理所有AICore支持的配置,以提高一致性和可维护性。

此评论由代码审查工具自动生成

likedislike
LLSYlsy0214
1月28日 修改了pull request 的描述
此处折叠了5条事件消息 查看更多
CANN-robotCANN-robot成员
1月28日 添加了label:ci-pipeline-passed
於欣洁成员
1月28日 评论:

/lgtm

likedislike
wangyongguang成员
1月28日 评论:

/approve

likedislike
范其瑞
范其瑞成员
1月28日 评论:

/lgtm

likedislike
范其瑞
范其瑞成员
1月28日 评论:

/approve

likedislike
CANN-robotCANN-robot成员
1月28日 添加了label:approved
胡碧霞成员
1月28日 评论:

/approve

likedislike
CANN-robotCANN-robot成员
1月28日 添加了label:lgtm
CANN-robot
CANN-robot成员
1月28日 评论:

Review Guide

This Pull-Request Passes Review.
Committers who wrote a comment of /approve are: wangyongguang, crystalhu, fanqirui.
Reviewers who wrote a comment of /lgtm are: wangyongguang, yu-xinjie62, fanqirui, crystalhu.

likedislike
CANN-robotCANN-robot成员
1月28日 合入了pull request