Use BetaPrior in MultiTask Botorch Preset#834
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates BayBE’s BOTORCH Gaussian process preset to track BoTorch’s updated MultiTaskGP defaults by adding a BetaPrior(2.5, 1.5) for the task covariance kernel in the multi-task case, and adjusts the corresponding regression test and changelog entry.
Changes:
- Implement a dedicated
BotorchKernelFactorythat mirrors BoTorch’s single-task vs multi-task kernel construction, including the new task covariance prior. - Update
tests/test_gp.pyto validate only theBOTORCHpreset against BoTorch behavior (and clarify theHVARFNERdivergence note). - Add an Unreleased changelog entry documenting the fix.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
baybe/surrogates/gaussian_process/presets/botorch.py |
Introduces a BoTorch-tracking kernel factory and applies the multi-task BetaPrior behavior. |
tests/test_gp.py |
Simplifies the preset test to assert BOTORCH matches BoTorch for single- and multi-task cases. |
CHANGELOG.md |
Documents the preset behavior fix under Unreleased. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
AVHopp
commented
Jun 22, 2026
365b064 to
642af85
Compare
AdrianSosic
approved these changes
Jun 26, 2026
AdrianSosic
left a comment
Collaborator
There was a problem hiding this comment.
Hey @AVHopp, thanks for the initiative. I've pushed some more commits on top, fixing a few things for consistency and attrs-logic. Feel free to ask if you have concerns.
BoTorch's `MultiTaskGP` added `BetaPrior(2.5, 1.5)` as the default task covariance prior starting from version 0.18.0. For older versions, the prior is not available and we fall back to no prior (matching that version's `MultiTaskGP` behavior).
In order to use the `Botorch` preset, it is necessary to have `botorch` version 0.18.0 or higher installed. The reason is that this version introduced the use of a `BetaPrior` for `MultiTaskGP`. Attempting to use the preset with an older version of `botorch` raises an error.
This reverts commit 8820451. The reason for this revert is that moving the validation to the pre-init stage caused issues already on importing the file due to our preset wiring. As this was already happening on even a simple import of the `Campaign`, it was decided to revert this change as other alternative like increasing the minimum botorch version of having a module-level `__getattr__` are not desirable
This is necessary as the tests for the botorch presets fail for lower versions of botorch, and we do not want to increase the version on a package level.
Those tests require `botorch>=0.18.0` to pass. This version of `botorch` is not available for python 3.10, so we mark the tests as `xfail`
f76b448 to
d230640
Compare
AdrianSosic
reviewed
Jun 26, 2026
2f51dbf to
2d360fe
Compare
2d360fe to
315822d
Compare
315822d to
5c620a0
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR changes the
BOTORCHpreset to use theBetaPrior(2.5, 1.5)in the multi task case.This change was introduced in Botorch v.0.18.0 (see https://github.com/meta-pytorch/botorch/releases/tag/v0.18.0). Consequently, our
BOTORCHpreset no longer reflected the actual botorch defaults and failed.This PR thus updates the
BotorchKernelFactoryto not simply useHVARFNERbut to use the new prior in the multi task case instead.