Skip to content

Commit

Permalink
Add back to layout ttmetal test with unsupported llvm tag (#463)
Browse files Browse the repository at this point in the history
  • Loading branch information
tapspatel authored Aug 22, 2024
1 parent 0dac73e commit f9a2626
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions test/ttmlir/Silicon/TTMetal/to_layout.mlir
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// RUN: ttmlir-opt --ttir-load-system-desc="path=%system_desc_path%" --ttir-implicit-device --ttir-allocate --convert-ttir-to-ttmetal --ttmetal-serialize-to-binary="output=%t.ttm" %s | FileCheck %s
// UNSUPPORTED: true
#l1_ = #tt.memory_space<l1>

#layout = #tt.layout<(d0, d1) -> (d0, d1), undef, <1x1>, memref<4x16xf32, #l1_>>
#layout1 = #tt.layout<(d0, d1) -> (d0, d1), undef, <2x2>, memref<2x8xf32, #l1_>>
func.func @simple(%arg0: tensor<4x16xf32, #layout>) -> tensor<4x16xf32, #layout1> {
%0 = tensor.empty() : tensor<4x16xf32, #layout1>
// CHECK: %[[C:.*]] = "ttmetal.dispatch"[[C:.*]]
%1 = "ttir.to_layout"(%arg0, %0) : (tensor<4x16xf32, #layout>, tensor<4x16xf32, #layout1>) -> tensor<4x16xf32, #layout1>
return %1 : tensor<4x16xf32, #layout1>
}

#untilized = #tt.layout<(d0, d1) -> (d0, d1), undef, <1x1>, memref<64x128xf32, #l1_>>
#tilized = #tt.layout<(d0, d1) -> (d0, d1), undef, <1x1>, memref<2x4x!tt.tile<32 x 32, f32>, #l1_>>
func.func @tilize(%arg0: tensor<64x128xf32, #untilized>) -> tensor<64x128xf32, #untilized> {
%0 = tensor.empty() : tensor<64x128xf32, #tilized>
// CHECK: %[[C:.*]] = "ttmetal.dispatch"[[C:.*]]
%1 = "ttir.to_layout"(%arg0, %0) : (tensor<64x128xf32, #untilized>, tensor<64x128xf32, #tilized>) -> tensor<64x128xf32, #tilized>
%2 = tensor.empty() : tensor<64x128xf32, #untilized>
// CHECK: %[[C:.*]] = "ttmetal.dispatch"[[C:.*]]
%3 = "ttir.to_layout"(%1, %2) : (tensor<64x128xf32, #tilized>, tensor<64x128xf32, #untilized>) -> tensor<64x128xf32, #untilized>
return %3 : tensor<64x128xf32, #untilized>
}

0 comments on commit f9a2626

Please sign in to comment.