已合并
refactor: 将arch35算子kernel中MicroAPI接口统一迁移为Reg接口 #4187
tianqiguang创建于 23 天前
refactor: 将arch35算子kernel中MicroAPI接口统一迁移为Reg接口 #4187
已合并
tianqiguang创建于 23 天前
tianqiguang成员
23 天前

描述

将 math 模块下 80+ 算子的 arch35 kernel 实现从 MicroAPI 接口迁移为 Reg(寄存器)接口,统一编程范式。

改动范围

涉及算子: abs, abs_grad, add_n, adjacent_difference, arg_max_with_value, assign_add, assign_sub, atan2, bitwise_xor, cast, cdist, cdist_grad, ceil, complex_abs, cummin, cumsum, div, dot, exp, eye, floor, floor_div, floor_mod, fused_mul_add_n, grouped_bias_add_grad, inv, is_close, kth_value, lerp, lin_space, log, log1p, logical_or, mod, nan_to_num, neg, pow, power, reciprocal, reduce_all, reduce_any, reduce_log_sum_exp, reduce_nansum, reduce_prod, reduce_var, right_shift, rint, round, rsqrt, rsqrt_grad, sign, signbit, sinh, sort, sort_with_index, tanh, tanh_grad, tensor_equal, top_k_v2, trunc, truncate_div 等

改动方式

  • 将 MicroAPI 调用替换为等价 Reg API 调用
  • 适配 arch35(ascend950)指令集特性
  • 保持算子功能不变

测试

  • 涉及算子全量回归测试

类型标签

  • 重构

关联的Issue

  • #2295
likedislike
Pull Request已成功合入, 合并人@CANN-robot
(感谢 tianqiguang 的贡献)
Ttianqiguang成员
23 天前 创建了 pull request,commit 02e2901a
atomgit-bot
atomgit-bot
23 天前 评论:

🤖 正在生成合并请求摘要,请稍候…

likedislike
atomgit-bot
atomgit-bot
23 天前 评论:

🤖 AI 代码检视正在进行中,请稍候…

