Skip to content

Deprecate last_dim_is_batch (bump PyTorch version to >= 2.0) #2549

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

Merged
merged 6 commits into from
Jul 11, 2024

Conversation

gpleiss
Copy link
Member

@gpleiss gpleiss commented Jul 10, 2024

See conversation here: #2544 (comment)

#2544 will remove last_dim_is_batch for GPyTorch 2.0. This PR...

  • Adds temporary deprecation warnings for our next (and final?) minor release.
  • Adds a new example notebook demonstrating how to do additive/product structure in the GPyTorch 2.0 ways (once we remove AdditiveStructureKernel, ProductStructureKernel, and NewtonGirardAdditiveKernel; the 3 kernels that relied on last_dim_is_batch.
  • Adds gpytorch.utils.sum_interaction_terms, which replaces the core functionality of NewtonGirardAdditiveKernel.

The last change uses vmaps, so we can use this PR as an excuse to bump the PyTorch requirement to >= 2.0.

gpleiss added 4 commits July 9, 2024 23:30
NewtonGirardAdditiveKernel

This kernel will be deprecated and removed as part of GPyTorch 2.0.
Include instructions for alternative implementation for the following deprecated kernels:
- AdditiveStructureKernel
- ProductStructureKernel
- NewtonGirardAdditiveKernel
- 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.
@gpleiss
Copy link
Member Author

gpleiss commented Jul 10, 2024

This PR should be ready to merge (into main, not develop).

@gpleiss gpleiss requested a review from jacobrgardner July 10, 2024 00:18
Copy link
Collaborator

@JonathanWenger JonathanWenger left a comment

Choose a reason for hiding this comment

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

Largely looks good to me! Just a few minor points.

@gpleiss gpleiss enabled auto-merge (squash) July 11, 2024 17:36
Copy link
Collaborator

@JonathanWenger JonathanWenger left a comment

Choose a reason for hiding this comment

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

🙏

@gpleiss gpleiss merged commit d98ceab into main Jul 11, 2024
7 checks passed
@gpleiss gpleiss deleted the deprecate_last_dim_is_batch branch July 11, 2024 17:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants