Skip to content

Commit

Permalink
Disable LTC during macOS package gen
Browse files Browse the repository at this point in the history
  • Loading branch information
henrytwo committed Aug 19, 2022
1 parent 97c8ef4 commit 5fa7151
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
1 change: 1 addition & 0 deletions .github/workflows/buildAndTest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ jobs:
# cross compile, can't test arm64
if: ${{ matrix.os-arch == 'macos-arm64' && matrix.llvm-build == 'in-tree' }}
run: |
# TODO: Reenable LTC after build on macOS-arm64 is fixed (https://github.com/llvm/torch-mlir/issues/1253)
cmake -GNinja -Bbuild_arm64 \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_COMPILER=clang \
Expand Down
4 changes: 4 additions & 0 deletions build_tools/python_deploy/build_macos_packages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ export CMAKE_OSX_ARCHITECTURES="${TORCH_MLIR_OSX_ARCH:-arm64;x86_64}"
echo "CMAKE_OSX_ARCHITECTURES: $CMAKE_OSX_ARCHITECTURES"
echo "MACOSX_DEPLOYMENT_TARGET $MACOSX_DEPLOYMENT_TARGET"

# Disable LTC build on MacOS to avoid linkage issues
# https://github.com/llvm/torch-mlir/issues/1253
export TORCH_MLIR_ENABLE_LTC=0

function run() {
echo "Using python versions: ${python_versions}"

Expand Down
9 changes: 1 addition & 8 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@
# prevent this script from attempting to build the directory, and will simply
# use the (presumed already built) directory as-is.
#
# By default the lazy tensor backend is disabled and not built to avoid conflicts
# with the out-of-tree build. To enable it, set the TORCH_MLIR_ENABLE_LTC
# environment variable to 1.
#
# The package version can be set with the TORCH_MLIR_PYTHON_PACKAGE_VERSION
# environment variable. For example, this can be "20220330.357" for a snapshot
# release on 2022-03-30 with build number 357.
Expand Down Expand Up @@ -85,11 +81,8 @@ def run(self):
f"-DCMAKE_VISIBILITY_INLINES_HIDDEN=ON",
f"-DCMAKE_C_VISIBILITY_PRESET=hidden",
f"-DCMAKE_CXX_VISIBILITY_PRESET=hidden",
f"-DTORCH_MLIR_ENABLE_LTC={'ON' if int(os.environ.get('TORCH_MLIR_ENABLE_LTC', 1)) else 'OFF'}",
]
# TODO: Enable LTC by default once JIT importer linkage issue is fixed (https://github.com/llvm/torch-mlir/issues/1154)
enable_ltc = bool(int(os.environ.get("TORCH_MLIR_ENABLE_LTC", 0)))
if not enable_ltc:
cmake_args.append("-DTORCH_MLIR_ENABLE_LTC=OFF")

os.makedirs(cmake_build_dir, exist_ok=True)
cmake_cache_file = os.path.join(cmake_build_dir, "CMakeCache.txt")
Expand Down

0 comments on commit 5fa7151

Please sign in to comment.