likedislike
CANN-robotCANN-robot成员
23 天前 添加了label:cann-cla/yes
CANN-robot
CANN-robot成员
23 天前 评论:

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/abs 宋恺, 王林木 (2/2) 王林木, 宋恺 (2/1)
math/arg_max_with_value 王林木, 宋恺 (2/2) 宋恺, 王林木 (2/1)
math/atan2 王林木, 宋恺 (2/2) 王林木, 宋恺 (2/1)
math/bitwise_xor 王林木, 宋恺 (2/2) 王林木, 宋恺 (2/1)
math/cast 宋恺, 王林木 (2/2) 王林木, 宋恺 (2/1)
math/ceil 宋恺, 王林木 (2/2) 宋恺, 王林木 (2/1)
math/cummin 王林木, 宋恺 (2/2) 王林木, 宋恺 (2/1)
math/cumsum 王林木, 宋恺 (2/2) 王林木, 宋恺 (2/1)
math/div 宋恺, 王林木 (2/2) 王林木, 宋恺 (2/1)
math/dot 王林木, 宋恺 (2/2) 王林木, 宋恺 (2/1)
math/exp 宋恺, 王林木 (2/2) 王林木, 宋恺 (2/1)
math/eye 王林木, 宋恺 (2/2) 宋恺, 王林木 (2/1)
math/floor 王林木, 宋恺 (2/2) 王林木, 宋恺 (2/1)
math/floor_div 王林木, 宋恺 (2/2) 王林木, 宋恺 (2/1)
math/floor_mod 王林木, 宋恺 (2/2) 王林木, 宋恺 (2/1)
math/is_close 宋恺, 王林木 (2/2) 宋恺, 王林木 (2/1)
math/lerp 宋恺, 王林木 (2/2) 宋恺, 王林木 (2/1)
math/lin_space 王林木, 宋恺 (2/2) 王林木, 宋恺 (2/1)
math/log 王林木, 宋恺 (2/2) 王林木, 宋恺 (2/1)
math/logical_or 王林木, 宋恺 (2/2) 宋恺, 王林木 (2/1)
math/mod 王林木, 宋恺 (2/2) 王林木, 宋恺 (2/1)
math/nan_to_num 宋恺, 王林木 (2/2) 宋恺, 王林木 (2/1)
math/neg 宋恺, 王林木 (2/2) 宋恺, 王林木 (2/1)
math/pow 王林木, 宋恺 (2/2) 王林木, 宋恺 (2/1)
math/reciprocal 宋恺, 王林木 (2/2) 王林木, 宋恺 (2/1)
math/reduce_all 宋恺, 王林木 (2/2) 宋恺, 王林木 (2/1)
math/reduce_any 王林木, 宋恺 (2/2) 王林木, 宋恺 (2/1)
math/reduce_log_sum_exp 王林木, 宋恺 (2/2) 王林木, 宋恺 (2/1)
math/reduce_nansum 王林木, 宋恺 (2/2) 王林木, 宋恺 (2/1)
math/reduce_prod 王林木, 宋恺 (2/2) 王林木, 宋恺 (2/1)
math/right_shift 王林木, 宋恺 (2/2) 王林木, 宋恺 (2/1)
math/round 王林木, 宋恺 (2/2) 宋恺, 王林木 (2/1)
math/rsqrt 王林木, 宋恺 (2/2) 王林木, 宋恺 (2/1)
math/sign 宋恺, 王林木 (2/2) 王林木, 宋恺 (2/1)
math/sinh 宋恺, 王林木 (2/2) 宋恺, 王林木 (2/1)
math/sort 王林木, 宋恺 (2/2) 王林木, 宋恺 (2/1)
math/tanh 王林木, 宋恺 (2/2) 王林木, 宋恺 (2/1)
math/tanh_grad 宋恺, 王林木 (2/2) 王林木, 宋恺 (2/1)
math/trunc 王林木, 宋恺 (2/2) 王林木, 宋恺 (2/1)
repo-cann/ops-math 王林木, 宋恺 (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

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

likedislike
CANN-robotCANN-robot成员
23 天前 将FelixTang7,zhou-qilong,wangrui_,su-yueming,rxtfeng,loov1,zhangzijie,jia0liang,zl_hw,liu-wei,LiWei79,songkai111,llimwang,gubaocheng,andong_hw,xuejinghui,zhanw_coding设为评审人
CANN-robotCANN-robot成员
23 天前 将FelixTang7,zhou-qilong,wangrui_,su-yueming,rxtfeng,loov1,zhangzijie,jia0liang,zl_hw,liu-wei,LiWei79,songkai111,llimwang,gubaocheng,andong_hw,xuejinghui,zhanw_coding设为审查人
tianqiguang成员
23 天前 评论:

compile

likedislike
Ttianqiguang成员
23 天前 update merge request[project id: 7649531, iid: 4187, commit_id: 6e71fd9ededab29b0180b3115834c97cd77cff62] virtual merging success
atomgit-bot
atomgit-bot
23 天前 评论:

⚠️ 本次变更过大(119 个文件、10435 行),已超出 AI 代码评审的处理范围,本次跳过。建议拆分为更小的 PR 以获得有效评审。

likedislike
atomgit-bot
atomgit-bot
23 天前 评论:

⚠️ 本次变更过大(119 个文件、10435 行),已超出 AI 代码评审的处理范围,本次跳过。建议拆分为更小的 PR 以获得有效评审。

likedislike
CANN-robotCANN-robot成员
23 天前 添加了label:ci-pipeline-running
CANN-robot
CANN-robot成员
23 天前 评论:

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

任务名称状态日志下载链接
pre_comment ✅ SUCCESS >>>>>
Compile_Ascend_X86_ubuntu24 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_X86_mobile_station_ubuntu24 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_X86_experimental_ubuntu24 ✅ SUCCESS >>>>> >>>>>
Compile_harmony-infer ✅ SUCCESS >>>>>
Compile_Ascend_ARM_ubuntu24 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_ARM_experimental_ubuntu24 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_single_ubuntu24 ✅ SUCCESS >>>>> >>>>>
Compile_X86_monitor_910b ✅ SUCCESS >>>>> >>>>>
Compile_X86_monitor_910c ✅ SUCCESS >>>>> >>>>>
Compile_X86_monitor_950 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_X86_A5_ubuntu24 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_ARM_A5_ubuntu24 ❌ FAILED >>>>>
Compile_Ascend_X86_mobile_station_9030_ubuntu24 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_single ✅ SUCCESS >>>>> >>>>>
likedislike
CANN-robot
CANN-robot成员
23 天前 评论:

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

任务名称状态日志下载链接
SCA ✅ SUCCESS >>>>>
antipoison ✅ SUCCESS >>>>>
codecheck_Pr ✅ SUCCESS
StaticCheck_codespell ✅ SUCCESS
StaticCheck_link_validity ✅ SUCCESS
StaticCheck_resource_existence ✅ SUCCESS
StaticCheck_tag_closed ✅ SUCCESS
StaticCheck_markdownlint ✅ SUCCESS
codecheck_codestyle ⚠️ WARNING >>>>>
codecheck_precommit ❌ FAILED >>>>> >>>>>
likedislike
Ttianqiguang成员
23 天前 update merge request[project id: 7649531, iid: 4187, commit_id: 8245ad8582cac12e731434e091318e04d27d6a72] virtual merging success
Ttianqiguang成员
23 天前 强制推送  1 个提交:1460d896-将MicroApi命名改为Reg
Ttianqiguang成员
23 天前 update merge request[project id: 7649531, iid: 4187, commit_id: ce2148263c5b04767e7aeac47cff3561d516a070] virtual merging success
CANN-robotCANN-robot成员
23 天前 删除了label:ci-pipeline-running
CANN-robotCANN-robot成员
23 天前 添加了label:ci-pipeline-failed
tianqiguang成员
23 天前 评论:

compile

likedislike
Ttianqiguang成员
23 天前 update merge request[project id: 7649531, iid: 4187, commit_id: c185d6430ba6eb074670eed8fbca4fc5e56883b1] virtual merging success
CANN-robotCANN-robot成员
23 天前 删除了label:ci-pipeline-failed
CANN-robotCANN-robot成员
23 天前 添加了label:ci-pipeline-running
CANN-robot
CANN-robot成员
23 天前 评论:

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

任务名称状态日志下载链接
pre_comment ✅ SUCCESS >>>>>
Compile_Ascend_X86_ubuntu24 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_X86_mobile_station_ubuntu24 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_X86_experimental_ubuntu24 ✅ SUCCESS >>>>> >>>>>
Compile_harmony-infer ✅ SUCCESS >>>>>
Compile_Ascend_ARM_ubuntu24 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_ARM_experimental_ubuntu24 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_single_ubuntu24 ✅ SUCCESS >>>>> >>>>>
Compile_X86_monitor_910b ✅ SUCCESS >>>>> >>>>>
Compile_X86_monitor_910c ✅ SUCCESS >>>>> >>>>>
Compile_X86_monitor_950 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_X86_A5_ubuntu24 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_ARM_A5_ubuntu24 ❌ FAILED >>>>>
Compile_Ascend_X86_mobile_station_9030_ubuntu24 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_single ✅ SUCCESS >>>>> >>>>>
likedislike
CANN-robot
CANN-robot成员
23 天前 评论:

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

任务名称状态日志下载链接
SCA ✅ SUCCESS >>>>>
antipoison ✅ SUCCESS >>>>>
codecheck_Pr ✅ SUCCESS
StaticCheck_codespell ✅ SUCCESS
StaticCheck_link_validity ✅ SUCCESS
StaticCheck_resource_existence ✅ SUCCESS
StaticCheck_tag_closed ✅ SUCCESS
StaticCheck_markdownlint ✅ SUCCESS
codecheck_codestyle ⚠️ WARNING >>>>>
codecheck_precommit ✅ SUCCESS >>>>>

[2026-07-22 14:32:08]    CI执行结束

likedislike
CANN-robotCANN-robot成员
23 天前 删除了label:ci-pipeline-running
CANN-robotCANN-robot成员
23 天前 添加了label:ci-pipeline-failed
cui_jiahao成员
22 天前 评论:

compile

likedislike
Ttianqiguang成员
22 天前 update merge request[project id: 7649531, iid: 4187, commit_id: 8b4c0d071e7e27aeaef2afab522deffc07f3dec1] virtual merging success
cui_jiahao成员
22 天前 评论:

compile

likedislike
CANN-robotCANN-robot成员
22 天前 删除了label:ci-pipeline-failed
CANN-robotCANN-robot成员
22 天前 添加了label:ci-pipeline-running
CANN-robotCANN-robot成员
22 天前 删除了label:ci-pipeline-running
CANN-robot
CANN-robot成员
22 天前 评论:

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

任务名称状态日志下载链接
antipoison ✅ SUCCESS >>>>>
codecheck_Pr ✅ SUCCESS
StaticCheck_codespell ✅ SUCCESS
StaticCheck_link_validity ✅ SUCCESS
StaticCheck_resource_existence ✅ SUCCESS
StaticCheck_tag_closed ✅ SUCCESS
StaticCheck_markdownlint ✅ SUCCESS
codecheck_precommit ✅ SUCCESS >>>>>

[2026-07-23 09:44:49]    CI执行结束

likedislike
CANN-robotCANN-robot成员
22 天前 添加了label:ci-pipeline-running
CANN-robot
CANN-robot成员
22 天前 评论:

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

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

[2026-07-23 12:17:45]    CI执行结束

likedislike
CANN-robot
CANN-robot成员
22 天前 评论:

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

任务名称状态日志下载链接
SCA ✅ SUCCESS >>>>>
antipoison ✅ SUCCESS >>>>>
codecheck_Pr ✅ SUCCESS
StaticCheck_codespell ✅ SUCCESS
StaticCheck_link_validity ✅ SUCCESS
StaticCheck_resource_existence ✅ SUCCESS
StaticCheck_tag_closed ✅ SUCCESS
StaticCheck_markdownlint ✅ SUCCESS
codecheck_codestyle ⚠️ WARNING >>>>>
codecheck_precommit ✅ SUCCESS >>>>>

[2026-07-23 09:48:09]    CI执行结束

likedislike
CANN-robotCANN-robot成员
22 天前 添加了label:api-check-pass
CANN-robotCANN-robot成员
22 天前 删除了label:ci-pipeline-running
CANN-robotCANN-robot成员
22 天前 添加了label:ci-pipeline-passed
Ttianqiguang成员
22 天前 修改标题为 “refactor: 将arch35算子kernel中MicroAPI接口统一迁移为Reg接口”,原标题为“修改MicroAPI接口为Reg”
Ttianqiguang成员
22 天前 修改了pull request 的描述
songkai111成员
22 天前 评论:

/lgtm
/approve

likedislike
CANN-robotCANN-robot成员
22 天前 添加了label:approved
llimwang成员
22 天前 评论:

/approve

likedislike
CANN-robotCANN-robot成员
22 天前 添加了label:lgtm
CANN-robotCANN-robot成员
22 天前 关闭了关联的issue
CANN-robotCANN-robot成员
22 天前 合入了pull request