Skip to content

Commit

Permalink
Uplift third_party/tt-metal to ab3dc0c4f5c3ce9722261c878970bfa92a212f…
Browse files Browse the repository at this point in the history
…c9 2024-12-02 (#1439)

* Uplift third_party/tt-metal to ab3dc0c4f5c3ce9722261c878970bfa92a212fc9 2024-12-02
* Linker and Include compile fixes (required with tt-metal uplift)
 - Create DEVICE_LIBRARY as libdevice.so and link against it everywhere we
   link against TTMETAL_LIBRARY (libtt_metal.so)
 - Update UMD include path for headers to include "api" folder in path

---------

Co-authored-by: kmitrovicTT <[email protected]>
Co-authored-by: Kyle Mabee <[email protected]>
  • Loading branch information
3 people authored Dec 3, 2024
1 parent 139c7cc commit 0640c7c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
4 changes: 2 additions & 2 deletions runtime/lib/ttmetal/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ target_include_directories(TTRuntimeTTMetal PUBLIC
${PROJECT_BINARY_DIR}/include/ttmlir/Target/Common
)
target_include_directories(TTRuntimeTTMetal SYSTEM PUBLIC "$<BUILD_INTERFACE:${TTMETAL_INCLUDE_DIRS}>")
target_link_libraries(TTRuntimeTTMetal PUBLIC TTMETAL_LIBRARY)
add_dependencies(TTRuntimeTTMetal TTMETAL_LIBRARY tt-metal FBS_GENERATION)
target_link_libraries(TTRuntimeTTMetal PUBLIC TTMETAL_LIBRARY DEVICE_LIBRARY)
add_dependencies(TTRuntimeTTMetal TTMETAL_LIBRARY DEVICE_LIBRARY tt-metal FBS_GENERATION)

# Optionally compile profiling code and link tracy client for perf profiling.
1 change: 1 addition & 0 deletions runtime/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ target_include_directories(TTRuntimeTEST INTERFACE

target_link_libraries(TTRuntimeTEST INTERFACE
TTMETAL_LIBRARY
DEVICE_LIBRARY
TTBinary
TTRuntime
TTRuntimeTTNN
Expand Down
12 changes: 7 additions & 5 deletions third_party/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
include(ExternalProject)

set(TT_METAL_VERSION "82ba2cbad64d1e36cad446d1f2f9bd266883ae74")
set(TT_METAL_VERSION "ab3dc0c4f5c3ce9722261c878970bfa92a212fc9")

if ("$ENV{ARCH_NAME}" STREQUAL "grayskull")
set(ARCH_NAME "grayskull")
Expand All @@ -22,7 +22,7 @@ set(TTMETAL_INCLUDE_DIRS
${PROJECT_SOURCE_DIR}/third_party/tt-metal/src/tt-metal
${PROJECT_SOURCE_DIR}/third_party/tt-metal/src/tt-metal/tt_metal
${PROJECT_SOURCE_DIR}/third_party/tt-metal/src/tt-metal/tt_metal/third_party/umd
${PROJECT_SOURCE_DIR}/third_party/tt-metal/src/tt-metal/tt_metal/third_party/umd/device
${PROJECT_SOURCE_DIR}/third_party/tt-metal/src/tt-metal/tt_metal/third_party/umd/device/api
${PROJECT_SOURCE_DIR}/third_party/tt-metal/src/tt-metal/tt_metal/hw/inc
${PROJECT_SOURCE_DIR}/third_party/tt-metal/src/tt-metal/tt_metal/hw/inc/${ARCH_NAME}
${PROJECT_SOURCE_DIR}/third_party/tt-metal/src/tt-metal/tt_metal/hw/inc/${ARCH_EXTRA_DIR}
Expand All @@ -40,6 +40,7 @@ set(TTMETAL_INCLUDE_DIRS
set(TTMETAL_LIBRARY_DIR ${PROJECT_SOURCE_DIR}/third_party/tt-metal/src/tt-metal-build/lib)
set(TTNN_LIBRARY_PATH ${TTMETAL_LIBRARY_DIR}/_ttnn.so)
set(TTMETAL_LIBRARY_PATH ${TTMETAL_LIBRARY_DIR}/libtt_metal.so)
set(DEVICE_LIBRARY_PATH ${TTMETAL_LIBRARY_DIR}/libdevice.so)
if (TT_RUNTIME_ENABLE_PERF_TRACE)
set(TRACY_LIBRARY_PATH ${TTMETAL_LIBRARY_DIR}/libtracy.so)
else()
Expand All @@ -49,6 +50,7 @@ endif()
set(TTMETAL_LIBRARY_DIR ${TTMETAL_LIBRARY_DIR} PARENT_SCOPE)
set(TTNN_LIBRARY_PATH ${TTNN_LIBRARY_PATH} PARENT_SCOPE)
set(TTMETAL_LIBRARY_PATH ${TTMETAL_LIBRARY_PATH} PARENT_SCOPE)
set(DEVICE_LIBRARY_PATH ${DEVICE_LIBRARY_PATH} PARENT_SCOPE)
set(TRACY_LIBRARY_PATH ${TRACY_LIBRARY_PATH} PARENT_SCOPE)

ExternalProject_Add(
Expand All @@ -66,13 +68,13 @@ ExternalProject_Add(
GIT_REPOSITORY https://github.com/tenstorrent/tt-metal.git
GIT_TAG ${TT_METAL_VERSION}
GIT_PROGRESS ON
BUILD_BYPRODUCTS ${TTNN_LIBRARY_PATH} ${TTMETAL_LIBRARY_PATH} ${TRACY_LIBRARY_PATH}
BUILD_BYPRODUCTS ${TTNN_LIBRARY_PATH} ${TTMETAL_LIBRARY_PATH} ${TRACY_LIBRARY_PATH} ${DEVICE_LIBRARY_PATH}
)

set_target_properties(tt-metal PROPERTIES EXCLUDE_FROM_ALL TRUE)

list(APPEND library_names TTNN_LIBRARY TTMETAL_LIBRARY)
list(APPEND library_paths ${TTNN_LIBRARY_PATH} ${TTMETAL_LIBRARY_PATH})
list(APPEND library_names TTNN_LIBRARY TTMETAL_LIBRARY DEVICE_LIBRARY)
list(APPEND library_paths ${TTNN_LIBRARY_PATH} ${TTMETAL_LIBRARY_PATH} ${DEVICE_LIBRARY_PATH})

if (TT_RUNTIME_ENABLE_PERF_TRACE)
list(APPEND library_names TRACY_LIBRARY)
Expand Down

0 comments on commit 0640c7c

Please sign in to comment.