Merged
新增engram_fetch 核函数 && engram_fetch_wait算子 #7749
新增engram_fetch 核函数 && engram_fetch_wait算子 #7749
Merged
wuchenhao123Add on Jun 28
wuchenhao123
wuchenhao123Collaborators
Jun 28

描述

EngramFetch算子工程代码

关联的Issue

https://gitcode.com/cann/ops-transformer/issues/3385

测试

本地验证

文档更新

不涉及

类型标签

likedislike
Pull Request has been successfully merged by CANN-robot.
(Thank you for wuchenhao123's contribution.)
wuchenhao123wuchenhao123Collaborators
Jun 28 Created pull request, commit 0efae088
CANN-robotCANN-robotCollaborators
Jun 28 Added label: stat/needs-squash
CANN-robotCANN-robotCollaborators
Jun 28 Added label: cann-cla/yes
CANN-robot
CANN-robotCollaborators
Jun 28 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


PR Approval Progress

✅ Congratulations! All modules have met the lgtm and approve requirements.

Module Approval Details

module lgtm status approve status
*/*/op_host/*_def.cpp ✅ 王永光, 刘丹 (2/2) ✅ 王永光 (1/1)
cmake ✅ 刘丹, wang-minbo (2/2) ✅ 刘丹, wang-minbo (2/1)
mc2 ✅ 刘丹, wang-minbo, chenjunjian11 (3/2) ✅ 刘丹, wang-minbo (2/1)

💡 Tip:

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

CLA Signature Pass

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

likedislike
atomgit-bot
atomgit-bot
Jun 28 Comments:

变更摘要

此 PR 主要新增了 engram_fetch 核函数(Arch35)的完整实现,以及全新的 engram_fetch_wait 算子。engram_fetch 负责按 rank 分散索引并从远程 rank 拉取 engram 数据,通过 Hcomm 实现跨 rank 通信;engram_fetch_wait 用于排空(drain)前序 engram_fetch 发起的未完成远程读取操作,确保数据就绪。同时定义了 EngramCommContext 共享数据结构和一系列常量,并在构建系统中注册了两个算子。

主要改动

  • 新增 EngramFetchArch35 核函数实现:在 mc2/engram_fetch/op_kernel/arch35/engram_fetch_arch35.h 中补全了核心逻辑,包含 ScatterByRank 按 rank 分组索引、通过 Hcomm::ReadNbi 发起跨 rank 远程读取(非阻塞),以及 LocalCopySlice 乒乓双缓冲本地拷贝。
  • 新增 EngramCommContext 共享结构体:在 mc2/engram_fetch/op_kernel/engram_fetch.h 中定义,包含 rankId、rankSize、commBuffer 和 hcommHandle_,同时定义 HCOMM_INIT_SIZE、READ_COMMIT_THRESHOLD、TILE_BYTES 等常量,供 engram_fetch 和 engram_fetch_wait 共用。
  • 新增 engram_fetch_wait 完整算子:包括 API 层(aclnn_engram_fetch_wait.cpp)、算子定义(engram_fetch_wait_def.cpp)、形状推导(直接透传输入形状)、Tiling 配置(engram_fetch_wait_tiling.cpp)以及 Arch35 核函数 EngramFetchWaitArch35,核心操作为对每个非本地 channel 调用 hcomm_.Drain() 等待远程读取完成。
  • 构建系统注册:在 cmake/func.cmake 的 add_ops_src_copy 中新增 "engram_fetch_wait;" 和 "engram_fetch;",使两个算子参与编译拷贝。
likedislike
Incorrect?
94 messages are collapsed here。 See more
CANN-robotCANN-robotCollaborators
Jun 29 Added label: approved
liudan12
liudan12Collaborators
Jun 29 Comments:

/lgtm
/approve

likedislike
CANN-robotCANN-robotCollaborators
Jun 29 Added label: lgtm
CANN-robotCANN-robotCollaborators
Jun 29 Closed associated issue
CANN-robotCANN-robotCollaborators
Jun 29 Merged pull request