Pull Request has been successfully merged by CANN-robot.
(Thank you for 王亮培's contribution.)变更摘要
本 PR 新增 AllGatherMatmulV3 算子(MX 量化 FP8/FP4,走 apace UDMA 通信路径),并打通从 aclnn API、算子定义(OpDef)、InferShape/InferDataType、host 侧 tiling 到 kernel 入口的完整链路,同时扩展了公共内核实现以支持 bias 输入与 FP4 场景,并补充了 op_api 与 host 侧单测。该算子面向 ascend950,通过 comm_mode=urma 通信,is_trans_b=true(x2 为 [N,K] 布局),输出 y=[rank_size*M, N] 与 gather_out=[rank_size*M, K]。
主要改动
- 新增算子完整接入链路: 新增
aclnnAllGatherQuantMatmulV3GetWorkspaceSize/aclnnAllGatherQuantMatmulV3(含 dtype/format/attr/shape 校验、x2 转置视图恢复TransX2Tensor)、AllGatherMatmulV3的 OpDef 定义(context/x1/x2/bias/x1_scale/x2_scale输入、y/gather_out/amax_out输出及group/hccl_buffer_size/rank_size等属性)、InferShape/InferDataType(推导y=[worldSize*M, N]、gather_out与x1同 dtype)以及 host 侧 tiling(tensor/attr 校验、按 512 行拆分通信 tile、经 SWAT 引擎求 mm tile、设置 workspace)。 - 公共内核新增 bias 支持:
AllGatherMxMatmulUdmaImpl的Init/MatmulProcess及AllGatherQbmmMxKernel增加biasGM_/isBias参数透传,AllGatherMxMatmulUdmaTilingData新增isBias字段;bias 存在时 matmul 累加 bias,否则沿用空指针。 - 新增 FP4(
DT_FLOAT4_E2M1)支持: 在 aclnn、InferShape、tiling 三层校验 x1/x2 须同为 FP4、K 须为偶数,并将dataBytesPerMRow_按 FP4(1 字节 2 元素)折算为k/2,修正非切分轴 K 的通信行宽计算。 - 扩展 tiling 基础设施:
QuantMatmulTilingBase新增SetCoreLimit(限制计算核数、按min(aicNum, aivNum)校准)与SetAdjustBasicBlockEnable开关,QuantMatmulTilingSwat据此在 tiling 中保证usedCoreNum不小于rankSize并设置排他调度,避免通信挂死。 - 补充单元测试: 新增 op_api 侧
test_aclnn_all_gather_matmul_v3.cpp(覆盖空/超长 group 等异常入参)及 host 侧 infershape/dtype/tiling 测试框架与参数结构体,并同步更新urma冒烟用例以适配新增的 bias 入参。
主要改动
- 新增算子完整接入链路: 新增
aclnnAllGatherQuantMatmulV3系列 API、AllGatherMatmulV3OpDef、InferShape/InferDataType、host 侧 tiling 及 kernel 入口,覆盖aclnn_all_gather_matmul_v3.cpp、all_gather_matmul_v3_def.cpp、all_gather_matmul_v3_infershape.cpp、all_gather_matmul_v3_tiling.cpp、all_gather_matmul_v3_apt.cpp等新增文件。 - 公共内核新增 bias 支持:
AllGatherMxMatmulUdmaImpl/AllGatherQbmmMxKernel增加biasGM/isBias参数,AllGatherMxMatmulUdmaTilingData新增isBias字段,tiling 侧据此置位并在 matmul 时累加 bias。 - 新增 FP4 支持: aclnn/tiling/InferShape 校验 x1/x2 必须同为
DT_FLOAT4_E2M1且 K 为偶数;dataBytesPerMRow_在 FP4 下按k/2折算,修正nonSplitAxisSize通信行宽。 - 扩展 tiling 基础设施:
QuantMatmulTilingBase新增SetCoreLimit与SetAdjustBasicBlockEnable,QuantMatmulTilingSwat按核数限制计算 mm tile,并将usedCoreNum提升至不小于rankSize后设置排他调度。 - 补充单元测试: 新增 op_api 与 host 侧 UT(含
AllGatherMatmulV3ApiUtParam、AllGatherMatmulV3TilingUtParam等参数结构与用例),并更新urma冒烟用例适配新增 bias 入参。


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_host/*_def.cpp | ✅ 汤磊, 王永光 (2/2) | ✅ 王永光 (1/1) |
| mc2 | ✅ wang-minbo, chenjunjian11 (2/2) | ✅ wang-minbo (1/1) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)
CLA Signature Pass
wangliangpei, thanks for your pull request. All authors of the commits have signed the CLA. 👍


/lgtm


/lgtm


描述
新增allgathermatmulV3算子代码
关联的Issue
[Requirement|需求建议]: 新增allgathermmV3算子host侧工程 #4711
测试
文档更新
类型标签