Split into FullyBayesianMultiTaskGP + SaasFullyBayesianMultiTaskGP, generalize to accept any PyroModel#3180
Open
hvarfner wants to merge 1 commit into
Open
Split into FullyBayesianMultiTaskGP + SaasFullyBayesianMultiTaskGP, generalize to accept any PyroModel#3180hvarfner wants to merge 1 commit into
hvarfner wants to merge 1 commit into
Conversation
d637b3f to
8634545
Compare
hvarfner
pushed a commit
to hvarfner/botorch
that referenced
this pull request
Feb 12, 2026
…eneralize to accept any PyroModel (meta-pytorch#3180) Summary: Corresponds to D92844565. This diff also absorbs the 'generalize GP to accept any PyroModel' work from the now-dropped D92844566. (1) Rename the current `SaasFullyBayesianMultiTaskGP` → `FullyBayesianMultiTaskGP` (public name from the start, no private-then-rename dance). (2) Create `SaasFullyBayesianMultiTaskGP(FullyBayesianMultiTaskGP)` that defaults `pyro_model=MultitaskSaasPyroModel()`. (3) Widen `pyro_model` type to `PyroModel`, validate `is_multitask` at construction time: `if not pyro_model.is_multitask: raise ValueError(...)` — the one appropriate use of `is_multitask` (type guard at construction time). (4) Replace hardcoded dummy samples in `load_state_dict` with `pyro_model.get_dummy_mcmc_samples()` — zero hardcoded keys. (5) Base class raises `ValueError` if `pyro_model is None`. `SaasFullyBayesianMultiTaskGP` sets the default. Files to modify: - `fbcode/pytorch/botorch/botorch/models/fully_bayesian_multitask.py` — split class, widen types, delegate load_state_dict - `fbcode/pytorch/botorch/test/models/test_fully_bayesian_multitask.py` — test base with explicit PyroModel, test is_multitask validation, test MaternPyroModel-based MT model MANDATORY CODING STANDARDS (apply to every line of code in this diff): 1. SELF-CONTAINED DIFFS: Every diff must be entirely self-contained. Every line of production code introduced in this diff MUST be covered by tests that are introduced in the SAME diff. Never create code without its corresponding tests, and never create tests in a separate diff from the code they cover. 2. NO TRY/EXCEPT: Do NOT use try/except statements anywhere, under any circumstances. Handle errors through proper control flow, type checking, validation, and return values instead. If existing code uses try/except, that is okay - it does not need to be changed. 3. NO DUPLICATE CODE: Aggressively eliminate duplicate code. Extract shared logic into helper functions, base classes, or utilities. When you believe this item is complete, launch a subagent whose sole job is to audit the diff for duplicate code and refactor it away before finalizing. 4. SIMPLEST REUSABLE SOLUTION: Always choose the simplest, most reusable solution. Prefer composition over inheritance, small focused functions over large ones, and generic utilities over one-off implementations. However, do not excessively use thin wrapper functions, as these unnecessarily increase the number of lines of code. 5. CONCISE DIFF SUMMARY: The diff summary must explain WHY the change is implemented, not enumerate methods added. The summary must be at most three precise sentences describing the functionality and motivation. If it is longer than three sentences, you must shorten the summary. Differential Revision: D93037430
8634545 to
56e687a
Compare
hvarfner
pushed a commit
to hvarfner/botorch
that referenced
this pull request
Feb 12, 2026
Summary: Create generic FullyBayesianMultiTaskGP, make Saas variant special case Differential Revision: D93037430
hvarfner
pushed a commit
to hvarfner/botorch
that referenced
this pull request
Feb 12, 2026
Summary: Create generic FullyBayesianMultiTaskGP, make Saas variant special case Differential Revision: D93037430
56e687a to
95204db
Compare
95204db to
72b94b6
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3180 +/- ##
=======================================
Coverage 99.99% 99.99%
=======================================
Files 219 219
Lines 21414 21416 +2
=======================================
+ Hits 21413 21415 +2
Misses 1 1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
72b94b6 to
9c4a8a4
Compare
hvarfner
pushed a commit
to hvarfner/botorch
that referenced
this pull request
Feb 13, 2026
Summary: Creates generic FullyBayesianMultiTaskGP implementation and refactors the existing SAAS model as a special case Differential Revision: D93037430
hvarfner
pushed a commit
to hvarfner/botorch
that referenced
this pull request
Feb 13, 2026
Summary: Creates generic FullyBayesianMultiTaskGP implementation and refactors the existing SAAS model as a special case Differential Revision: D93037430
9c4a8a4 to
309c649
Compare
Summary: Creates generic FullyBayesianMultiTaskGP implementation and refactors the existing SAAS model as a special case Reviewed By: saitcakmak Differential Revision: D93037430
309c649 to
6d5204a
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.
Summary:
Corresponds to D92844565. This diff also absorbs the 'generalize GP to accept any PyroModel' work from the now-dropped D92844566.
(1) Rename the current
SaasFullyBayesianMultiTaskGP→FullyBayesianMultiTaskGP(public name from the start, no private-then-rename dance).(2) Create
SaasFullyBayesianMultiTaskGP(FullyBayesianMultiTaskGP)that defaultspyro_model=MultitaskSaasPyroModel().(3) Widen
pyro_modeltype toPyroModel, validateis_multitaskat construction time:if not pyro_model.is_multitask: raise ValueError(...)— the one appropriate use ofis_multitask(type guard at construction time).(4) Replace hardcoded dummy samples in
load_state_dictwithpyro_model.get_dummy_mcmc_samples()— zero hardcoded keys.(5) Base class raises
ValueErrorifpyro_model is None.SaasFullyBayesianMultiTaskGPsets the default.Files to modify:
fbcode/pytorch/botorch/botorch/models/fully_bayesian_multitask.py— split class, widen types, delegate load_state_dictfbcode/pytorch/botorch/test/models/test_fully_bayesian_multitask.py— test base with explicit PyroModel, test is_multitask validation, test MaternPyroModel-based MT modelMANDATORY CODING STANDARDS (apply to every line of code in this diff):
SELF-CONTAINED DIFFS: Every diff must be entirely self-contained. Every line of production code introduced in this diff MUST be covered by tests that are introduced in the SAME diff. Never create code without its corresponding tests, and never create tests in a separate diff from the code they cover.
NO TRY/EXCEPT: Do NOT use try/except statements anywhere, under any circumstances. Handle errors through proper control flow, type checking, validation, and return values instead. If existing code uses try/except, that is okay - it does not need to be changed.
NO DUPLICATE CODE: Aggressively eliminate duplicate code. Extract shared logic into helper functions, base classes, or utilities. When you believe this item is complete, launch a subagent whose sole job is to audit the diff for duplicate code and refactor it away before finalizing.
SIMPLEST REUSABLE SOLUTION: Always choose the simplest, most reusable solution. Prefer composition over inheritance, small focused functions over large ones, and generic utilities over one-off implementations. However, do not excessively use thin wrapper functions, as these unnecessarily increase the number of lines of code.
CONCISE DIFF SUMMARY: The diff summary must explain WHY the change is implemented, not enumerate methods added. The summary must be at most three precise sentences describing the functionality and motivation. If it is longer than three sentences, you must shorten the summary.
Differential Revision: D93037430