Merged
【FEATURE】A2/A3 GEMMV3 base kernel支持需要broadcast的bias输入 #8446
HKFLYEAdd on Aug 8
【FEATURE】A2/A3 GEMMV3 base kernel支持需要broadcast的bias输入 #8446
Merged
Pull Request has been successfully merged by CANN-robot.
(Thank you for HKFLYE's contribution.)Aug 8 Added label: stat/needs-squash
Aug 8 Added label: cann-cla/yes
CANN-robot
Aug 8 Comments:
Aug 8 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.
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 |
|---|---|---|
| matmul | ✅ 唐超, 林鹏翔 (2/2) | ✅ 唐超 (1/1) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)
CLA Signature Pass
HuangKun8682, thanks for your pull request. All authors of the commits have signed the CLA. 👍


Aug 8 Set zengjuan,sxb154714,chaotang233,crystalhu,yangyang016,fanqirui,chenqi317,LinPX,liubo75,tangweiwei2,wangzitao_leo,xubinglin,pingchuantang,liuyang_806 as approver
Aug 8 Set zengjuan,sxb154714,chaotang233,crystalhu,yangyang016,fanqirui,chenqi317,LinPX,liubo75,tangweiwei2,wangzitao_leo,xubinglin,pingchuantang,liuyang_806 as approver
47 messages are collapsed here。 See more
Aug 17 Merged pull request
CANN-robot
Aug 17 Comments:
Aug 17 Comments:
Pull Request 已合并或已关闭。
If you want to solve this problem, you can click here to do it in the FAQs.


Oct 12 Modify description of pull request
Oct 12 Removed label: ci-pipeline-passed
CANN-robot
Oct 12 Comments:
Oct 12 Comments:
The following label is not ready.
ci-pipeline-passed: The ci-pipeline-passed label is expired as added over 72 hours. Please use /compile to recompile.


描述
本 PR 为 A2/A3 GemmV3 Base Kernel 增加 bias broadcast 支持,使 GemmV3 可以直接计算:
out = alpha * (A @ B) + beta * C
其中 C 支持向矩阵乘输出
[B, M, N]广播。主要修改如下:
扩展 GemmV3 InferShape:
扩展 GemmV3 Tiling:
[B, M, N]。BIAS_BCAST_NONEBIAS_BCAST_NBIAS_BCAST_MBIAS_BCAST_SCALARcBatchStride、cMStride和cNStride,stride 为 0 表示对应方向广播。扩展 GemmV3 TilingData:
biasBroadcastType。优化 Kernel 中的 bias broadcast 计算:
[B,1,1]按 per-batch scalar 处理。VEC_ITER_REPEAT对行数进行分段,避免 repeat 参数截断。重新规划
ubC_区域:ubBiasRaw_:保存原始 bias。ubBiasFp32_:保存 Cast 及 beta 缩放后的 bias。ubBiasBrcb_:保存 Brcb 展开的 bias。将 C 的读取地址与 Y 的写回地址分离:
[B, M, N]输出布局写回。关联的Issue
测试
新增并完成 GemmV3 InferShape UT:
新增并完成 GemmV3 Tiling UT:
biasBroadcastType和 C 的三个逻辑 stride。覆盖 FP16、BF16、16in32out、ND×ND、ND×NZ,以及 N/M/scalar/
[B,1,1]broadcast。测试结果:
单条批量执行泛化精度用例通过率:1998/2000,失败用例批跑100次复检后精度通过
文档更新
类型标签
AI/Agent生成声明