Skip to content

Commit d98ceab

Browse files
Deprecate last_dim_is_batch (bump PyTorch version to >= 2.0) (#2549)
* Update PyTorch requirement to >=2.0 * Add sum_interaction_terms utility to replace functionality of NewtonGirardAdditiveKernel This kernel will be deprecated and removed as part of GPyTorch 2.0. * Add tutorial on additive and product kernels. Include instructions for alternative implementation for the following deprecated kernels: - AdditiveStructureKernel - ProductStructureKernel - NewtonGirardAdditiveKernel * Add deprecation warnings for removal of last_dim_is_batch: - Kernels called with last_dim_is_batch raise a DeprecationWarning - AdditiveStructureKernel, ProductStructureKernel, and NewtonGirardAdditiveKernel raise DeprecationWarnings when instantiated. - Update example notebooks to remove usage of these deprecated kernels. * Apply suggestions from code review Co-authored-by: Jonathan Wenger <[email protected]> * Fix linting error --------- Co-authored-by: Jonathan Wenger <[email protected]>
1 parent 26997ef commit d98ceab

17 files changed

+829
-155
lines changed

.conda/meta.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ requirements:
1717

1818
run:
1919
- python>=3.8
20-
- pytorch>=1.11
20+
- pytorch>=2.0
2121
- scikit-learn
2222
- jaxtyping>=0.2.9
2323
- linear_operator>=0.5.2

.github/workflows/run_test_suite.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ jobs:
5050
if [[ ${{ matrix.pytorch-version }} = "master" ]]; then
5151
pip install --pre torch -f https://download.pytorch.org/whl/nightly/cpu/torch_nightly.html;
5252
else
53-
pip install torch==1.11+cpu -f https://download.pytorch.org/whl/torch_stable.html;
53+
pip install torch==2.0.1 --index-url https://download.pytorch.org/whl/cpu
5454
fi
5555
pip install -e .
5656
if [[ ${{ matrix.extras }} == "with-extras" ]]; then

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ See our [**documentation, examples, tutorials**](https://gpytorch.readthedocs.io
3030

3131
**Requirements**:
3232
- Python >= 3.8
33-
- PyTorch >= 1.11
33+
- PyTorch >= 2.0
3434

3535
Install GPyTorch using pip or conda:
3636

docs/source/utils.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@ Interpolation Utilities
2020
.. automodule:: gpytorch.utils.interpolation
2121
:members:
2222

23+
Nearest Neighbors Utilities
24+
---------------------------------
25+
26+
.. automodule:: gpytorch.utils.nearest_neighbors
27+
:members:
28+
2329
Quadrature Utilities
2430
----------------------------
2531

@@ -31,9 +37,3 @@ Transform Utilities
3137

3238
.. automodule:: gpytorch.utils.transforms
3339
:members:
34-
35-
Nearest Neighbors Utilities
36-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
37-
38-
.. automodule:: gpytorch.utils.nearest_neighbors
39-
:members:

examples/00_Basic_Usage/index.rst

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,22 @@ parameter constraints and priors, and saving and loading models.
66

77
Before checking these out, you may want to check out our `simple GP regression tutorial`_ that details the anatomy of a GPyTorch model.
88

9-
- Check out our `Tutorial on Hyperparameters`_ for information on things like raw versus actual
9+
* Check out our `Tutorial on Hyperparameters`_ for information on things like raw versus actual
1010
parameters, constraints, priors and more.
11-
- The `Saving and Loading Models`_ notebook details how to save and load GPyTorch models
11+
* The `Saving and Loading Models`_ notebook details how to save and load GPyTorch models
1212
on disk.
13+
* The `Kernels with Additive or Product Structure`_ notebook describes how to compose kernels additively or multiplicatively,
14+
whether for expressivity, sample efficiency, or scalability.
15+
* The `Implementing a Custom Kernel`_ notebook details how to write your own custom kernel in GPyTorch.
16+
* The `Tutorial on Metrics`_ describes various metrics provided by GPyTorch for assessing the generalization of GP models.
1317

1418
.. toctree::
1519
:maxdepth: 1
1620
:hidden:
1721

1822
Hyperparameters.ipynb
1923
Saving_and_Loading_Models.ipynb
24+
kernels_with_additive_or_product_structure.ipynb
2025
Implementing_a_custom_Kernel.ipynb
2126
Metrics.ipynb
2227

@@ -29,6 +34,9 @@ Before checking these out, you may want to check out our `simple GP regression t
2934
.. _Saving and Loading Models:
3035
Saving_and_Loading_Models.ipynb
3136

37+
.. _Kernels with Additive or Product Structure:
38+
kernels_with_additive_or_product_structure.ipynb
39+
3240
.. _Implementing a custom Kernel:
3341
Implementing_a_custom_Kernel.ipynb
3442

0 commit comments

Comments
 (0)