Skip to content

Commit

Permalink
Adding transpose_twice test (#606)
Browse files Browse the repository at this point in the history
* Fixing layouting for output and op rewrite

* Adding rewrite

* Addressing comments
  • Loading branch information
mtopalovicTT authored Sep 6, 2024
1 parent d1d96c1 commit 2a95b1e
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions test/ttmlir/Dialect/TTNN/transpose/transpose_twice.mlir
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// RUN: ttmlir-opt --ttir-to-ttnn-backend-pipeline %s | FileCheck %s
#any_device_tile = #tt.operand_constraint<dram|l1|tile|any_device_tile>
module attributes {} {
func.func @forward(%arg0: tensor<1x16x32x64xbf16>) -> tensor<1x32x64x16xbf16> {
%0 = tensor.empty() : tensor<1x64x32x16xbf16>
// CHECK: %[[C:.*]] = "ttnn.transpose"[[C:.*]]
%1 = "ttir.transpose"(%arg0, %0) <{dim0 = -3 : si32, dim1 = -1 : si32, operand_constraints = [#any_device_tile, #any_device_tile]}> : (tensor<1x16x32x64xbf16>, tensor<1x64x32x16xbf16>) -> tensor<1x64x32x16xbf16>
%2 = tensor.empty() : tensor<1x32x64x16xbf16>
// CHECK: %[[C:.*]] = "ttnn.transpose
%3 = "ttir.transpose"(%1, %2) <{dim0 = -3 : si32, dim1 = -2 : si32, operand_constraints = [#any_device_tile, #any_device_tile]}> : (tensor<1x64x32x16xbf16>, tensor<1x32x64x16xbf16>) -> tensor<1x32x64x16xbf16>
return %3 : tensor<1x32x64x16xbf16>
}
}

0 comments on commit 2a95b1e

Please sign in to comment.