Merged
feat: vector算子适配ascend960pr(DV122)平台并补齐仓库级960pr支持 #14537
feat: vector算子适配ascend960pr(DV122)平台并补齐仓库级960pr支持 #14537
Merged
biabuAdd on 22 days ago
biabu
biabu
22 days ago

描述

DV122(Ascend960PR / dav_9202 / Ascend960PR_969A1)vector 算子适配。适配原则:9201 支持的能力 9202 均支持。

仓库级适配(原仓库完全缺失 960pr):

  • CMakeLists:SOC_VERSION_LIST/ARCH_DIRECTORY_LIST/ASCEND_ALL_COMPUTE_UNIT 增加 ascend960pr(→arch35);arch92 目录路由由仅 960dt 扩展为 960dt/960pr 均生效(否则单独编 960pr 会走空包并漏编 arch92 kernel)
  • build.sh:SUPPORT_COMPUTE_UNIT_SHORT/SOC_HARDWARE_MAP(ascend960pr=Ascend960PR_969A1)
  • cmake/scripts/util:const_var.py SOC_MAP_EXT、opdesc_parser.py、ascendc_impl_build.py 同步补齐

注册级适配(15 算子):

  • def.cpp AddConfig、op_host/config/ascend960pr 二进制配置、op_host/CMakeLists.txt 编译选项块(COMPUTE_UNIT Ascend960PR_969A1)

代码级补齐:

  • mhc 系列/gather_pa_kv_cache/scatter_pa_kv_cache/rotary fusion pass 等 DAV_9201 平台门禁补齐 DAV_9202

注册级适配(66 算子):

  • CMakeLists.txt:SUPPORT_COMPUTE_UNIT 追加 "ascend960pr",SUPPORT_TILING_DIR 按位插入对应 arch35
  • op_host/*_def.cpp:AICore().AddConfig("ascend960pr", <960dt 同款配置>)
  • op_host/config/ascend960pr/:二进制配置(*_binary.json / *_simplified_key.ini,复制自 ascend960dt,与 960dt 内容一致)
  • op_kernel*/CMakeLists.txt:COMPUTE_UNITS 追加 ascend960pr(arch92 kernel 入口同步生效)
  • scripts/kernel/binary_config/ascendc_config.json:compute_units 与 compile_options 补齐

代码级补齐(9201 → 9201||9202):

  • tiling/aclnn/infershape/fusion_pass/kernel 中 NpuArch::DAV_9201、__NPU_ARCH__ == 9201、"Ascend960DT" 等 960 平台门禁补齐 DAV_9202 / 9202 / "Ascend960PR"
  • 覆盖 concat/tanh_grad/slice/strided_slice/expand/tensor_equal/lin_space/range 等的 tiling/aclnn/graph_infer/fusion_pass 平台门禁(家族特性判定依据:gather_v2 适配提交中 isAscend96_ = DAV_9201||DAV_9202、unsorted_segment_sum 注释"ascend960dt/ascend960pr(DAV_9201/DAV_9202) 平台判定,用于 960 专属特性(ScatterDataCopy 等)的运行时开关")

关联的Issue

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

测试

已通过冒烟、UT、ST测试。

  • CANN 9.3.0 工具链 --soc=ascend960pr 构建 19 个抽样算子(覆盖全部修改类型):宿主侧(def/tiling/infershape/aclnn)100% 编译通过,0 错误
  • 构建日志确认正确消费新增的 config/ascend960pr/*_binary.json
  • --soc=ascend960dt 同算子集构建行为一致,无回归
  • 一致性审计:范围内 960dt-without-960pr 注册缺口 0;修改过的 CMakeLists SUPPORT_COMPUTE_UNIT/TILING_DIR 位置对齐 0 问题;ascendc_config.json 语法有效
  • 注:opc 二进制生成阶段因当前工具链缺 Ascend960PR_969A1 平台数据无法本地执行,需在 CI(含 960PR 平台数据的工具链)完成二进制编译与上板验证

文档更新

不涉及

类型标签

AI/Agent生成声明

likedislike
Pull Request has been successfully merged by CANN-robot.
(Thank you for biabu's contribution.)
biabubiabu
22 days ago Created pull request, commit 360e7206
CANN-robotCANN-robotCollaborators
22 days ago Added label: cann-cla/yes
CANN-robot
CANN-robotCollaborators
22 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
*/*/op_graph/*_proto.h ✅ 汤磊, 马兵, 刘丹 (3/2) ✅ 汤磊 (1/1)
*/*/op_host/*_def.cpp ✅ xuejinghui, 刘丹, 马兵, 汤磊 (4/2) ✅ 汤磊 (1/1)
attention ✅ 马兵, 刘丹 (2/2) ✅ 马兵, 刘丹 (2/1)
gmm ✅ 马兵, 刘丹 (2/2) ✅ 马兵, 刘丹 (2/1)
mhc ✅ xuejinghui, 刘丹, 马兵 (3/2) ✅ xuejinghui (1/1)
moe ✅ 刘丹, 马兵 (2/2) ✅ 马兵, 刘丹 (2/1)
posembedding ✅ 马兵, 刘丹 (2/2) ✅ 马兵, 刘丹 (2/1)
sig-ops-transformer ✅ 刘丹, 马兵 (2/2) ✅ 马兵, 刘丹 (2/1)
tests ✅ 马兵, 刘丹 (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

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

likedislike
CANN-robotCANN-robotCollaborators
22 days ago Set guijianwei,hz36amy_00,yangziqi_007,coder_linx,juyangokok,monologue815,xuanyuandy,chen-linxin4,crystalhu,yu-xinjie62,huangwei791,jiang-lirui,yang-binrong,Allan_Yu,wang-minbo,huang-wei-chen,tang-lei01,xtqh,songkai111,liudan12,shasha_an,wangzhe123456789,Wei_NaChuan,zhangshuoleiokok,luwei_1104,cc-z,kdy18482276080,xuchengyang,shen_weiling,gaoxiang618,songjionghui,lining_210,wenxin_fight,miaofangzheng,mabing1118,tang-hao-hw-gitcode,wangyongguang,haijie_699874,xuejinghui,zzy__,Julius47,yuhao_,L_Euler,jiangjiawei,wangxun21 as approver
CANN-robotCANN-robotCollaborators
22 days ago Set guijianwei,hz36amy_00,yangziqi_007,coder_linx,juyangokok,monologue815,xuanyuandy,chen-linxin4,crystalhu,yu-xinjie62,huangwei791,jiang-lirui,yang-binrong,Allan_Yu,wang-minbo,huang-wei-chen,tang-lei01,xtqh,songkai111,liudan12,shasha_an,wangzhe123456789,Wei_NaChuan,zhangshuoleiokok,luwei_1104,cc-z,kdy18482276080,xuchengyang,shen_weiling,gaoxiang618,songjionghui,lining_210,wenxin_fight,miaofangzheng,mabing1118,tang-hao-hw-gitcode,wangyongguang,haijie_699874,xuejinghui,zzy__,Julius47,yuhao_,L_Euler,jiangjiawei,wangxun21 as approver
218 messages are collapsed here。 See more
CANN-robotCANN-robotCollaborators
5 days ago Added label: approved
liudan12Collaborators
5 days ago Comments:

/lgtm
/approve

likedislike
CANN-robotCANN-robotCollaborators
5 days ago Added label: lgtm
CANN-robotCANN-robotCollaborators
5 days ago Closed associated issue
CANN-robotCANN-robotCollaborators
5 days ago Merged pull request