Merged
feat(basic_api): add OUT_TO_L1 loop mode support #6620
feat(basic_api): add OUT_TO_L1 loop mode support #6620
Merged
lihuaichaoAdd on Oct 9
lihuaichaoCollaborators
Oct 9

描述

为 basic_api 的 SetLoopModePara/ResetLoopModePara 增加 OUT_TO_L1 支持,覆盖 3510、5102、5162、9201 实现,并修正 loop2Size 的 22 位范围。

将 C API 的 SoC 初始化拆分为 asc_init 与 asc_init_impl,在 reg-base 下按 3510、9201、9202 独立实现;2201 使用 memory-base 实现。基础 API 在这四种架构上复用 asc_init,基础 API 自身负责 g_deqValue 初始化。3510 配置 set_st_atomic_cfg,9201/9202 不配置;AIC 初始化 OUT_TO_L1 普通搬运模式。补齐 5162 初始化分支并跳过其 set_atomic_none。

GM→L1 样例及中英文说明的修改仅保留在本地,不包含在本 PR 中。

补齐 9201 的 OUT_TO_L1 配置与复位实现,包含 AIC 保护和参数校验。初始化公共头改用轻量宏依赖,移除 2201 初始化对 memory-base utils 的依赖,不再间接引入全量 C API Vector 类型;未显式添加 。

关联的Issue

无。

测试

  • 轻量依赖调整后,2201/3510 基础 API CPU 调试语法检查通过。
  • 9201 OUT_TO_L1 实现与公共分发提取后的定向检查:Cube/Vector、Release/Debug 共 4 项通过;总头中对应的两个函数未定义错误消失。
  • 2201/3510 Cube、Vector,编译器初始化宏定义/未定义两种模式下,基础 API 与 C API 混合包含语法检查通过。
  • C API 3510/9201/9202 Cube、Vector 及宏开关组合语法检查通过。
  • 9201/9202 基础初始化头、5102/3002 定向语法检查通过。
  • git diff --check 通过。
  • 9201/9202 基础 API 总头检查受当前仓库常量或调试头缺项阻塞;未进行设备执行验证,5162 未完成目标编译验证。

文档更新

更新 SetLoopModePara、ResetLoopModePara、asc_set_ub2gm_loop_size API 文档。

类型标签

likedislike
Pull Request has been successfully merged by CANN-robot.
(Thank you for lihuaichao's contribution.)
LlihuaichaoCollaborators
Oct 9 Created pull request, commit 7bc3a36f
atomgit-bot
atomgit-bot
Oct 9 Comments:

变更摘要

本 PR 为 basic_api 的 SetLoopModePara/ResetLoopModePara 增加 OUT_TO_L1 循环搬运模式支持。在公共分发逻辑中新增 OUT_TO_L1 分支,在 3510、m510(5102)、v516(5162)三个架构实现中补充该模式的参数校验、循环参数组装与寄存器配置,并在 InitSplitArchSpr 的 AIC 分支初始化 OUT_TO_L1 的 loop size。

主要改动

  • 新增 OUT_TO_L1 枚举类型: 在 DataCopyMVType 中新增 OUT_TO_L1 = 2,为循环搬运模式提供新的目标类型区分。
  • 新增 OUT_TO_L1 参数组装实现: 在 dav_3510、dav_m510、dav_v516 的 kernel_operator_data_copy_impl.h 中新增 SetLoopModeOutToL1ParaImpl,校验 loop1Size/loop2Size/loopDstStride 小于 2^21、loopSrcStride 小于 2^40 且 DstStride 32B 对齐,并组装 set_loop_size_outtol1、set_loop1_stride_outtol1、set_loop2_stride_outtol1 寄存器参数。
  • 新增 OUT_TO_L1 复位实现: 同一批架构文件中新增 ResetOutToL1LoopModeParaImpl,将 loop_size_outtol1 复位为硬件约定 (1ul << 21) | 1ul 的 normal 值。
  • 公共分发逻辑扩展: 在 kernel_operator_data_copy_intf_impl.h 中将 SetLoopModePara/ResetLoopModePara 的 else 分支改为显式 else if,分别分发 UB_TO_OUT、OUT_TO_UB、OUT_TO_L1 三种类型。
  • AIC 分支初始化: 在 kernel_utils_base.h 的 InitSplitArchSpr 中,3510 架构 ASCEND_IS_AIC 分支内新增对 set_loop_size_outtol1 的 loop size 初始化。
likedislike
Incorrect?
atomgit-bot
atomgit-bot
Oct 9 Comments:

代码审查

✅ 未发现问题

likedislike
Incorrect?
CANN-robotCANN-robotCollaborators
Oct 9 Added label: cann-cla/yes
CANN-robot
CANN-robotCollaborators
Oct 9 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
docs ✅ munanhw, Lycheeeee, wuyang_hw (3/2) ✅ munanhw (1/1)
impl/basic_api ✅ wuyang_hw, Lycheeeee (2/2) ✅ wuyang_hw (1/1)
impl/c_api ✅ Lycheeeee, wuyang_hw (2/2) ✅ Lycheeeee (1/1)
include/basic_api ✅ Lycheeeee, wuyang_hw, wuzhaolin (3/2) ✅ wuzhaolin (1/1)
include/c_api ✅ wuzhaolin, Lycheeeee, wuyang_hw (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

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

likedislike
148 messages are collapsed here。 See more
CANN-robot
CANN-robotCollaborators
13 days ago Comments:
🚀 CI 流水线已启动
📋 执行详情: 点击查看流水线
likedislike
CANN-robotCANN-robotCollaborators
13 days ago Added label: ci-pipeline-running
CANN-robotCANN-robotCollaborators
13 days ago Removed label: ci-pipeline-running
CANN-robotCANN-robotCollaborators
13 days ago Added label: ci-pipeline-passed
CANN-robotCANN-robotCollaborators
13 days ago Merged pull request