From 95ffa27733e10f0eb4c6302c6460539fb6e2ced1 Mon Sep 17 00:00:00 2001 From: Ashay Rane Date: Thu, 29 Sep 2022 14:09:31 -0500 Subject: [PATCH] release: pin PyTorch version in release requirements (#1435) Prior to this patch, the release process (`pip wheel`) retrieved dependencies from the pyproject.toml file, which specified a version of PyTorch that defaulted to the most recent nightly release. Instead, we want the release process to use the same pinned PyTorch version as the development build of PyTorch. Since TOML files can't reference the pytorch-requirements.txt file, this patch puts the dependencies from pyproject.toml into whl-requirements.txt, which references pytorch-requirements.txt. --- .../python_deploy/build_linux_packages.sh | 8 ++++--- pyproject.toml | 21 ------------------- whl-requirements.txt | 10 +++++++++ 3 files changed, 15 insertions(+), 24 deletions(-) delete mode 100644 pyproject.toml create mode 100644 whl-requirements.txt diff --git a/build_tools/python_deploy/build_linux_packages.sh b/build_tools/python_deploy/build_linux_packages.sh index 419553d9f..5b19063d8 100755 --- a/build_tools/python_deploy/build_linux_packages.sh +++ b/build_tools/python_deploy/build_linux_packages.sh @@ -321,11 +321,13 @@ function clean_build() { } function build_torch_mlir() { - python -m pip install --upgrade -r /main_checkout/torch-mlir/requirements.txt --extra-index-url https://download.pytorch.org/whl/nightly/cpu + python -m pip install --upgrade -r /main_checkout/torch-mlir/requirements.txt \ + --extra-index-url https://download.pytorch.org/whl/nightly/cpu/torch_nightly.html CMAKE_GENERATOR=Ninja \ TORCH_MLIR_PYTHON_PACKAGE_VERSION=${TORCH_MLIR_PYTHON_PACKAGE_VERSION} \ - python -m pip wheel -v -w /wheelhouse /main_checkout/torch-mlir/ \ - --extra-index-url https://download.pytorch.org/whl/nightly/cpu + python -m pip wheel -v -w /wheelhouse /main_checkout/torch-mlir \ + -f https://download.pytorch.org/whl/nightly/cpu/torch_nightly.html \ + -r /main_checkout/torch-mlir/whl-requirements.txt } function run_audit_wheel() { diff --git a/pyproject.toml b/pyproject.toml deleted file mode 100644 index 34a6e2710..000000000 --- a/pyproject.toml +++ /dev/null @@ -1,21 +0,0 @@ -[build-system] -requires = [ - "setuptools>=42", - "wheel", - # There is no fundamental reason to pin this CMake version, beyond - # build stability. - "cmake==3.22.2", - "ninja==1.10.2", - "packaging", - # Version 2.7.0 excluded: https://github.com/pybind/pybind11/issues/3136 - "pybind11>=2.6.0,!=2.7.0", - "PyYAML", - - # The torch-mlir CMake build requires numpy and torch to be installed. - # Further, the setup.py will pin the version selected here into built - # artifacts. - # TODO: Come up with a better way to pin the version. - "numpy", - "torch>=1.12.0.dev20220420", -] -build-backend = "setuptools.build_meta" diff --git a/whl-requirements.txt b/whl-requirements.txt new file mode 100644 index 000000000..6ed0881f2 --- /dev/null +++ b/whl-requirements.txt @@ -0,0 +1,10 @@ +-f pytorch-requirements.txt + +setuptools>=42 +wheel +cmake==3.22.2 +ninja==1.10.2 +packaging +pybind11>=2.6.0,!=2.7.0 +PyYAML +numpy