Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Require PyTorch>=2.0.1, GPyTorch==1.13 and linear_operator==0.5.3 #2511

Closed
wants to merge 23 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for catching this! Do you know if there's a reason it's specifying 2.0.1 rather than 2.0? I guess it's fine if this flow passes.

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
Loading