Merged
9201 vec datamove capi接口 #7325
9201 vec datamove capi接口 #7325
Merged
ChenCangtaoAdd on 17 days ago
ChenCangtao
ChenCangtaoCollaborators
17 days ago

描述

新增9201 vector datamove capi 接口

关联的Issue

测试

UT 本地编写样例

文档更新

类型标签

likedislike
Pull Request has been successfully merged by CANN-robot.
(Thank you for ChenCangtao's contribution.)
ChenCangtaoChenCangtaoCollaborators
17 days ago Created pull request, commit 56ada099
atomgit-bot
atomgit-bot
17 days ago Comments:

变更摘要

本 PR 围绕 9201(npu_arch_9201)上 Vec Datamove 相关 C API 接口的补齐与重构展开:一方面按芯片架构拆分了 asc_ndim_copy_gm2ub 的实现位置,把原先放在通用 vector_datamove_intf_impl.h 中的重载迁移到 npu_arch_3510 架构实现文件,并新增 npu_arch_9201 的架构专属实现文件;另一方面在公共头文件 vector_datamove.h 中新增了大量 asc_copy_ub2gm、asc_remote_copy_ub2gm、asc_remote_copy_ub2gm_align、asc_copy_gm2ub、asc_copy_gm2ub_align 及增强版 asc_ndim_copy_gm2ub 的接口声明,并配套新增/扩充 C API 单元测试与 stub。

主要改动

  • 接口声明扩充: 在 include/c_api/vector_datamove/vector_datamove.h 的 ASC_DEVKIT_VERSION_NUM >= 90300000 分支下新增 asc_copy_ub2gm、asc_remote_copy_ub2gm、asc_remote_copy_ub2gm_align 的多数据类型重载,覆盖 uint8_t/int8_t/half/float/bfloat16_t/hifloat8_t/fp8_* 等,支持 burst 配置、按 size 拷贝、远端 rsw 控制与重试参数。
  • asc_ndim_copy_gm2ub 参数增强与类型补齐: 公共头文件中新增带 enable_pre_load_ignore_sync 的多维拷贝重载,并补充 fp8_e6m2_t 版本(含带与不带该参数的两种形态),同时保留 asc_load_l2_cache_mode 配置项。
  • asc_copy_gm2ub / asc_copy_gm2ub_align 接口扩展: 新增 void* 形式的带 enable_pre_load_ignore_sync、src_stride/dst_stride、enable_retry 的 asc_copy_gm2ub 重载,以及按类型区分的三类重载(配置式、按 size、SC 配置式);asc_copy_gm2ub_align 新增 enable_pre_load_ignore_sync、uint64_t src_stride、enable_retry 参数。
  • 实现按架构拆分: 从通用 impl/c_api/reg_base_impl/vector_datamove_intf_impl.h 移除全部 asc_ndim_copy_gm2ub 重载,改在 npu_arch_3510/vector_datamove_intf_impl.h 中以 nddma_out_to_ub_b8/b16/b32 按数据宽度实现,并新增 npu_arch_9201/vector_datamove_intf_impl.h 作为该架构专属实现文件。
  • 测试与 stub 配套: 新增 test_asc_ndim_copy_gm2ub.cpp、test_asc_remote_copy_ub2gm.cpp、test_asc_remote_copy_ub2gm_align.cpp、test_copy_gm_to_ub.cpp,扩充 test_copy_gm_to_ub_align_instr.cpp 与 test_copy_ubuf_to_gm_align_instr.cpp 的类型覆盖和扩展配置用例;cce_stub.h 增加 fp8_e8m0_t 的 copy_gm_to_ubuf_align_v2 桩及 nddma_out_to_ub_b8/b16/b32 桩,host_header_vector_datamove_checker.cpp 增加 asc_remote_copy_ub2gm、asc_remote_copy_ub2gm_align 的 using 声明。
likedislike
Incorrect?
atomgit-bot
atomgit-bot
17 days ago Comments:

代码审查

审查结论

  • [建议] impl/c_api/reg_base_impl/npu_arch_9201/vector_datamove_intf_impl.h:1859 fix: asc_remote_copy_ub2gm 的 stride 参数被收窄为 uint16_t,与同文件对齐版本(64/32 位)不一致
  • [建议] tests/api/c_api/npu_arch_9201/vector_datamove/test_asc_remote_copy_ub2gm_align.cpp:15 fix: 两个新增测试文件的 gtest 用例重名(同 suite 同 case 名)
  • [建议] impl/c_api/reg_base_impl/vector_datamove_intf_impl.h:223 fix: 删除通用 impl 中 asc_ndim_copy_gm2ub 定义但公共头仍声明旧式重载
  • [建议] tests/api/c_api/npu_arch_9201/vector_datamove/test_asc_ndim_copy_gm2ub.cpp:59 fix: 新测试调用 9.3.0 起才声明的接口,但未加 ASC_DEVKIT_VERSION_NUM 守卫
  • [建议] tests/api/c_api/npu_arch_9201/vector_datamove/test_asc_remote_copy_ub2gm.cpp:44 fix: size 版 asc_remote_copy_ub2gm 的 burst_num/burst_len 期望被硬编码到所有数据类型
类型 数量
🔴 阻塞 0
🟡 建议 5

💬 仅评论

likedislike
Incorrect?
CANN-robotCANN-robotCollaborators
17 days ago Added label: cann-cla/yes
CANN-robot
CANN-robotCollaborators
17 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/c_api ✅ Lycheeeee, wuyang_hw (2/2) ✅ Lycheeeee (1/1)
include/c_api ✅ wuyang_hw, wuzhaolin, Lycheeeee (3/2) ✅ wuzhaolin (1/1)
repo-cann/asc-devkit ✅ Lycheeeee, wuyang_hw (2/2) ✅ Lycheeeee, wuyang_hw (2/1)

💡 Tip:

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

CLA Signature Pass

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

likedislike
105 messages are collapsed here。 See more
wuzhaolin
wuzhaolinCollaborators
15 days ago Comments:

/approve

likedislike
吴洋
吴洋Collaborators
15 days ago Comments:

/lgtm
/approve

likedislike
Lycheeeee
LycheeeeeCollaborators
15 days ago Comments:

/lgtm
/approve

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