已合并
mmv3 support 8d input #8785
yuning_chen创建于 8月17日
mmv3 support 8d input #8785
已合并
Pull Request已成功合入, 合并人@CANN-robot
(感谢 yuning_chen 的贡献)8月17日 创建了 pull request,commit 676b420c
atomgit-bot
8月17日 评论:
8月17日 评论:
变更摘要
该 PR 将 batch_mat_mul_v3(mmv3)对输入维度的支持从 6 维扩展到 8 维,即 batch 维度从最多 4 维扩展到 6 维。改动主要在 tiling 阶段引入统一的 GetBatchAxisFromEnd 维度解析方式,扩展 BatchShapeInfo、MultiBatchInfo 等数据结构,并在 kernel 侧为新增的 batch 维度补充循环与偏移计算;同时将 host 端 API 的维度上限提升到 8,并新增 rank 7/8 场景的单元测试。
主要改动
- Tiling 层 batch 信息扩展到 rank 7/8:在
batch_mat_mul_v3_base_tiling.h中为BatchShapeInfo新增batchA4/batchA5、batchB4/batchB5、batchC4/batchC5字段及IsEqualBatch()方法;在batch_mat_mul_v3_base_tiling.cpp中通过模板函数GetBatchAxisFromEnd统一计算各 batch 维,并将其纳入广播校验、MergeBatchAndMAxis清零逻辑、bias batch 校验和合法性检查。 - Tiling 数据结构新增维度字段:
MultiBatchInfo增加aBatchDim4/aBatchDim5、bBatchDim4/bBatchDim5、cBatchDim4/cBatchDim5,并在SetBatchDimInfo与CalcBatchDimAll中写入和参与 batch 总量计算。 - Kernel 循环与偏移计算扩展至 6 个 batch 维:
batch_mat_mul_v3.h在BatchMatMulUnalignedKernel中新增最外层i5/i6循环;batch_mat_mul_v3_com_base_block.h的InitBatchCount与CalcGMOffset相应扩展batchC5/batchC6及 A/B 侧索引计算;batch_mat_mul_v3_com_base_block_struct.h补充batchA5/batchA6、batchB5/batchB6、batchC5/batchC6参数。 - Host 端 API 维度上限提升:
batch_matmul_util.cpp中GetBatchDim返回 6 个 batch 维度,CheckAscendCScenario对 rank 7/8 直接命中 v3 场景,GetOutputSize的maxDim/maxBatchDim分别调整为 8/6;aclnn_matmul.cpp的MAX_SUPPORT_MATMUL_DIMS_NUMS由 6 改为 8。 - 补充 rank 7/8 测试用例:
test_aclnn_matmul.cpp新增 8D/8D、8D/2D、2D/8D、7D/7D 及 8D/6D 广播等bmm测试。


不准确?
atomgit-bot
8月17日 评论:
8月17日 评论:
8月17日 添加了label:stat/needs-squash
8月17日 添加了label:cann-cla/yes
此处折叠了152条消息 查看更多
9月1日 添加了label:lgtm
CANN-robot
9月1日 评论:
9月1日 评论:
The MR can not be merged, because of CodeReview discussion not resolved
If you want to solve this problem, you can click here to do it in the FAQs.


9月1日 解决了最后一个问题
9月1日 合入了pull request
CANN-robot
9月1日 评论:
9月1日 评论:
Pull Request 已合并或已关闭。
If you want to solve this problem, you can click here to do it in the FAQs.


描述
aclnnmatmul接口支持八维输入
关联的Issue
关联Issue #4067
测试
文档更新
更新了aclnn文档
类型标签
AI/Agent生成声明