Merged
feat: mhc_pre_backward算子新增A2(ascend910b)支持 #10049
feat: mhc_pre_backward算子新增A2(ascend910b)支持 #10049
Merged
renruhaiAdd on Aug 13
renruhai
renruhai
Aug 13

描述

MhcPreBackward算子新增A2(ascend910b / ascend910_93)芯片支持。

改动原因:算子原先仅支持A3/A5(ascend950, arch35),需扩展A2(arch22)平台支持。

实现方案:

  • 算子注册:def.cpp新增ascend910b/ascend910_93的AICore配置(动态shape、动态rank、aclnn支持)
  • tiling分发:新增共享tiling入口(mhc_pre_backward_tiling.cpp),按SOC版本路由——ascend950(arch35)走原TilingRegistry模板,A2(arch22)走新增的函数式TilingMhcPreBackwardArch22
  • kernel实现:新增arch22 kernel(KERNEL_TYPE_MIX_AIC_1_2混合核,Cube+Vector协同),mm1/mm2基于matmul高阶API全fp32计算,保证输出精度;fusionSize同时支持N!+2N和N²+2N(区别于A5的N²+2N)
  • infershape增强:fusionSize改由phi输入shape推导(平台自适应);gradHRes维度校验支持BSND(BSNN/BSN!)与TND(TNN/TN!)格式组合
  • UT用例:新增/更新op_api 60例、infershape 12例、tiling 14例

关联的Issue

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

测试

  • UT:op_api 60用例、infershape 12用例、tiling 14用例全部通过(ascend910b环境)
  • ATK精度验证:精度、半精度异常值、确定性、半精度检测、通过续断、NAN值、性能和泛化验证通过

文档更新

无

类型标签

likedislike
Pull Request has been successfully merged by CANN-robot.
(Thank you for renruhai's contribution.)
renruhairenruhai
Aug 13 Created pull request, commit f31aca82
renruhairenruhai
Aug 13 Pre merge succeeded (commit_id: 9292642514a8a3eaded487b8c609080e974f4df0)
renruhairenruhai
Aug 13 Force-pushed 1 commits:63076b66-mhcPreBackward A2算子开发
renruhairenruhai
Aug 13 Pre merge succeeded (commit_id: 4b43fea92e5471ac55ebc5a1ab34025781dff689)
CANN-robotCANN-robotCollaborators
Aug 13 Added label: cann-cla/yes
156 messages are collapsed here。 See more
CANN-robotCANN-robotCollaborators
Aug 27 Added label: lgtm
luwei_1104
luwei_1104Collaborators
Aug 27 Comments:

/approve

likedislike
CANN-robotCANN-robotCollaborators
Aug 27 Added label: approved
CANN-robotCANN-robotCollaborators
Aug 27 Closed associated issue
CANN-robotCANN-robotCollaborators
Aug 27 Merged pull request