Merged
aclnn自动框架支持pcie_through算子 #741
pengjiahao96Add on Aug 15
aclnn自动框架支持pcie_through算子 #741
Merged
pengjiahao96Add on Aug 15
pengjiahao96
pengjiahao96Collaborators
Aug 15

描述

aclnn自动框架支持PCIe算子

关联的Issue

#312 nnopbase支持PCIe through

测试

文档更新

类型标签

likedislike
Pull Request has been successfully merged by CANN-robot.
(Thank you for pengjiahao96's contribution.)
pengjiahao96pengjiahao96Collaborators
Aug 15 Created pull request, commit 58a90972
atomgit-bot
atomgit-bot
Aug 15 Comments:

变更摘要

本 PR 主要让 aclnn 自动框架支持 pcie_through 算子:在算子输入输出接入阶段检测 tensor 地址是否位于 PCIe 范围,将 isEnablePcie 标记写入 executor,并据此跳过参数缓存、向 tiling context 传递 kInputsEnablePcieThrough;同时把静态 kernel 的 key 生成与查找逻辑重构到 nnopbase::StaticKernelHelper,在 key 中新增 PCIe 分片,并按「PCIe+stride → 无 PCIe+stride → 无 stride」的顺序回退匹配,以兼容未区分 PCIe 的存量静态 kernel。

主要改动

  • PCIe 地址检测与标记:新增 NnopbaseUpdatePcieThroughFlag 重载,在 NnopbaseAddInput、NnopbaseAddOutput、NnopbaseAddDynamicInput、NnopbaseAddDynamicOutput 等接口中调用 op::internal::IsPcieThroughEnabled 和 IsTensorAddrInPcieRange 检测地址,并设置 NnopbaseExecutor::isEnablePcie;NnopbaseInit 中新增 InitPcieThroughInfo() 初始化。

  • PCIe 场景下跳过参数缓存:NnopbaseMatchArgs 与 NnopbaseExecutorMatchCache 在 isEnablePcie 为真时将 ownArgs.enableCache 置为 false,并调用 NnopbaseAddIoTensors 补齐 IO;NnopbaseAddIoTensors 新增 completeIoByPcie 保护,避免重复配置 IO。

  • 静态 kernel 查找逻辑重构:新增 static_kernel_helper.h/.cpp 中的 nnopbase::StaticKernelHelper,提供 FindPath 与 FindStaticBinInfo,按 head、pcie、tensors(stride/no-stride)、attrs 分片生成 key,并实现 FindByCompatibilityProfiles 回退查找;删除原 NnopbaseCollectorGenStaticKey、NnopbaseCollectorGetStaticKernelBin、NnopbaseExecutorGenStaticKey 等旧实现。

  • 数据结构与序列化扩展:NnopbaseStaticRuntimeInfo 与 aclnnOpInfoRecord::OpCompilerOption 新增 enablePcie 字段;op_info_serialize.cpp 将 platform_info.pcie_through 写入 JSON dump。

  • tiling context 传递 PCIe 信息:InputsAppend 枚举新增 kInputsEnablePcieThrough,NnopbaseTilingContextBuild 将 executor->isEnablePcie 写入 tiling context 的输入值,使 tiling 阶段可感知 PCIe 开关。

likedislike
Incorrect?
atomgit-bot
atomgit-bot
Aug 15 Comments:

代码审查

✅ 未发现问题

likedislike
Incorrect?
CANN-robotCANN-robotCollaborators
Aug 15 Added label: cann-cla/yes
CANN-robot
CANN-robotCollaborators
Aug 15 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
repo-cann/opbase ✅ 宋恺, 张磊 (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

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

likedislike
119 messages are collapsed here。 See more
songkai111
songkai111Collaborators
Sep 1 Comments:

/approve

likedislike
CANN-robotCANN-robotCollaborators
Sep 1 Added label: approved
zl_hw
zl_hwCollaborators
Sep 1 Comments:

/lgtm
/approve

likedislike
CANN-robotCANN-robotCollaborators
Sep 1 Added label: lgtm
CANN-robotCANN-robotCollaborators
Sep 1 Merged pull request