From a75fcf32aa142d3a3dbf86d307027a0706e9c32b Mon Sep 17 00:00:00 2001 From: Kyle Mabee <118925087+kmabeeTT@users.noreply.github.com> Date: Tue, 3 Sep 2024 22:16:40 -0400 Subject: [PATCH] Update RUN cmds for 3x TTMetal tests to include "ttmlir-translate --ttmetal-to-flatbuffer" (#603) - Needed after 5d60c17 today otherwise tests don't run on CI - fix linking of ttmlir-translate for macos --- test/ttmlir/Silicon/TTMetal/simple_eltwise.mlir | 5 ++++- test/ttmlir/Silicon/TTMetal/tiled_reblock.mlir | 5 ++++- test/ttmlir/Silicon/TTMetal/to_layout.mlir | 5 ++++- tools/ttmlir-translate/CMakeLists.txt | 11 +++++++---- 4 files changed, 19 insertions(+), 7 deletions(-) diff --git a/test/ttmlir/Silicon/TTMetal/simple_eltwise.mlir b/test/ttmlir/Silicon/TTMetal/simple_eltwise.mlir index 1162bfc5c..337f71903 100644 --- a/test/ttmlir/Silicon/TTMetal/simple_eltwise.mlir +++ b/test/ttmlir/Silicon/TTMetal/simple_eltwise.mlir @@ -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 func.func @multiply(%arg0: tensor<64x128xf32>, %arg1: tensor<64x128xf32>) -> tensor<64x128xf32> { diff --git a/test/ttmlir/Silicon/TTMetal/tiled_reblock.mlir b/test/ttmlir/Silicon/TTMetal/tiled_reblock.mlir index 8071567b7..f1a7bfa8c 100644 --- a/test/ttmlir/Silicon/TTMetal/tiled_reblock.mlir +++ b/test/ttmlir/Silicon/TTMetal/tiled_reblock.mlir @@ -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 #untilized = #tt.layout<(d0, d1) -> (d0, d1), undef, <1x1>, memref<64x128xf32, #l1_>, none_layout> diff --git a/test/ttmlir/Silicon/TTMetal/to_layout.mlir b/test/ttmlir/Silicon/TTMetal/to_layout.mlir index 108a7ca6c..38b218c5f 100644 --- a/test/ttmlir/Silicon/TTMetal/to_layout.mlir +++ b/test/ttmlir/Silicon/TTMetal/to_layout.mlir @@ -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 #layout = #tt.layout<(d0, d1) -> (d0, d1), undef, <1x1>, memref<4x16xf32, #l1_>, none_layout> diff --git a/tools/ttmlir-translate/CMakeLists.txt b/tools/ttmlir-translate/CMakeLists.txt index e57bdbbd1..0b588d322 100644 --- a/tools/ttmlir-translate/CMakeLists.txt +++ b/tools/ttmlir-translate/CMakeLists.txt @@ -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)