Pull Request has been successfully merged by CANN-robot.
(Thank you for ChenCangtao's contribution.)变更摘要
本 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声明。


代码审查
审查结论
- [建议]
impl/c_api/reg_base_impl/npu_arch_9201/vector_datamove_intf_impl.h:1859fix: 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:15fix: 两个新增测试文件的 gtest 用例重名(同 suite 同 case 名) - [建议]
impl/c_api/reg_base_impl/vector_datamove_intf_impl.h:223fix: 删除通用 impl 中 asc_ndim_copy_gm2ub 定义但公共头仍声明旧式重载 - [建议]
tests/api/c_api/npu_arch_9201/vector_datamove/test_asc_ndim_copy_gm2ub.cpp:59fix: 新测试调用 9.3.0 起才声明的接口,但未加 ASC_DEVKIT_VERSION_NUM 守卫 - [建议]
tests/api/c_api/npu_arch_9201/vector_datamove/test_asc_remote_copy_ub2gm.cpp:44fix: size 版 asc_remote_copy_ub2gm 的 burst_num/burst_len 期望被硬编码到所有数据类型
| 类型 | 数量 |
|---|---|
| 🔴 阻塞 | 0 |
| 🟡 建议 | 5 |
💬 仅评论


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
/approveor/lgtm- Commenting
/approveimplies 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. 👍


/approve


/lgtm
/approve


/lgtm
/approve


描述
新增9201 vector datamove capi 接口
关联的Issue
测试
UT 本地编写样例
文档更新
类型标签