From 85cec4cdea8257cba3f31fcda9139a8ccd627d6f Mon Sep 17 00:00:00 2001 From: Max Balandat Date: Tue, 1 Aug 2023 17:49:55 -0700 Subject: [PATCH] Hack around missing pytorch 1.13.1 binaries for py3.11 on mac (#1966) Summary: This fix is needed to avoid errors in the CI Pull Request resolved: https://github.com/pytorch/botorch/pull/1966 Reviewed By: saitcakmak Differential Revision: D47978234 Pulled By: Balandat fbshipit-source-id: c5024a36ce8a0952debdea4aa1cbc3ffb925031d --- .github/workflows/test_stable.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/test_stable.yml b/.github/workflows/test_stable.yml index a5238fa1d4..f457ef8f92 100644 --- a/.github/workflows/test_stable.yml +++ b/.github/workflows/test_stable.yml @@ -70,10 +70,15 @@ jobs: with: python-version: ${{ matrix.python-version }} - name: Install dependencies + env: + PYTHON_VERSION: ${{ matrix.python-version }} + OS: ${{ matrix.os }} run: | python setup.py egg_info req_txt="botorch.egg-info/requires.txt" min_torch_version=$(grep '\btorch[>=]=' ${req_txt} | sed 's/[^0-9.]//g') + # HACK around the fact that pytorch does not offer a mac binary for 1.13.1 for py3.11 - TODO: Remove when bumping torch to 2.0.1 + min_torch_version=$(if [[ "${min_torch_version}"=="1.13.1" ]] && [[ "${PYTHON_VERSION}"=="3.11" ]] && [[ "${OS}"=="macos-latest" ]]; then echo "2.0.1"; else echo "${min_torch_version}"; fi) min_gpytorch_version=$(grep '\bgpytorch[>=]=' ${req_txt} | sed 's/[^0-9.]//g') min_linear_operator_version=$(grep '\blinear_operator[>=]=' ${req_txt} | sed 's/[^0-9.]//g') pip install "torch==${min_torch_version}" "gpytorch==${min_gpytorch_version}" "linear_operator==${min_linear_operator_version}"