Merged
feat(apply_adam_v2): 启用自动生成的 ACLNN 接口 #14078
feat(apply_adam_v2): 启用自动生成的 ACLNN 接口 #14078
Merged
陈展熹Add on 12 days ago
陈展熹
陈展熹Collaborators
12 days ago

描述

为 ApplyAdamV2 启用自动生成的 ACLNN 接口,供 TorchNPU 在 Ascend950 上通过 op_api 调用。

将 optim/apply_adam_v2/CMakeLists.txt 中的 ACLNNTYPE aclnn_exclude 改为 ACLNNTYPE aclnn。生成接口为:

  • aclnnApplyAdamV2GetWorkspaceSize
  • aclnnApplyAdamV2

配套 op-plugin PR:https://gitcode.com/Ascend/op-plugin/pull/6194 。建议先提供本 PR 生成的 ACLNN 接口,再启用配套 TorchNPU 的 950 通路。

关联的Issue

#7494。

测试

  • 启用相同 ACLNN 生成配置后,CMake 配置及 opapi_nn 构建成功,确认导出上述两个符号。
  • 自动生成接口的 ABI 与算子 IR 一致:12 个 Tensor 输入(前 3 个为原地更新的 var/m/v)、adamMode 属性及 workspace/executor 参数。
  • 在 Ascend950PR_9579、CANN 9.2 上,直接 ACLNN 调用的 14 组数值用例通过。
  • 集成配套 op-plugin 后,完成 TorchNPU wheel 编译和隔离安装,公开 Python 接口测试结果为 Ran 5 tests / OK,0 失败、0 错误、0 跳过。
  • 执行日志确认 npu_bert_apply_adam_out → aclnnApplyAdamV2 EXEC_NPU_CMD,覆盖 FP16/FP32、默认参数、Adam/mBART 以及原地更新。
  • 本次设备测试使用新生成的 ACLNN 接口库和本机 CANN 9.2 已安装的 kernel;当前工作树 kernel 未重新编译,Ascend350 未作设备实测。
  • git diff --check 通过。

文档更新

不涉及。

类型标签

AI/Agent生成声明

likedislike
Pull Request has been successfully merged by CANN-robot.
(Thank you for 陈展熹's contribution.)
陈展熹陈展熹Collaborators
12 days ago Created pull request, commit 5f1c4ecf
atomgit-bot
atomgit-bot
12 days ago Comments:

变更摘要

本次变更聚焦于 optim/apply_adam_v2 算子的 ACLNN 接口生成配置:将 CMakeLists.txt 中的算子类型由 aclnn_exclude 调整为 aclnn,使 ApplyAdamV2 参与自动生成的 ACLNN 接口构建,供 TorchNPU 在 Ascend950 上通过 op_api 调用。

主要改动

  • 启用 ACLNN 接口生成:optim/apply_adam_v2/CMakeLists.txt 中的 ACLNNTYPE 配置由 aclnn_exclude 改为 aclnn,使 ApplyAdamV2 从“排除生成”变为“参与生成”。
  • 对外导出接口:该配置下生成并导出 aclnnApplyAdamV2GetWorkspaceSize 与 aclnnApplyAdamV2 两个 ACLNN 接口,供上层 op_api 调用。
  • 接口形态与算子 IR 对齐:生成接口保持与算子 IR 一致的 ABI,即 12 个 Tensor 输入(前 3 个为原地更新的 var/m/v)、adamMode 属性以及 workspace/executor 参数。

🧩 本次 Review 已使用自定义 Skill:

likedislike
Incorrect?
atomgit-bot
atomgit-bot
12 days ago Comments:

代码审查

✅ 未发现问题


🧩 本次 Review 已使用自定义 Skill:

likedislike
Incorrect?
CANN-robotCANN-robotCollaborators
12 days ago Added label: cann-cla/yes
CANN-robot
CANN-robotCollaborators
12 days ago Comments:

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
optim ✅ 汤平川, 上官秦南 (2/2) ✅ 汤平川 (1/1)

💡 Tip:

  • Committer can comment /approve or /lgtm
  • Commenting /approve implies both code review (lgtm) and intent to merge (approve)

CLA Signature Pass

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

likedislike
CANN-robotCANN-robotCollaborators
12 days ago Set zengjuan,u010470851,chenfeng61,chaotang233,crystalhu,yu-xinjie62,yangyang016,fanqirui,su-yueming,chenqi317,wang-xing001,liubo75,tangweiwei2,east_yang,pingchuantang,qianzehong as approver
CANN-robotCANN-robotCollaborators
12 days ago Set u010470851,chenfeng61,yu-xinjie62,su-yueming,wang-xing001,east_yang,pingchuantang,qianzehong as approver
陈展熹陈展熹Collaborators
12 days ago Modify description of pull request
陈展熹
陈展熹Collaborators
11 days ago Comments:

compile

likedislike
陈展熹陈展熹Collaborators
11 days ago Pre merge succeeded (commit_id: f383c261c6aec3c7c63ac37749ed04c58d6163ab)
CANN-robot
CANN-robotCollaborators
11 days ago Comments:
🚀 CI 流水线已启动
📋 执行详情: 点击查看流水线
likedislike
CANN-robotCANN-robotCollaborators
11 days ago Added label: ci-pipeline-running
CANN-robotCANN-robotCollaborators
11 days ago Removed label: ci-pipeline-running
CANN-robotCANN-robotCollaborators
11 days ago Added label: ci-pipeline-passed
yuning_chen
yuning_chenCollaborators
11 days ago Comments:

您好,pr合入已准备就绪,请尽快联系committer进行检视,谢谢!
@yangyang016 @yu-xinjie62 @wang-xing001 @u010470851 @east_yang @qianzehong @chenfeng61

likedislike
yuning_chen
yuning_chenCollaborators
11 days ago Comments:

您好,pr合入已准备就绪,请尽快联系committer进行检视,谢谢!
@yangyang016 @yu-xinjie62 @wang-xing001 @u010470851 @east_yang @qianzehong @chenfeng61

likedislike
sgqt12
sgqt12Collaborators
11 days ago Comments:

/lgtm

likedislike
陈展熹
陈展熹Collaborators
11 days ago Comments:
likedislike
TangPC
TangPCCollaborators
11 days ago Comments:

请关联issue

likedislike
陈展熹陈展熹Collaborators
11 days ago Associated issue: [Bug-Report|缺陷反馈]: AdamApplyOneAssign、ApplyAdamV2 当前交付版本错误码分类及重复上报问题
陈展熹陈展熹Collaborators
11 days ago Modify description of pull request
陈展熹
陈展熹Collaborators
11 days ago Comments:
likedislike
TangPC
TangPCCollaborators
11 days ago Comments:

/lgtm
/approve

likedislike
CANN-robotCANN-robotCollaborators
11 days ago Added label: lgtmapproved
CANN-robotCANN-robotCollaborators
11 days ago Merged pull request