Skip to content

Commit

Permalink
Pin the CI to the latest working PyTorch.
Browse files Browse the repository at this point in the history
I am investigating the breakage.

Also, fix "externals" rename in setup.py and some cases where we weren't
using `requirements.txt` consistently.

Also, fix a case where the packaging script would get confused due to
".." in the path name.
  • Loading branch information
silvasean committed Mar 29, 2022
1 parent f2269ce commit 3a96078
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/buildAndTest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
python -m pip install -r $GITHUB_WORKSPACE/externals/llvm-project/mlir/python/requirements.txt
- name: Install PyTorch nightly depends
run: |
python -m pip install --pre torch torchvision -f https://download.pytorch.org/whl/nightly/cpu/torch_nightly.html
python -m pip install -r requirements.txt
- name: Install Ninja
uses: llvm/actions/install-ninja@55d844821959226fab4911f96f37071c1d4c3268
- name: Get Submodule Hash
Expand Down
2 changes: 1 addition & 1 deletion build_tools/build_python_wheels.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ python -m venv "$package_test_venv"
VENV_PYTHON="$package_test_venv/bin/python"

echo "---- INSTALLING torch ----"
$VENV_PYTHON -m pip install --pre torch torchvision pybind11 -f "https://download.pytorch.org/whl/nightly/cpu/torch_nightly.html"
$VENV_PYTHON -m pip install -r "${repo_root}/requirements.txt"
echo "---- INSTALLING other deps for smoke test ----"
$VENV_PYTHON -m pip install requests pillow
echo "---- INSTALLING torch-mlir ----"
Expand Down
5 changes: 3 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
--pre

numpy
torch
torchvision
# TODO: Fix for latest PyTorch.
torch==1.12.0.dev20220328+cpu
torchvision==0.13.0.dev20220328+cpu

# Build requirements.
pybind11
Expand Down
7 changes: 4 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,12 @@ def run(self):
target_dir = self.build_lib
cmake_build_dir = os.getenv("TORCH_MLIR_CMAKE_BUILD_DIR")
if not cmake_build_dir:
cmake_build_dir = os.path.join(target_dir, "..", "cmake_build")
cmake_build_dir = os.path.abspath(
os.path.join(target_dir, "..", "cmake_build"))
if not os.getenv("TORCH_MLIR_CMAKE_BUILD_DIR_ALREADY_BUILT"):
src_dir = os.path.abspath(os.path.dirname(__file__))
llvm_dir = os.path.join(
src_dir, "external", "llvm-project", "llvm")
src_dir, "externals", "llvm-project", "llvm")
cmake_args = [
f"-DCMAKE_BUILD_TYPE=Release",
f"-DPython3_EXECUTABLE={sys.executable}",
Expand All @@ -64,7 +65,7 @@ def run(self):
f"-DLLVM_ENABLE_PROJECTS=mlir",
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}/external/llvm-external-projects/torch-mlir-dialects",
f"-DLLVM_EXTERNAL_TORCH_MLIR_DIALECTS_SOURCE_DIR={src_dir}/externals/llvm-external-projects/torch-mlir-dialects",
# Optimization options for building wheels.
f"-DCMAKE_VISIBILITY_INLINES_HIDDEN=ON",
f"-DCMAKE_C_VISIBILITY_PRESET=hidden",
Expand Down

0 comments on commit 3a96078

Please sign in to comment.