Skip to content

Commit

Permalink
Revert "Reenable LTC in out-of-tree build (#1177)" (#1183)
Browse files Browse the repository at this point in the history
This reverts commit f85ae9c.
  • Loading branch information
henrytwo authored Aug 9, 2022
1 parent 351f154 commit 3e97a33
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .github/workflows/buildAndTest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ jobs:
externals/llvm-project/llvm
cmake --build llvm-build
# TODO: Reenable LTC once OOT build is successful (https://github.com/llvm/torch-mlir/issues/1154)
cmake -GNinja -Bbuild \
-DCMAKE_LINKER=lld \
-DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
Expand All @@ -96,6 +97,7 @@ jobs:
-DMLIR_ENABLE_BINDINGS_PYTHON=OFF \
-DTORCH_MLIR_ENABLE_MHLO=ON \
-DTORCH_MLIR_USE_INSTALLED_PYTORCH=${{ matrix.torch-binary }} \
-DTORCH_MLIR_ENABLE_LTC=OFF \
-DPython3_EXECUTABLE=$(which python) \
.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,15 @@ include_directories(BEFORE
)
link_directories("${TORCH_INSTALL_PREFIX}/lib")

add_library(TorchMLIRJITIRImporter SHARED
# 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)
set(LIBRARY_TYPE "SHARED")
else()
set(LIBRARY_TYPE "MODULE")
endif()

add_library(TorchMLIRJITIRImporter ${LIBRARY_TYPE}
class_annotator.cpp
class_annotator_pybind.cpp
get_registered_ops.cpp
Expand Down
2 changes: 2 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ def run(self):
f"-DMLIR_ENABLE_BINDINGS_PYTHON=ON",
f"-DLLVM_ENABLE_PROJECTS=mlir",
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"-DLLVM_EXTERNAL_PROJECTS=torch-mlir;torch-mlir-dialects",
f"-DLLVM_EXTERNAL_TORCH_MLIR_SOURCE_DIR={src_dir}",
f"-DLLVM_EXTERNAL_TORCH_MLIR_DIALECTS_SOURCE_DIR={src_dir}/externals/llvm-external-projects/torch-mlir-dialects",
Expand Down

0 comments on commit 3e97a33

Please sign in to comment.