torch-mlir icon indicating copy to clipboard operation
torch-mlir copied to clipboard

[TORCH] Add canonicalization of `aten.transpose.int` op

Open Shukla-Gaurav opened this issue 2 years ago • 2 comments

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]

Shukla-Gaurav avatar May 02 '22 16:05 Shukla-Gaurav

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?

cathyzhyi avatar May 02 '22 21:05 cathyzhyi

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?

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!

Shukla-Gaurav avatar May 04 '22 16:05 Shukla-Gaurav