-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move StableHLO to env dir and resolve build issues.
- Loading branch information
Showing
15 changed files
with
161 additions
and
228 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,26 @@ | ||
include_directories(${PROJECT_SOURCE_DIR}/third_party/stablehlo/src/stablehlo) | ||
include_directories(${PROJECT_SOURCE_DIR}/third_party/stablehlo/src/stablehlo-build) | ||
add_library(TTMLIRConversions INTERFACE) | ||
|
||
if (TTMLIR_ENABLE_STABLEHLO) | ||
include_directories(${TTMLIR_TOOLCHAIN_DIR}/src/stablehlo) | ||
include_directories(${TTMLIR_TOOLCHAIN_DIR}/src/stablehlo-build) | ||
add_subdirectory(StableHLOToTTIR) | ||
add_dependencies(TTMLIRConversions stablehlo) | ||
endif() | ||
|
||
add_subdirectory(TosaToTTIR) | ||
add_subdirectory(TTNNToEmitC) | ||
add_subdirectory(TTIRToTTNN) | ||
|
||
add_library(TTMLIRConversions INTERFACE) | ||
set(link_libs | ||
TTMLIRTosaToTTIR; | ||
TTMLIRTTNNToEmitC; | ||
TTMLIRTTIRToTTNN | ||
) | ||
|
||
add_dependencies(TTMLIRConversions stablehlo) | ||
if (TTMLIR_ENABLE_STABLEHLO) | ||
list(APPEND link_libs TTMLIRStableHLOToTTIR) | ||
endif() | ||
|
||
target_link_libraries(TTMLIRConversions INTERFACE | ||
TTMLIRStableHLOToTTIR | ||
TTMLIRTosaToTTIR | ||
TTMLIRTTNNToEmitC | ||
TTMLIRTTIRToTTNN | ||
${link_libs} | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,17 @@ | ||
include_directories(${PROJECT_SOURCE_DIR}/third_party/stablehlo/src/stablehlo) | ||
include_directories(${PROJECT_SOURCE_DIR}/third_party/stablehlo/src/stablehlo-build) | ||
include_directories(${TTMLIR_TOOLCHAIN_DIR}/src/stablehlo) | ||
include_directories(${TTMLIR_TOOLCHAIN_DIR}/src/stablehlo-build) | ||
|
||
get_property(STABLEHLO_LIBS GLOBAL PROPERTY STABLEHLO_LIBS) | ||
if (TTMLIR_ENABLE_STABLEHLO) | ||
add_mlir_library(TTMLIRStableHLOToTTIR | ||
StableHLOToTTIR.cpp | ||
|
||
ADDITIONAL_HEADER_DIRS | ||
${PROJECT_SOURCE_DIR}/include/ttmlir/Conversion/StableHLOToTTIR | ||
# StableHLO includes | ||
${PROJECT_SOURCE_DIR}/third_party/stablehlo/src/stablehlo | ||
${PROJECT_SOURCE_DIR}/third_party/stablehlo/src/stablehlo-build | ||
|
||
DEPENDS | ||
TTMLIRConversionPassIncGen | ||
stablehlo | ||
|
||
LINK_LIBS PUBLIC | ||
MLIRTransformUtils | ||
${STABLEHLO_LIBS} | ||
) | ||
endif () |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,72 @@ | ||
include(ExternalProject) | ||
|
||
include(tt-metal.cmake) | ||
if (TTMLIR_ENABLE_STABLEHLO) | ||
include(stablehlo.cmake) | ||
if ("$ENV{ARCH_NAME}" STREQUAL "grayskull") | ||
set(ARCH_NAME "grayskull") | ||
set(ARCH_EXTRA_DIR "grayskull") | ||
elseif ("$ENV{ARCH_NAME}" STREQUAL "wormhole_b0") | ||
set(ARCH_NAME "wormhole") | ||
set(ARCH_EXTRA_DIR "wormhole/wormhole_b0_defines") | ||
elseif ("$ENV{ARCH_NAME}" STREQUAL "blackhole") | ||
set(ARCH_NAME "blackhole") | ||
set(ARCH_EXTRA_DIR "blackhole") | ||
else() | ||
message(FATAL_ERROR "Unsupported ARCH_NAME: $ENV{ARCH_NAME}") | ||
endif() | ||
|
||
if (TT_RUNTIME_ENABLE_PERF_TRACE) | ||
add_compile_definitions(TRACY_ENABLE) | ||
set(ENV{ENABLE_TRACY} "1") | ||
else() | ||
set(ENV{ENABLE_TRACY} "0") | ||
endif() | ||
|
||
set(TTMETAL_INCLUDE_DIRS | ||
${PROJECT_SOURCE_DIR}/third_party/tt-metal/src/tt-metal/ttnn/cpp | ||
${PROJECT_SOURCE_DIR}/third_party/tt-metal/src/tt-metal/ttnn/cpp/ttnn/deprecated | ||
${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/fmt | ||
${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} | ||
${PROJECT_SOURCE_DIR}/third_party/tt-metal/src/tt-metal/tt_metal/third_party/umd/src/firmware/riscv/${ARCH_NAME} | ||
${PROJECT_SOURCE_DIR}/third_party/tt-metal/src/tt-metal/tt_eager | ||
${PROJECT_SOURCE_DIR}/third_party/tt-metal/src/tt-metal/.cpmcache/reflect/e75434c4c5f669e4a74e4d84e0a30d7249c1e66f | ||
PARENT_SCOPE | ||
) | ||
|
||
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(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) | ||
|
||
ExternalProject_Add( | ||
tt-metal | ||
PREFIX ${TTMLIR_SOURCE_DIR}/third_party/tt-metal | ||
CMAKE_GENERATOR Ninja | ||
CMAKE_ARGS | ||
-DCMAKE_BUILD_TYPE=Release | ||
-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} | ||
-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} | ||
-DCMAKE_CXX_COMPILER_LAUNCHER=${CMAKE_CXX_COMPILER_LAUNCHER} | ||
-DTRACY_ENABLE=${TT_RUNTIME_ENABLE_PERF_TRACE} | ||
GIT_REPOSITORY https://github.com/tenstorrent/tt-metal.git | ||
GIT_TAG f6a2e5cb2b857bf4c72401bea68adf98c25bbe47 | ||
GIT_PROGRESS ON | ||
BUILD_BYPRODUCTS ${TTNN_LIBRARY_PATH} ${TTMETAL_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}) | ||
|
||
foreach(lib_name lib_path IN ZIP_LISTS library_names library_paths) | ||
add_library(${lib_name} SHARED IMPORTED GLOBAL) | ||
set_target_properties(${lib_name} PROPERTIES EXCLUDE_FROM_ALL TRUE IMPORTED_LOCATION ${lib_path}) | ||
add_dependencies(${lib_name} tt-metal) | ||
endforeach() |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.