| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
feat(matmul): Remove reshape from batchmatmul by direct 3D/4D tensor flow Co-authored-by: li_qingyan<liqingyan10@h-partners.com> # message auto-generated for no-merge-commit merge: !7094 merge feat/batchmatmul-remove-reshape into master feat(matmul): Remove reshape from batchmatmul by direct 3D/4D tensor flow Created-by: li_qingyan Commit-by: li_qingyan Merged-by: cann-robot Description: ## 变更说明 删除 batchmatmul 链路中的冗余 Reshape:A_MUL_B 直接接受 3D/4D 参数输入,全链路支持带 batch 轴的多维 tile。 ### 变更原因 {1,m,k} 与 {m,k} 内存布局相同,逐 batch 拆解插入的 Reshape 涉及 Pass 层做特判,耦合严重,问题高发,且会放大 TensorGraph/TileGraph 规模、增加 pass 处理量与编译耗时。 旧: View{b,m,k}→{1,m,k} → Reshape→{m,k} ─┐ View{b,k,n}→{1,k,n} → Reshape→{k,n} ─┤→ A_MUL_B(2D){m,n} → Reshape→{1,m,n} → Assemble 新: View{b,m,k}→{1,m,k} ─┐ View{b,k,n}→{1,k,n} ─┴→ A_MUL_B(3D/4D){1,m,n} → Assemble ### 方案 各层统一 batch 轴约定:shape 恒 1、offset 恒 0。修改归为三类: 1. tile/offset 在 batch 轴补 1/0,与输入同 rank(规避 LogicalTensor::View / GetViewValidShape 的 rank 硬校验) 2. GM 搬运侧 batch 轴 offset 按 stride 线性化累加进 gmOffset;L1/L0 内部保持纯 2D 语义,batch 轴 offset 恒 0 See merge request: cann/pypto!7094 | 20 天前 | |
feat(matmul): Remove reshape from batchmatmul by direct 3D/4D tensor flow Co-authored-by: li_qingyan<liqingyan10@h-partners.com> # message auto-generated for no-merge-commit merge: !7094 merge feat/batchmatmul-remove-reshape into master feat(matmul): Remove reshape from batchmatmul by direct 3D/4D tensor flow Created-by: li_qingyan Commit-by: li_qingyan Merged-by: cann-robot Description: ## 变更说明 删除 batchmatmul 链路中的冗余 Reshape:A_MUL_B 直接接受 3D/4D 参数输入,全链路支持带 batch 轴的多维 tile。 ### 变更原因 {1,m,k} 与 {m,k} 内存布局相同,逐 batch 拆解插入的 Reshape 涉及 Pass 层做特判,耦合严重,问题高发,且会放大 TensorGraph/TileGraph 规模、增加 pass 处理量与编译耗时。 旧: View{b,m,k}→{1,m,k} → Reshape→{m,k} ─┐ View{b,k,n}→{1,k,n} → Reshape→{k,n} ─┤→ A_MUL_B(2D){m,n} → Reshape→{1,m,n} → Assemble 新: View{b,m,k}→{1,m,k} ─┐ View{b,k,n}→{1,k,n} ─┴→ A_MUL_B(3D/4D){1,m,n} → Assemble ### 方案 各层统一 batch 轴约定:shape 恒 1、offset 恒 0。修改归为三类: 1. tile/offset 在 batch 轴补 1/0,与输入同 rank(规避 LogicalTensor::View / GetViewValidShape 的 rank 硬校验) 2. GM 搬运侧 batch 轴 offset 按 stride 线性化累加进 gmOffset;L1/L0 内部保持纯 2D 语义,batch 轴 offset 恒 0 See merge request: cann/pypto!7094 | 20 天前 |