---
title: BatchMatMulNonAlignedFusionPass
description: "该融合为BatchMatMul非对齐场景下的融合。"
url: https://www.hiascend.com/document/detail/zh/canncommercial/latest/maintenref/graphubfusionref/atlasrr_30_0038.html
sourcePath: /source/zh/canncommercial/900/maintenref/graphubfusionref/atlasrr_30_0038.html
indexId: c4f7f46f6067d6c48eb12ba02ad50d314f30f5fa4f44ea9c5bd893a7bdc59f5878
---
# BatchMatMulNonAlignedFusionPass

#### 融合模式

该融合为BatchMatMul非对齐场景下的融合。

模式一：

融合成


模式二：


融合成


#### 使用约束

BatchMatMul输入的M需要是16的倍数，输入的K不能是16的倍数。

transpose中perm值有如下约束：

1、不存在add_2的情况，transpose.perm的值均为{0,2,1,3}

2、存在add_2的情况，transpose_1.perm的值是{0,2,1,3}，transpose_2.perm的值是{0,2,3,1}
