Skip to content

Commit

Permalink
Require PyTorch>=2.0.1, GPyTorch==1.13 and linear_operator==0.5.3 (#2511
Browse files Browse the repository at this point in the history
)

Summary:
As titled.

Also includes some updates to test against stable workflow to make it pass.

Pull Request resolved: #2511

Test Plan: https://github.com/pytorch/botorch/actions/runs/10751171192

Reviewed By: esantorella

Differential Revision: D62320479

Pulled By: saitcakmak

fbshipit-source-id: 8442389ed79fc50e8612015548283405deda63b8
  • Loading branch information
saitcakmak authored and facebook-github-bot committed Sep 7, 2024
1 parent 1417189 commit 16853b4
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 18 deletions.
6 changes: 3 additions & 3 deletions .conda/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ requirements:
- setuptools
- setuptools_scm
run:
- pytorch >=1.13.1
- gpytorch ==1.12
- linear_operator ==0.5.2
- pytorch >=2.0.1
- gpytorch ==1.13
- linear_operator ==0.5.3
- scipy
- multipledispatch
- pyro-ppl >=1.8.4
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/reusable_tutorials.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ jobs:
min_torch_version=$(grep '\btorch[>=]=' ${req_txt} | sed 's/[^0-9.]//g')
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 "numpy<2" # Numpy >2.0 is not compatible with PyTorch <2.2.
pip install "torch==${min_torch_version}" "gpytorch==${min_gpytorch_version}" "linear_operator==${min_linear_operator_version}" torchvision
- name: Install BoTorch with tutorials dependencies
env:
Expand Down
21 changes: 15 additions & 6 deletions .github/workflows/test_stable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,14 @@ jobs:
conda install -y -c gpytorch gpytorch
conda install -y -c conda-forge pyro-ppl>=1.8.4
pip install .[test]
- name: Unit tests
- name: Unit tests and coverage -- BoTorch
shell: bash -l {0}
run: |
pytest -ra
pytest -ra test/ --cov botorch/ --cov-report term-missing --cov-report xml:botorch_cov.xml
- name: Unit tests and coverage -- BoTorch Community
shell: bash -l {0}
run: |
pytest -ra test_community/ --cov botorch_community/ --cov-report term-missing --cov-report xml:botorch_community_cov.xml
tests-and-coverage-min-req-pip:
name: Tests and coverage min req. torch, gpytorch & linear_operator versions (pip, Python ${{ matrix.python-version }}, ${{ matrix.os }})
Expand All @@ -59,18 +63,23 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
pip install setuptools # Needed for next line on Python 3.12.
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 ${{ matrix.python-version == '3.11' }} && ${{ matrix.os == 'macos-14' }}; then echo "2.0.1"; else echo "${min_torch_version}"; fi)"
# The earliest PyTorch version on Python 3.12 is 2.2.0.
min_torch_version="$(if ${{ matrix.python-version == '3.12' }}; then echo "2.2.0"; 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 "numpy<2" # Numpy >2.0 is not compatible with PyTorch <2.2.
pip install "torch==${min_torch_version}" "gpytorch==${min_gpytorch_version}" "linear_operator==${min_linear_operator_version}"
pip install .[test]
- name: Unit tests and coverage
- name: Unit tests and coverage -- BoTorch
run: |
pytest -ra test/ --cov botorch/ --cov-report term-missing --cov-report xml:botorch_cov.xml
- name: Unit tests and coverage -- BoTorch Community
run: |
pytest -ra --cov=. --cov-report term-missing
pytest -ra test_community/ --cov botorch_community/ --cov-report term-missing --cov-report xml:botorch_community_cov.xml
run_tutorials_stable_w_latest_ax:
name: Run tutorials without smoke test on min req. versions of PyTorch & GPyTorch and latest Ax
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ Optimization simply use Ax.

**Installation Requirements**
- Python >= 3.10
- PyTorch >= 1.13.1
- gpytorch == 1.12
- linear_operator == 0.5.2
- PyTorch >= 2.0.1
- gpytorch == 1.13
- linear_operator == 0.5.3
- pyro-ppl >= 1.8.4
- scipy
- multiple-dispatch
Expand Down
6 changes: 3 additions & 3 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ channels:
- gpytorch
- conda-forge
dependencies:
- pytorch>=1.13.1
- gpytorch==1.12
- linear_operator==0.5.2
- pytorch>=2.0.1
- gpytorch==1.13
- linear_operator==0.5.3
- scipy
- multipledispatch
- pyro-ppl>=1.8.4
6 changes: 3 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
multipledispatch
scipy
mpmath>=0.19,<=1.3
torch>=1.13.1
torch>=2.0.1
pyro-ppl>=1.8.4
gpytorch==1.12
linear_operator==0.5.2
gpytorch==1.13
linear_operator==0.5.3

0 comments on commit 16853b4

Please sign in to comment.