-
Notifications
You must be signed in to change notification settings - Fork 400
98 lines (91 loc) · 3.86 KB
/
test_stable.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
name: Test against stable
on:
workflow_dispatch:
jobs:
tests-and-coverage-pip-stable:
name: Test & Coverage
uses: ./.github/workflows/reusable_test_pip.yml
with:
use_latest_pytorch_gpytorch: false
upload_coverage: false
secrets: inherit
tests-conda-stable:
name: Tests (conda, ${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest", "macos-14", "windows-latest"]
python-version: ["3.10", "3.12"]
steps:
- uses: actions/checkout@v4
- uses: conda-incubator/setup-miniconda@v3
with:
miniconda-version: "latest"
activate-environment: test
python-version: ${{ matrix.python-version }}
- name: Install dependencies
shell: bash -l {0}
run: |
# avoid conda bug in >=23.10.0: https://github.com/conda/conda/issues/13412
conda config --set solver classic
conda install -y -c pytorch pytorch cpuonly
conda install -y pip scipy pytest
conda install -y -c gpytorch gpytorch
conda install -y -c conda-forge pyro-ppl>=1.8.4
pip install .[test]
- name: Unit tests and coverage -- BoTorch
shell: bash -l {0}
run: |
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 }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest", "macos-14"]
python-version: ["3.10", "3.12"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
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')
# 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 -- 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 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
uses: ./.github/workflows/reusable_tutorials.yml
with:
smoke_test: false
use_stable_pytorch_gpytorch: true
use_stable_ax: false
run_tutorials_stable_smoke_test:
name: Run tutorials with smoke test on min req. versions of PyTorch & GPyTorch and latest Ax
uses: ./.github/workflows/reusable_tutorials.yml
with:
smoke_test: true
use_stable_pytorch_gpytorch: true
use_stable_ax: false