Merged
kirin 5161: add macro fixpipe api #7339
zengjuanAdd on 13 days ago
kirin 5161: add macro fixpipe api #7339
Merged
zengjuanAdd on 13 days ago
zengjuan
zengjuanCollaborators
13 days ago

描述

kirin 5161: add macro fixpipe api

关联的Issue

https://gitcode.com/cann/asc-devkit/issues/2014

测试

算子泛化测试

文档更新

类型标签

likedislike
Pull Request has been successfully merged by CANN-robot.
(Thank you for zengjuan's contribution.)
zengjuanzengjuanCollaborators
13 days ago Created pull request, commit 1f4f078d
atomgit-bot
atomgit-bot
13 days ago Comments:

变更摘要

本 PR 在宏算子基础接口头文件 include/basic_api/kernel_operator_macro_intf.h 中新增了一组面向 Kirin 5161 等架构的 Fixpipe 相关对外接口声明,涵盖寄存器参数设置与 fixpipe 数据搬运两类能力,并限定在特定 __NPU_ARCH__ 宏取值下生效。

主要改动

  • 新增架构编译开关: 通过 #if defined(__NPU_ARCH__) && (...) 将新增接口限定在 5101、5161、5165、5163 架构下编译,其他架构不受影响。
  • 新增 SetFixpNzPara 接口: 提供 FixpNzParaParams 与 FixpNzParaBitModeParams 两个重载声明,用于设置 fixpipe NZ 相关寄存器参数。
  • 新增 SetFixpLoopenhancePara 接口: 提供 FixpLoopenhanceParaParams 与 FixpLoopenhanceParaBitModeParams 两个重载声明,用于设置 loop enhance 相关寄存器参数。
  • 新增 Fixpipe 接口: 声明支持 LocalTensor 与 GlobalTensor 作为目的操作数的重载,并分别对应 FixpipeParamsArch5161 与 FixpipeBitModeParamsArch5161 两种参数类型,提供 fixpipe 搬运能力。
likedislike
Incorrect?
atomgit-bot
atomgit-bot
13 days ago Comments:

代码审查

审查结论

逐文件核查结果

  • include/basic_api/kernel_operator_macro_intf.h:已核查(新增 36 行为 5101/5161/5163/5165 分支的 SetFixpNzPara / SetFixpLoopenhancePara / Fixpipe 声明,共 3 处问题,见下)。

问题清单(3 项)

优先级 位置 问题
P1 298-305 4 个 Fixpipe 重载声明了模板参数 U,但形参中 dst/src 同为 LocalTensor<T>,U 无法推导;与本文件 PostProc(269) 及 kernel_operator_fixpipe_intf.h 全部既有 Fixpipe 重载的 LocalTensor<U>& src 契约单侧偏离,调用即编译失败,且无法表达 L0C→输出的类型转换
P1 280-305 新增声明引用的 6 个参数类型(FixpNzParaParams、FixpNzParaBitModeParams、FixpLoopenhanceParaParams、FixpLoopenhanceParaBitModeParams、FixpipeParamsArch5161、FixpipeBitModeParamsArch5161)在 include 树中全文检索无任何定义,而 impl 头在 311 行才 include(晚于声明),按既有约定应在 kernel_struct_macro.h / kernel_operator_macro_bitmode_intf.h 补齐
P3 288-289 Loopenhance 疑为 LoopEnhance 拼写错误(可选改进,需与 impl 侧统一)

整体风险判断:该改动为纯声明新增,但其形式与既有同类 API 约定不一致,"模板参数不可推导"可确定导致新增 API 不可用;叠加参数类型定义缺失(需确认 impl 侧是否提供),该 arch 分支存在编译失败风险,建议合并前修正。

统计:P0 × 0,P1 × 2,P2 × 0,P3 × 1。

类型 数量
🔴 阻塞 2
🟡 建议 0

⛔ 需要修改

likedislike
Incorrect?
CANN-robotCANN-robotCollaborators
13 days ago Added label: cann-cla/yes
CANN-robot
CANN-robotCollaborators
13 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
impl/basic_api ✅ wuyang_hw, yangbinhua (2/2) ✅ wuyang_hw (1/1)
include/basic_api ✅ wuzhaolin, wuyang_hw, yangbinhua (3/2) ✅ wuzhaolin (1/1)

💡 Tip:

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

CLA Signature Pass

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

likedislike
121 messages are collapsed here。 See more
wuzhaolin
wuzhaolinCollaborators
12 days ago Comments:

/approve

likedislike
CANN-robotCANN-robotCollaborators
12 days ago Added label: approved
yangbinhua
yangbinhuaCollaborators
12 days ago Comments:

/lgtm

likedislike
CANN-robotCANN-robotCollaborators
12 days ago Added label: lgtm
CANN-robotCANN-robotCollaborators
12 days ago Merged pull request