mirror of https://github.com/llvm/torch-mlir
Update LTC CMake hack documentation (#1155)
* Update CMakeLists.txt * Update CMakeLists.txt * Update CMakeLists.txt * Update CMakeLists.txt * Update buildAndTest.yml * Update setup.py * Address review commentspull/1166/head
parent
8ce5d3f12c
commit
e322f6a878
|
@ -87,6 +87,7 @@ jobs:
|
||||||
externals/llvm-project/llvm
|
externals/llvm-project/llvm
|
||||||
cmake --build llvm-build
|
cmake --build llvm-build
|
||||||
|
|
||||||
|
# TODO: Reenable LTC once OOT build is successful (https://github.com/llvm/torch-mlir/issues/1154)
|
||||||
cmake -GNinja -Bbuild \
|
cmake -GNinja -Bbuild \
|
||||||
-DCMAKE_LINKER=lld \
|
-DCMAKE_LINKER=lld \
|
||||||
-DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
|
-DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
|
||||||
|
|
|
@ -87,7 +87,8 @@ declare_mlir_python_extension(TorchMLIRPythonExtensions.Main
|
||||||
if(TORCH_MLIR_ENABLE_LTC)
|
if(TORCH_MLIR_ENABLE_LTC)
|
||||||
add_subdirectory(torch_mlir/csrc/base_lazy_backend)
|
add_subdirectory(torch_mlir/csrc/base_lazy_backend)
|
||||||
endif()
|
endif()
|
||||||
# Reference backend has a separate check for TORCH_MLIR_ENABLE_LTC.
|
# Reference backend has a separate check for TORCH_MLIR_ENABLE_LTC, since it
|
||||||
|
# generates a dummy Python library when disabled.
|
||||||
add_subdirectory(torch_mlir/csrc/reference_lazy_backend)
|
add_subdirectory(torch_mlir/csrc/reference_lazy_backend)
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
|
@ -10,7 +10,8 @@ include_directories(BEFORE
|
||||||
)
|
)
|
||||||
link_directories("${TORCH_INSTALL_PREFIX}/lib")
|
link_directories("${TORCH_INSTALL_PREFIX}/lib")
|
||||||
|
|
||||||
# Hack! Currently out-of-tree build fails when this is set to SHARED, so we have this toggle
|
# TODO: Currently, out-of-tree build fails when LIBRARY_TYPE is set to SHARED, so we have this toggle.
|
||||||
|
# See https://github.com/llvm/torch-mlir/issues/1154 for more details.
|
||||||
if(TORCH_MLIR_ENABLE_LTC)
|
if(TORCH_MLIR_ENABLE_LTC)
|
||||||
set(LIBRARY_TYPE "SHARED")
|
set(LIBRARY_TYPE "SHARED")
|
||||||
else()
|
else()
|
||||||
|
|
1
setup.py
1
setup.py
|
@ -76,6 +76,7 @@ class CMakeBuild(build_py):
|
||||||
f"-DMLIR_ENABLE_BINDINGS_PYTHON=ON",
|
f"-DMLIR_ENABLE_BINDINGS_PYTHON=ON",
|
||||||
f"-DLLVM_ENABLE_PROJECTS=mlir",
|
f"-DLLVM_ENABLE_PROJECTS=mlir",
|
||||||
f"-DTORCH_MLIR_ENABLE_MHLO=ON",
|
f"-DTORCH_MLIR_ENABLE_MHLO=ON",
|
||||||
|
# TODO: Reenable LTC once JIT importer linkage issue is fixed (https://github.com/llvm/torch-mlir/issues/1154)
|
||||||
f"-DTORCH_MLIR_ENABLE_LTC=OFF",
|
f"-DTORCH_MLIR_ENABLE_LTC=OFF",
|
||||||
f"-DLLVM_EXTERNAL_PROJECTS=torch-mlir;torch-mlir-dialects",
|
f"-DLLVM_EXTERNAL_PROJECTS=torch-mlir;torch-mlir-dialects",
|
||||||
f"-DLLVM_EXTERNAL_TORCH_MLIR_SOURCE_DIR={src_dir}",
|
f"-DLLVM_EXTERNAL_TORCH_MLIR_SOURCE_DIR={src_dir}",
|
||||||
|
|
Loading…
Reference in New Issue