Skip to content

Use BetaPrior in MultiTask Botorch Preset#834

Merged
AVHopp merged 14 commits into
mainfrom
fix/botorch_preset_issues
Jun 26, 2026
Merged

Use BetaPrior in MultiTask Botorch Preset#834
AVHopp merged 14 commits into
mainfrom
fix/botorch_preset_issues

Conversation

@AVHopp

@AVHopp AVHopp commented Jun 22, 2026

Copy link
Copy Markdown
Collaborator

This PR changes the BOTORCH preset to use the BetaPrior(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 BOTORCH preset no longer reflected the actual botorch defaults and failed.

This PR thus updates the BotorchKernelFactory to not simply use HVARFNER but to use the new prior in the multi task case instead.

@AVHopp AVHopp requested a review from Scienfitz as a code owner June 22, 2026 12:07
Copilot AI review requested due to automatic review settings June 22, 2026 12:07
@AVHopp AVHopp requested a review from AdrianSosic as a code owner June 22, 2026 12:07
@AVHopp AVHopp self-assigned this Jun 22, 2026
@AVHopp AVHopp marked this pull request as draft June 22, 2026 12:11

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 BotorchKernelFactory that mirrors BoTorch’s single-task vs multi-task kernel construction, including the new task covariance prior.
  • Update tests/test_gp.py to validate only the BOTORCH preset against BoTorch behavior (and clarify the HVARFNER divergence 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.

Comment thread baybe/surrogates/gaussian_process/presets/botorch.py Outdated
Comment thread tests/test_gp.py Outdated
Comment thread baybe/surrogates/gaussian_process/presets/botorch.py
@AVHopp AVHopp marked this pull request as ready for review June 22, 2026 12:22
@AVHopp AVHopp requested a review from kalama-ai June 22, 2026 12:23
@AVHopp AVHopp added the dependencies Pull requests that update a dependency file label Jun 22, 2026
@AVHopp AVHopp force-pushed the fix/botorch_preset_issues branch 2 times, most recently from 365b064 to 642af85 Compare June 25, 2026 07:07

@AdrianSosic AdrianSosic left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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.

AVHopp and others added 13 commits June 26, 2026 11:34
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`
@AVHopp AVHopp force-pushed the fix/botorch_preset_issues branch from f76b448 to d230640 Compare June 26, 2026 09:34
Comment thread tests/test_gp.py Outdated
@AVHopp AVHopp force-pushed the fix/botorch_preset_issues branch from 2f51dbf to 2d360fe Compare June 26, 2026 10:58
@AVHopp AVHopp force-pushed the fix/botorch_preset_issues branch from 2d360fe to 315822d Compare June 26, 2026 10:59
@AVHopp AVHopp force-pushed the fix/botorch_preset_issues branch from 315822d to 5c620a0 Compare June 26, 2026 11:02
@AVHopp AVHopp merged commit f7fb066 into main Jun 26, 2026
13 checks passed
@AVHopp AVHopp deleted the fix/botorch_preset_issues branch June 26, 2026 11:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants