diff --git a/build_tools/build_libtorch.sh b/build_tools/build_libtorch.sh index 349088abf..3cc602add 100755 --- a/build_tools/build_libtorch.sh +++ b/build_tools/build_libtorch.sh @@ -5,8 +5,8 @@ set -xeu -o pipefail SRC_ROOT="$( cd "$(dirname "$0")" ; pwd -P)/.." PYTORCH_ROOT=${PYTORCH_ROOT:-$SRC_ROOT/externals/pytorch} PYTORCH_INSTALL_PATH=${PYTORCH_INSTALL_PATH:-$SRC_ROOT/libtorch} -PYTORCH_REPO="${PYTORCH_REPO:-pytorch/pytorch}" -PYTORCH_BRANCH="${PYTORCH_BRANCH:-master}" +TORCH_MLIR_SRC_PYTORCH_REPO="${TORCH_MLIR_SRC_PYTORCH_REPO:-pytorch/pytorch}" +TORCH_MLIR_SRC_PYTORCH_BRANCH="${TORCH_MLIR_SRC_PYTORCH_BRANCH:-master}" PT_C_COMPILER="${PT_C_COMPILER:-clang}" PT_CXX_COMPILER="${PT_CXX_COMPILER:-clang++}" CMAKE_OSX_ARCHITECTURES="${CMAKE_OSX_ARCHITECTURES:-x86_64}" @@ -24,8 +24,8 @@ NC='\033[0m' echo "SRC_ROOT=${SRC_ROOT}" echo "PYTORCH_ROOT=${PYTORCH_ROOT}" -echo "PYTORCH_REPO=${PYTORCH_REPO}" -echo "PYTORCH_BRANCH=${PYTORCH_BRANCH}" +echo "TORCH_MLIR_SRC_PYTORCH_REPO=${TORCH_MLIR_SRC_PYTORCH_REPO}" +echo "TORCH_MLIR_SRC_PYTORCH_BRANCH=${TORCH_MLIR_SRC_PYTORCH_BRANCH}" echo "MACOSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET}" echo "CMAKE_OSX_ARCHITECTURES=${CMAKE_OSX_ARCHITECTURES}" @@ -45,7 +45,7 @@ install_requirements() { checkout_pytorch() { if [[ ! -d "$PYTORCH_ROOT" ]]; then - git clone --depth 1 --single-branch --branch "${PYTORCH_BRANCH}" https://github.com/"$PYTORCH_REPO" "$PYTORCH_ROOT" + git clone --depth 1 --single-branch --branch "${TORCH_MLIR_SRC_PYTORCH_BRANCH}" https://github.com/"$TORCH_MLIR_SRC_PYTORCH_REPO" "$PYTORCH_ROOT" fi cd "$PYTORCH_ROOT" git reset --hard HEAD diff --git a/development.md b/development.md index e86ea1952..53a3e085d 100644 --- a/development.md +++ b/development.md @@ -227,8 +227,8 @@ Most of the unit tests use the [`FileCheck` tool](https://llvm.org/docs/CommandG Torch-MLIR by default builds with the latest nightly PyTorch version. This can be toggled to build from latest PyTorch source with ``` -DTORCH_MLIR_USE_INSTALLED_PYTORCH=OFF --DPYTORCH_REPO=vivekkhandelwal1/pytorch # Optional Github path. Defaults to pytorch/pytorch --DPYTORCH_BRANCH=master #Optional. Defaults to PyTorch's main branch +-DTORCH_MLIR_SRC_PYTORCH_REPO=vivekkhandelwal1/pytorch # Optional. Github path. Defaults to pytorch/pytorch +-DTORCH_MLIR_SRC_PYTORCH_BRANCH=master # Optional. Defaults to PyTorch's main branch ``` # Updating the LLVM submodule diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt index 4dbe0ad01..701b82f49 100644 --- a/python/CMakeLists.txt +++ b/python/CMakeLists.txt @@ -21,8 +21,8 @@ option(TORCH_MLIR_USE_INSTALLED_PYTORCH "Build from local PyTorch in environment if (NOT TORCH_MLIR_USE_INSTALLED_PYTORCH) # Source builds - set(ENV{PYTORCH_REPO} ${PYTORCH_REPO}) - set(ENV{PYTORCH_BRANCH} ${PYTORCH_BRANCH}) + set(ENV{TORCH_MLIR_SRC_PYTORCH_REPO} ${TORCH_MLIR_SRC_PYTORCH_REPO}) + set(ENV{TORCH_MLIR_SRC_PYTORCH_BRANCH} ${TORCH_MLIR_SRC_PYTORCH_BRANCH}) set(ENV{MACOSX_DEPLOYMENT_TARGET} ${MACOSX_DEPLOYMENT_TARGET}) set(ENV{CMAKE_OSX_ARCHITECTURES} ${CMAKE_OSX_ARCHITECTURES}) set(ENV{CMAKE_C_COMPILER_LAUNCHER} ${CMAKE_C_COMPILER_LAUNCHER})