BatchMatmulNonAlignedFusionPass

Description

Performs fusion in the batchmatmul non-alignment scenario.

Mode 1:

Before: After:

Mode 2:

After:

Restrictions

The value of input M in batchmatmul must be a multiple of 16, while the value of input K cannot be a multiple of 16.

Restrictions on the perm value in transpose are as follow:

1. If add_2 does not exist, the value of transpose.perm is {0,2,1,3}.

2. If add_2 exists, the value of transpose_1.perm is {0,2,1,3}, and the value of transpose_2.perm is {0,2,3,1}.