Skip to content

Commit

Permalink
Update RUN cmds for 3x TTMetal tests to include "ttmlir-translate --t…
Browse files Browse the repository at this point in the history
…tmetal-to-flatbuffer" (#603)

- Needed after 5d60c17 today otherwise tests don't run on CI
- fix linking of ttmlir-translate for macos
  • Loading branch information
kmabeeTT authored Sep 4, 2024
1 parent ada3b6c commit a75fcf3
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 7 deletions.
5 changes: 4 additions & 1 deletion test/ttmlir/Silicon/TTMetal/simple_eltwise.mlir
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
// RUN: ttmlir-opt --ttir-load-system-desc="path=%system_desc_path%" --ttir-to-ttmetal-backend-pipeline %s | FileCheck %s
// RUN: ttmlir-opt --ttir-load-system-desc="path=%system_desc_path%" --ttir-to-ttmetal-backend-pipeline %s > %t.mlir
// RUN: FileCheck %s --input-file=%t.mlir
// RUN: ttmlir-translate --ttmetal-to-flatbuffer %t.mlir > %t.ttm

#any_device = #tt.operand_constraint<dram|l1|scalar|tile|any_device|any_device_tile>

func.func @multiply(%arg0: tensor<64x128xf32>, %arg1: tensor<64x128xf32>) -> tensor<64x128xf32> {
Expand Down
5 changes: 4 additions & 1 deletion test/ttmlir/Silicon/TTMetal/tiled_reblock.mlir
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
// RUN: ttmlir-opt --ttir-load-system-desc="path=%system_desc_path%" --ttir-implicit-device --ttir-allocate --convert-ttir-to-ttmetal %s | FileCheck %s
// RUN: ttmlir-opt --ttir-load-system-desc="path=%system_desc_path%" --ttir-implicit-device --ttir-allocate --convert-ttir-to-ttmetal %s > %t.mlir
// RUN: FileCheck %s --input-file=%t.mlir
// RUN: ttmlir-translate --ttmetal-to-flatbuffer %t.mlir > %t.ttm

#l1_ = #tt.memory_space<l1>

#untilized = #tt.layout<(d0, d1) -> (d0, d1), undef, <1x1>, memref<64x128xf32, #l1_>, none_layout>
Expand Down
5 changes: 4 additions & 1 deletion test/ttmlir/Silicon/TTMetal/to_layout.mlir
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
// RUN: ttmlir-opt --ttir-load-system-desc="path=%system_desc_path%" --ttir-implicit-device --ttir-allocate --convert-ttir-to-ttmetal %s | FileCheck %s
// RUN: ttmlir-opt --ttir-load-system-desc="path=%system_desc_path%" --ttir-implicit-device --ttir-allocate --convert-ttir-to-ttmetal %s > %t.mlir
// RUN: FileCheck %s --input-file=%t.mlir
// RUN: ttmlir-translate --ttmetal-to-flatbuffer %t.mlir > %t.ttm

#l1_ = #tt.memory_space<l1>

#layout = #tt.layout<(d0, d1) -> (d0, d1), undef, <1x1>, memref<4x16xf32, #l1_>, none_layout>
Expand Down
11 changes: 7 additions & 4 deletions tools/ttmlir-translate/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
get_property(translation_libs GLOBAL PROPERTY MLIR_TRANSLATION_LIBS)
get_property(dialect_libs GLOBAL PROPERTY MLIR_DIALECT_LIBS)
set(LIBS ${translation_libs} ${dialect_libs} TTMLIRTTNNToEmitC TTNNTargetFlatbuffer TTMetalTargetFlatbuffer)
add_llvm_executable(ttmlir-translate ttmlir-translate.cpp)

llvm_update_compile_flags(ttmlir-translate)
target_link_libraries(ttmlir-translate PRIVATE ${LIBS})
target_link_libraries(ttmlir-translate PRIVATE
TTNNTargetFlatbuffer
TTMetalTargetFlatbuffer
MLIRTTNNTransforms
TTMLIRTTNNToEmitC
TTMLIRTTKernelToEmitC
)

mlir_check_link_libraries(ttmlir-translate)

0 comments on commit a75fcf3

Please sign in to comment.