You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Split into FullyBayesianMultiTaskGP + SaasFullyBayesianMultiTaskGP, generalize 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
0 commit comments