torch-mlir
torch-mlir copied to clipboard
[TORCH] Add canonicalization of `aten.transpose.int` op
This commit adds a canonicalization of aten.tranpose.int
op when its
operand is aten.permute
op.
aten.permute
+ aten.transpose.int
-> aten.permute
Signed-Off-by: Gaurav Shukla [email protected]
Also I think this is only an optimization when the transpose
is the only user of the original permute
. Otherwise, we would be replacing one transpose
with a listcontruct
and an additional permute
. Is this needed for performance optimization?
Also I think this is only an optimization when the
transpose
is the only user of the originalpermute
. Otherwise, we would be replacing onetranspose
with alistcontruct
and an additionalpermute
. Is this needed for performance optimization?
Yes, this is needed for the performance optimization of BERT. I will check for the users of permute
op. That's a good point, Thanks!