Skip to content

Commit 16853b4

Browse files
saitcakmakfacebook-github-bot
authored andcommitted
Require PyTorch>=2.0.1, GPyTorch==1.13 and linear_operator==0.5.3 (#2511)
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
1 parent 1417189 commit 16853b4

File tree

6 files changed

+28
-18
lines changed

6 files changed

+28
-18
lines changed

.conda/meta.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ requirements:
1717
- setuptools
1818
- setuptools_scm
1919
run:
20-
- pytorch >=1.13.1
21-
- gpytorch ==1.12
22-
- linear_operator ==0.5.2
20+
- pytorch >=2.0.1
21+
- gpytorch ==1.13
22+
- linear_operator ==0.5.3
2323
- scipy
2424
- multipledispatch
2525
- pyro-ppl >=1.8.4

.github/workflows/reusable_tutorials.yml

+1
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ jobs:
5454
min_torch_version=$(grep '\btorch[>=]=' ${req_txt} | sed 's/[^0-9.]//g')
5555
min_gpytorch_version=$(grep '\bgpytorch[>=]=' ${req_txt} | sed 's/[^0-9.]//g')
5656
min_linear_operator_version=$(grep '\blinear_operator[>=]=' ${req_txt} | sed 's/[^0-9.]//g')
57+
pip install "numpy<2" # Numpy >2.0 is not compatible with PyTorch <2.2.
5758
pip install "torch==${min_torch_version}" "gpytorch==${min_gpytorch_version}" "linear_operator==${min_linear_operator_version}" torchvision
5859
- name: Install BoTorch with tutorials dependencies
5960
env:

.github/workflows/test_stable.yml

+15-6
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,14 @@ jobs:
3838
conda install -y -c gpytorch gpytorch
3939
conda install -y -c conda-forge pyro-ppl>=1.8.4
4040
pip install .[test]
41-
- name: Unit tests
41+
- name: Unit tests and coverage -- BoTorch
4242
shell: bash -l {0}
4343
run: |
44-
pytest -ra
44+
pytest -ra test/ --cov botorch/ --cov-report term-missing --cov-report xml:botorch_cov.xml
45+
- name: Unit tests and coverage -- BoTorch Community
46+
shell: bash -l {0}
47+
run: |
48+
pytest -ra test_community/ --cov botorch_community/ --cov-report term-missing --cov-report xml:botorch_community_cov.xml
4549
4650
tests-and-coverage-min-req-pip:
4751
name: Tests and coverage min req. torch, gpytorch & linear_operator versions (pip, Python ${{ matrix.python-version }}, ${{ matrix.os }})
@@ -59,18 +63,23 @@ jobs:
5963
python-version: ${{ matrix.python-version }}
6064
- name: Install dependencies
6165
run: |
66+
pip install setuptools # Needed for next line on Python 3.12.
6267
python setup.py egg_info
6368
req_txt="botorch.egg-info/requires.txt"
6469
min_torch_version=$(grep '\btorch[>=]=' ${req_txt} | sed 's/[^0-9.]//g')
65-
# 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
66-
min_torch_version="$(if ${{ matrix.python-version == '3.11' }} && ${{ matrix.os == 'macos-14' }}; then echo "2.0.1"; else echo "${min_torch_version}"; fi)"
70+
# The earliest PyTorch version on Python 3.12 is 2.2.0.
71+
min_torch_version="$(if ${{ matrix.python-version == '3.12' }}; then echo "2.2.0"; else echo "${min_torch_version}"; fi)"
6772
min_gpytorch_version=$(grep '\bgpytorch[>=]=' ${req_txt} | sed 's/[^0-9.]//g')
6873
min_linear_operator_version=$(grep '\blinear_operator[>=]=' ${req_txt} | sed 's/[^0-9.]//g')
74+
pip install "numpy<2" # Numpy >2.0 is not compatible with PyTorch <2.2.
6975
pip install "torch==${min_torch_version}" "gpytorch==${min_gpytorch_version}" "linear_operator==${min_linear_operator_version}"
7076
pip install .[test]
71-
- name: Unit tests and coverage
77+
- name: Unit tests and coverage -- BoTorch
78+
run: |
79+
pytest -ra test/ --cov botorch/ --cov-report term-missing --cov-report xml:botorch_cov.xml
80+
- name: Unit tests and coverage -- BoTorch Community
7281
run: |
73-
pytest -ra --cov=. --cov-report term-missing
82+
pytest -ra test_community/ --cov botorch_community/ --cov-report term-missing --cov-report xml:botorch_community_cov.xml
7483
7584
run_tutorials_stable_w_latest_ax:
7685
name: Run tutorials without smoke test on min req. versions of PyTorch & GPyTorch and latest Ax

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,9 @@ Optimization simply use Ax.
5656

5757
**Installation Requirements**
5858
- Python >= 3.10
59-
- PyTorch >= 1.13.1
60-
- gpytorch == 1.12
61-
- linear_operator == 0.5.2
59+
- PyTorch >= 2.0.1
60+
- gpytorch == 1.13
61+
- linear_operator == 0.5.3
6262
- pyro-ppl >= 1.8.4
6363
- scipy
6464
- multiple-dispatch

environment.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ channels:
44
- gpytorch
55
- conda-forge
66
dependencies:
7-
- pytorch>=1.13.1
8-
- gpytorch==1.12
9-
- linear_operator==0.5.2
7+
- pytorch>=2.0.1
8+
- gpytorch==1.13
9+
- linear_operator==0.5.3
1010
- scipy
1111
- multipledispatch
1212
- pyro-ppl>=1.8.4

requirements.txt

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
multipledispatch
22
scipy
33
mpmath>=0.19,<=1.3
4-
torch>=1.13.1
4+
torch>=2.0.1
55
pyro-ppl>=1.8.4
6-
gpytorch==1.12
7-
linear_operator==0.5.2
6+
gpytorch==1.13
7+
linear_operator==0.5.3

0 commit comments

Comments
 (0)