-
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.
- Loading branch information
Showing
20 changed files
with
77 additions
and
114 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[submodule "third_party/stablehlo"] | ||
path = third_party/stablehlo | ||
url = https://github.com/openxla/stablehlo |
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,3 +1 @@ | ||
add_subdirectory(ttmlir) | ||
include_directories(${PROJECT_SOURCE_DIR}/third_party/stablehlo/src/stablehlo) | ||
include_directories(${PROJECT_SOURCE_DIR}/third_party/stablehlo/src/stablehlo-build) |
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,3 +1,11 @@ | ||
include_directories(${TTMLIR_TOOLCHAIN_DIR}/src/stablehlo) | ||
include_directories(${TTMLIR_TOOLCHAIN_DIR}/src/stablehlo-build) | ||
include_directories(${TTMLIR_SOURCE_DIR}/include) | ||
|
||
set(LLVM_TARGET_DEFINITIONS Passes.td) | ||
if (TTMLIR_ENABLE_STABLEHLO) | ||
mlir_tablegen(Passes.h.inc -gen-pass-decls -name TTMLIRConversion -DTTMLIR_ENABLE_STABLEHLO) | ||
else() | ||
mlir_tablegen(Passes.h.inc -gen-pass-decls -name TTMLIRConversion) | ||
endif() | ||
add_public_tablegen_target(TTMLIRConversionPassIncGen) |
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,40 +1,26 @@ | ||
include_directories(${TTMLIR_TOOLCHAIN_DIR}/src/stablehlo) | ||
include_directories(${TTMLIR_TOOLCHAIN_DIR}/src/stablehlo-build) | ||
|
||
add_subdirectory(CAPI) | ||
add_subdirectory(Conversion) | ||
add_subdirectory(Dialect) | ||
add_subdirectory(Target) | ||
|
||
# Shared library will include runtime code | ||
# so we only build it if runtime is enabled | ||
|
||
set(ttmlir_dependencies "") | ||
set(link_libs | ||
MLIR; | ||
MLIRTTDialect; | ||
MLIRTTIRDialect; | ||
MLIRTTIRTransforms; | ||
TTMLIRConversions; | ||
MLIRTTIRAnalysis; | ||
MLIRTTNNDialect; | ||
MLIRTTNNTransforms; | ||
MLIRTTKernelDialect; | ||
MLIRTTMetalDialect; | ||
MLIRTTMetalTransforms; | ||
MLIRTTNNPipelines | ||
) | ||
|
||
if (TTMLIR_ENABLE_STABLEHLO) | ||
list(APPEND link_libs TTMLIRStableHLOToTTIR) | ||
if (TTMLIR_ENABLE_RUNTIME) | ||
add_subdirectory(SharedLib) | ||
endif() | ||
|
||
add_mlir_library(TTMLIRStatic STATIC RegisterAll.cpp | ||
|
||
DEPENDS | ||
${ttmlir_dependencies} | ||
|
||
LINK_LIBS PUBLIC | ||
${link_libs} | ||
MLIR | ||
MLIRTTDialect | ||
MLIRTTIRDialect | ||
MLIRTTIRTransforms | ||
TTMLIRConversions | ||
MLIRTTIRAnalysis | ||
MLIRTTNNDialect | ||
MLIRTTNNTransforms | ||
MLIRTTKernelDialect | ||
MLIRTTMetalDialect | ||
MLIRTTMetalTransforms | ||
MLIRTTNNPipelines | ||
) | ||
|
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,3 +1,18 @@ | ||
// RUN: ttmlir-opt --show-dialects | FileCheck %s | ||
// CHECK: Available Dialects: | ||
// CHECK-SAME: arith,builtin,cf,emitc,func,linalg,ml_program,scf,tensor,tosa,tt,ttir,ttkernel,ttmetal,ttnn,vector | ||
// CHECK: arith | ||
// CHECK: builtin | ||
// CHECK: cf | ||
// CHECK: emitc | ||
// CHECK: func | ||
// CHECK: linalg | ||
// CHECK: ml_program | ||
// CHECK: scf | ||
// CHECK: tensor | ||
// CHECK: tosa | ||
// CHECK: tt | ||
// CHECK: ttir | ||
// CHECK: ttkernel | ||
// CHECK: ttmetal | ||
// CHECK: ttnn | ||
// CHECK: vector |
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,7 +1,2 @@ | ||
include(ExternalProject) | ||
|
||
include_directories(${PROJECT_SOURCE_DIR}/third_party/stablehlo/src/stablehlo) | ||
include_directories(${PROJECT_SOURCE_DIR}/third_party/stablehlo/src/stablehlo-build) | ||
|
||
add_subdirectory(ttmlir-opt) | ||
add_subdirectory(ttmlir-translate) |
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,17 +1,9 @@ | ||
get_property(dialect_libs GLOBAL PROPERTY MLIR_DIALECT_LIBS) | ||
get_property(conversion_libs GLOBAL PROPERTY MLIR_CONVERSION_LIBS) | ||
set(LIBS ${dialect_libs} ${conversion_libs} StablehloBase TTNNTargetFlatbuffer MLIRTTIRDialect TTMLIRConversions MLIRTransformUtils MLIROptLib MLIRTargetCpp TTMLIRStatic CheckOps ChloCAPI ChloOps InterpreterOps StablehloAssemblyFormat StablehloBase StablehloBroadcastUtils StablehloCAPI StablehloLinalgTransforms StablehloOps StablehloPasses StablehloPortableApi StablehloRegister StablehloSerialization StablehloTOSATransforms StablehloTestUtils StablehloTypeInference Version VhloCAPI VhloOps VhloTypes) | ||
|
||
if (TTMLIR_ENABLE_STABLEHLO) | ||
list(APPEND LIBS TTMLIRStableHLOToTTIR) | ||
endif() | ||
|
||
set(LIBS ${dialect_libs} ${conversion_libs} MLIROptLib MLIRTargetCpp TTMLIRStatic) | ||
add_llvm_executable(ttmlir-opt ttmlir-opt.cpp) | ||
|
||
target_link_directories(ttmlir-opt PRIVATE ${TTMLIR_PROJECT_DIR}/build/lib) | ||
target_link_libraries(ttmlir-opt PRIVATE ${LIBS} libStablehloBase.a) | ||
target_link_directories(ttmlir-opt PRIVATE ${TTMLIR_TOOLCHAIN_DIR}/lib) | ||
|
||
llvm_update_compile_flags(ttmlir-opt) | ||
target_link_libraries(ttmlir-opt PRIVATE ${LIBS}) | ||
|
||
mlir_check_all_link_libraries(ttmlir-opt ${LIBS}) | ||
mlir_check_all_link_libraries(ttmlir-opt) |
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