From f579964e232c5d63089bf7cdaac8828e6cfa173b Mon Sep 17 00:00:00 2001 From: kmitrovicTT <169657397+kmitrovicTT@users.noreply.github.com> Date: Thu, 23 Jan 2025 06:07:57 +0000 Subject: [PATCH 1/5] Uplift third_party/tt-metal to 182c42462cd61515f60a11a46ee84f303ed073ee 2025-01-23 --- third_party/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/third_party/CMakeLists.txt b/third_party/CMakeLists.txt index ea4a59035..718130e4d 100644 --- a/third_party/CMakeLists.txt +++ b/third_party/CMakeLists.txt @@ -1,6 +1,6 @@ include(ExternalProject) -set(TT_METAL_VERSION "78f2c0b774ab48bf243093d3111717a8c880dc78") +set(TT_METAL_VERSION "182c42462cd61515f60a11a46ee84f303ed073ee") if ("$ENV{ARCH_NAME}" STREQUAL "grayskull") set(ARCH_NAME "grayskull") From b759638803132301176d0132e0edfac79631ebf5 Mon Sep 17 00:00:00 2001 From: Armin Ale Date: Tue, 21 Jan 2025 18:13:16 +0000 Subject: [PATCH 2/5] #1922: update type name (QueryResponse is now ConstraintQueryResponse) --- lib/OpModel/TTNN/TTNNOpModelLib.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/OpModel/TTNN/TTNNOpModelLib.cpp b/lib/OpModel/TTNN/TTNNOpModelLib.cpp index 8f076db7a..3b1da0c2a 100644 --- a/lib/OpModel/TTNN/TTNNOpModelLib.cpp +++ b/lib/OpModel/TTNN/TTNNOpModelLib.cpp @@ -47,7 +47,7 @@ std::tuple>, std::optional> getOpConstraints(const std::string_view &name, Callable &callable, auto &&...args) { - ::ttnn::graph::QueryResponse query; + ::ttnn::graph::ConstraintQueryResponse query; try { query = callable(std::forward(args)...); } catch (const std::exception &e) { From 8e630ea4030851da4e31ef29dabd26aae3742197 Mon Sep 17 00:00:00 2001 From: brataTT Date: Thu, 23 Jan 2025 11:10:00 +0000 Subject: [PATCH 3/5] Remove reference to Tensor constructor deprecated in metal commit ba35246703 --- runtime/lib/ttnn/runtime.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/runtime/lib/ttnn/runtime.cpp b/runtime/lib/ttnn/runtime.cpp index af1d40c4b..fdfed2e36 100644 --- a/runtime/lib/ttnn/runtime.cpp +++ b/runtime/lib/ttnn/runtime.cpp @@ -81,7 +81,7 @@ createOwnedTensor(std::shared_ptr data, return ::ttnn::Tensor( createStorage(data.get(), numElements, dataType), - ::ttnn::Shape(small_vector_shape), utils::toTTNNDataType(dataType), + ::ttnn::SimpleShape(small_vector_shape), utils::toTTNNDataType(dataType), ::ttnn::Layout::ROW_MAJOR); } @@ -128,7 +128,7 @@ Tensor createTensor(std::shared_ptr data, auto tensor = std::make_shared<::ttnn::Tensor>( createStorage(data.get(), numElements, dataType), - ::ttnn::Shape(small_vector_shape), utils::toTTNNDataType(dataType), + ::ttnn::SimpleShape(small_vector_shape), utils::toTTNNDataType(dataType), ::ttnn::Layout::ROW_MAJOR); return Tensor(std::static_pointer_cast(tensor), nullptr, DeviceRuntime::TTNN); From 4a7518e4be4fc232c12d68d3a5d9afe266fe533a Mon Sep 17 00:00:00 2001 From: brataTT Date: Thu, 23 Jan 2025 19:18:08 +0000 Subject: [PATCH 4/5] Update json cpmcache hash include dir and use temp workaround to set -DCMAKE_CXX_SCAN_FOR_MODULES=FALSE - Solves CMAKE_CXX_COMPILER_CLANG_SCAN_DEPS-NOTFOUND error --- third_party/CMakeLists.txt | 3 ++- tools/ttnn-standalone/CMakeLists.txt | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/third_party/CMakeLists.txt b/third_party/CMakeLists.txt index 718130e4d..5d2f262a4 100644 --- a/third_party/CMakeLists.txt +++ b/third_party/CMakeLists.txt @@ -39,7 +39,7 @@ set(TTMETAL_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/third_party/tt-metal/src/tt-metal/.cpmcache/fmt/73b5ec45edbd92babfd91c3777a9e1ab9cac8238/include ${PROJECT_SOURCE_DIR}/third_party/tt-metal/src/tt-metal/.cpmcache/magic_enum/4d76fe0a5b27a0e62d6c15976d02b33c54207096/include ${PROJECT_SOURCE_DIR}/third_party/tt-metal/src/tt-metal/.cpmcache/boost_core/e679bef5c160cf29d0f37d549881dc5f5a58c332/include - ${PROJECT_SOURCE_DIR}/third_party/tt-metal/src/tt-metal/.cpmcache/json/230202b6f5267cbf0c8e5a2f17301964d95f83ff/include + ${PROJECT_SOURCE_DIR}/third_party/tt-metal/src/tt-metal/.cpmcache/json/798e0374658476027d9723eeb67a262d0f3c8308/include ${PROJECT_SOURCE_DIR}/third_party/tt-metal/src/tt-metal/.cpmcache/xtensor/4a957e26c765b48cbec4a4235fe9e518d5a85d3d/include ${PROJECT_SOURCE_DIR}/third_party/tt-metal/src/tt-metal/.cpmcache/xtensor-blas/190c3a4314355b67291a7d78b20a2100de3f8f54/include ${PROJECT_SOURCE_DIR}/third_party/tt-metal/src/tt-metal/.cpmcache/xtl/0918808959d33a292c551b9f014a0e808bc4a95c/include @@ -72,6 +72,7 @@ ExternalProject_Add( -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} -DCMAKE_CXX_COMPILER_LAUNCHER=${CMAKE_CXX_COMPILER_LAUNCHER} + -DCMAKE_CXX_SCAN_FOR_MODULES=FALSE -DENABLE_TRACY=${TT_RUNTIME_ENABLE_PERF_TRACE} -DENABLE_LIBCXX=OFF GIT_REPOSITORY https://github.com/tenstorrent/tt-metal.git diff --git a/tools/ttnn-standalone/CMakeLists.txt b/tools/ttnn-standalone/CMakeLists.txt index 1c9f3280e..ba3a226e4 100644 --- a/tools/ttnn-standalone/CMakeLists.txt +++ b/tools/ttnn-standalone/CMakeLists.txt @@ -61,7 +61,7 @@ set(INCLUDE_DIRS $ENV{TT_METAL_HOME}/.cpmcache/fmt/73b5ec45edbd92babfd91c3777a9e1ab9cac8238/include $ENV{TT_METAL_HOME}/.cpmcache/magic_enum/4d76fe0a5b27a0e62d6c15976d02b33c54207096/include $ENV{TT_METAL_HOME}/.cpmcache/boost_core/e679bef5c160cf29d0f37d549881dc5f5a58c332/include - $ENV{TT_METAL_HOME}/.cpmcache/json/230202b6f5267cbf0c8e5a2f17301964d95f83ff/include + $ENV{TT_METAL_HOME}/.cpmcache/json/798e0374658476027d9723eeb67a262d0f3c8308/include # Metalium $ENV{TT_METAL_HOME} From 03726f96ca494d64d3f38927d130d3cc75a300b4 Mon Sep 17 00:00:00 2001 From: Nicholas Smith Date: Thu, 23 Jan 2025 17:01:47 -0600 Subject: [PATCH 5/5] Update copy_tile_init API to accept CB argument --- include/ttmlir/Dialect/TTKernel/IR/TTKernelOps.td | 2 ++ lib/Conversion/TTIRToTTMetal/TTIRToTTMetal.cpp | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/include/ttmlir/Dialect/TTKernel/IR/TTKernelOps.td b/include/ttmlir/Dialect/TTKernel/IR/TTKernelOps.td index da4c9ef30..684df106e 100644 --- a/include/ttmlir/Dialect/TTKernel/IR/TTKernelOps.td +++ b/include/ttmlir/Dialect/TTKernel/IR/TTKernelOps.td @@ -130,6 +130,8 @@ def TTKernel_CopyTileInitOp : TTKernel_Op<"copy_tile_init"> { let description = [{ Must be called before copy_tile. }]; + + let arguments = (ins TTKernel_CB:$cb0); } def TTKernel_CopyTileOp : TTKernel_Op<"copy_tile"> { diff --git a/lib/Conversion/TTIRToTTMetal/TTIRToTTMetal.cpp b/lib/Conversion/TTIRToTTMetal/TTIRToTTMetal.cpp index 0426ff4e9..c7131b004 100644 --- a/lib/Conversion/TTIRToTTMetal/TTIRToTTMetal.cpp +++ b/lib/Conversion/TTIRToTTMetal/TTIRToTTMetal.cpp @@ -875,6 +875,7 @@ class TTIRToTTMetalEnqueueProgramRewriter // For all unary ops first copy tile from input CB at inCBTileIndex to DST // register at dstTileIndex. + builder.create(location, inCB); builder.create(location, inCB, inCBTileIndex, dstTileIndex); @@ -1010,9 +1011,10 @@ class TTIRToTTMetalEnqueueProgramRewriter builder.create(location); { // copy inCB0[inCB0TileIndex] and inCB1[inCB1TileIndex] to DST: - builder.create(location); + builder.create(location, inCB0); builder.create(location, inCB0, inCB0TileIndex, dstLhsTileIndex); + builder.create(location, inCB1); builder.create(location, inCB1, inCB1TileIndex, dstRhsTileIndex); // SFPU operates on DST tiles: @@ -1077,7 +1079,7 @@ class TTIRToTTMetalEnqueueProgramRewriter auto inputCB = cbOperands[operandIndices[0]]; auto outputCB = inputCB; - builder.create(op.getLoc()); + builder.create(op.getLoc(), inputCB); builder.create(op.getLoc(), inputCB, one); builder.create(op.getLoc()); builder.create(op.getLoc());