Make fully Bayesian imports lazy (#3265)#3265
Open
sdaulton wants to merge 1 commit into
Open
Conversation
sdaulton
added a commit
to sdaulton/Ax-1
that referenced
this pull request
Apr 6, 2026
Summary: X-link: meta-pytorch/botorch#3265 `import botorch` eagerly loaded Pyro via two import paths: 1. `botorch.fit` → `from pyro.infer.mcmc import MCMC, NUTS` 2. `botorch.models.__init__` → `fully_bayesian.py` → Pyro imports This diff makes fully Bayesian imports lazy so that `import botorch` no longer eagerly loads Pyro. The imports are deferred until `fit_fully_bayesian_model_nuts` is called or `SaasFullyBayesianSingleTaskGP`/`SaasFullyBayesianMultiTaskGP` are accessed from `botorch.models`. Differential Revision: D99687047
sdaulton
added a commit
to sdaulton/Ax-1
that referenced
this pull request
Apr 6, 2026
Summary: X-link: meta-pytorch/botorch#3265 `import botorch` eagerly loaded Pyro via two import paths: 1. `botorch.fit` → `from pyro.infer.mcmc import MCMC, NUTS` 2. `botorch.models.__init__` → `fully_bayesian.py` → Pyro imports This diff makes fully Bayesian imports lazy so that `import botorch` no longer eagerly loads Pyro. The imports are deferred until `fit_fully_bayesian_model_nuts` is called or `SaasFullyBayesianSingleTaskGP`/`SaasFullyBayesianMultiTaskGP` are accessed from `botorch.models`. Differential Revision: D99687047
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3265 +/- ##
=======================================
Coverage 99.98% 99.98%
=======================================
Files 221 221
Lines 21916 21924 +8
=======================================
+ Hits 21912 21920 +8
Misses 4 4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
sdaulton
added a commit
to sdaulton/botorch
that referenced
this pull request
Apr 7, 2026
Summary: X-link: facebook/Ax#5148 `import botorch` eagerly loaded Pyro via two import paths: 1. `botorch.fit` → `from pyro.infer.mcmc import MCMC, NUTS` 2. `botorch.models.__init__` → `fully_bayesian.py` → Pyro imports This diff makes fully Bayesian imports lazy so that `import botorch` no longer eagerly loads Pyro. The imports are deferred until `fit_fully_bayesian_model_nuts` is called or `SaasFullyBayesianSingleTaskGP`/`SaasFullyBayesianMultiTaskGP` are accessed from `botorch.models`. Reviewed By: saitcakmak Differential Revision: D99687047
05167ee to
077339d
Compare
sdaulton
added a commit
to sdaulton/Ax-1
that referenced
this pull request
Apr 7, 2026
Summary: X-link: meta-pytorch/botorch#3265 `import botorch` eagerly loaded Pyro via two import paths: 1. `botorch.fit` → `from pyro.infer.mcmc import MCMC, NUTS` 2. `botorch.models.__init__` → `fully_bayesian.py` → Pyro imports This diff makes fully Bayesian imports lazy so that `import botorch` no longer eagerly loads Pyro. The imports are deferred until `fit_fully_bayesian_model_nuts` is called or `SaasFullyBayesianSingleTaskGP`/`SaasFullyBayesianMultiTaskGP` are accessed from `botorch.models`. Reviewed By: saitcakmak Differential Revision: D99687047
sdaulton
added a commit
to sdaulton/Ax-1
that referenced
this pull request
Apr 7, 2026
Summary: X-link: meta-pytorch/botorch#3265 `import botorch` eagerly loaded Pyro via two import paths: 1. `botorch.fit` → `from pyro.infer.mcmc import MCMC, NUTS` 2. `botorch.models.__init__` → `fully_bayesian.py` → Pyro imports This diff makes fully Bayesian imports lazy so that `import botorch` no longer eagerly loads Pyro. The imports are deferred until `fit_fully_bayesian_model_nuts` is called or `SaasFullyBayesianSingleTaskGP`/`SaasFullyBayesianMultiTaskGP` are accessed from `botorch.models`. Reviewed By: saitcakmak Differential Revision: D99687047
sdaulton
added a commit
to sdaulton/Ax-1
that referenced
this pull request
Apr 7, 2026
Summary: Pull Request resolved: facebook#5148 X-link: meta-pytorch/botorch#3265 `import botorch` eagerly loaded Pyro via two import paths: 1. `botorch.fit` → `from pyro.infer.mcmc import MCMC, NUTS` 2. `botorch.models.__init__` → `fully_bayesian.py` → Pyro imports This diff makes fully Bayesian imports lazy so that `import botorch` no longer eagerly loads Pyro. The imports are deferred until `fit_fully_bayesian_model_nuts` is called or `SaasFullyBayesianSingleTaskGP`/`SaasFullyBayesianMultiTaskGP` are accessed from `botorch.models`. Reviewed By: saitcakmak Differential Revision: D99687047
sdaulton
added a commit
to sdaulton/botorch
that referenced
this pull request
Apr 7, 2026
Summary: X-link: facebook/Ax#5148 Pull Request resolved: meta-pytorch#3265 `import botorch` eagerly loaded Pyro via two import paths: 1. `botorch.fit` → `from pyro.infer.mcmc import MCMC, NUTS` 2. `botorch.models.__init__` → `fully_bayesian.py` → Pyro imports This diff makes fully Bayesian imports lazy so that `import botorch` no longer eagerly loads Pyro. The imports are deferred until `fit_fully_bayesian_model_nuts` is called or `SaasFullyBayesianSingleTaskGP`/`SaasFullyBayesianMultiTaskGP` are accessed from `botorch.models`. Reviewed By: saitcakmak Differential Revision: D99687047
077339d to
bafbda6
Compare
sdaulton
added a commit
to sdaulton/Ax-1
that referenced
this pull request
Apr 8, 2026
Summary: X-link: meta-pytorch/botorch#3265 `import botorch` eagerly loaded Pyro via two import paths: 1. `botorch.fit` → `from pyro.infer.mcmc import MCMC, NUTS` 2. `botorch.models.__init__` → `fully_bayesian.py` → Pyro imports This diff makes fully Bayesian imports lazy so that `import botorch` no longer eagerly loads Pyro. The imports are deferred until `fit_fully_bayesian_model_nuts` is called or `SaasFullyBayesianSingleTaskGP`/`SaasFullyBayesianMultiTaskGP` are accessed from `botorch.models`. Reviewed By: saitcakmak Differential Revision: D99687047
sdaulton
added a commit
to sdaulton/Ax-1
that referenced
this pull request
Apr 8, 2026
Summary: X-link: meta-pytorch/botorch#3265 `import botorch` eagerly loaded Pyro via two import paths: 1. `botorch.fit` → `from pyro.infer.mcmc import MCMC, NUTS` 2. `botorch.models.__init__` → `fully_bayesian.py` → Pyro imports This diff makes fully Bayesian imports lazy so that `import botorch` no longer eagerly loads Pyro. The imports are deferred until `fit_fully_bayesian_model_nuts` is called or `SaasFullyBayesianSingleTaskGP`/`SaasFullyBayesianMultiTaskGP` are accessed from `botorch.models`. Reviewed By: saitcakmak Differential Revision: D99687047
sdaulton
added a commit
to sdaulton/botorch
that referenced
this pull request
Apr 8, 2026
Summary: X-link: facebook/Ax#5148 `import botorch` eagerly loaded Pyro via two import paths: 1. `botorch.fit` → `from pyro.infer.mcmc import MCMC, NUTS` 2. `botorch.models.__init__` → `fully_bayesian.py` → Pyro imports This diff makes fully Bayesian imports lazy so that `import botorch` no longer eagerly loads Pyro. The imports are deferred until `fit_fully_bayesian_model_nuts` is called or `SaasFullyBayesianSingleTaskGP`/`SaasFullyBayesianMultiTaskGP` are accessed from `botorch.models`. Reviewed By: saitcakmak Differential Revision: D99687047
bafbda6 to
4a13876
Compare
sdaulton
added a commit
to sdaulton/botorch
that referenced
this pull request
Apr 8, 2026
Summary: X-link: facebook/Ax#5148 Pull Request resolved: meta-pytorch#3265 `import botorch` eagerly loaded Pyro via two import paths: 1. `botorch.fit` → `from pyro.infer.mcmc import MCMC, NUTS` 2. `botorch.models.__init__` → `fully_bayesian.py` → Pyro imports This diff makes fully Bayesian imports lazy so that `import botorch` no longer eagerly loads Pyro. The imports are deferred until `fit_fully_bayesian_model_nuts` is called or `SaasFullyBayesianSingleTaskGP`/`SaasFullyBayesianMultiTaskGP` are accessed from `botorch.models`. Reviewed By: saitcakmak Differential Revision: D99687047
4a13876 to
c00e1b7
Compare
sdaulton
added a commit
to sdaulton/Ax-1
that referenced
this pull request
Apr 8, 2026
Summary: Pull Request resolved: facebook#5148 X-link: meta-pytorch/botorch#3265 `import botorch` eagerly loaded Pyro via two import paths: 1. `botorch.fit` → `from pyro.infer.mcmc import MCMC, NUTS` 2. `botorch.models.__init__` → `fully_bayesian.py` → Pyro imports This diff makes fully Bayesian imports lazy so that `import botorch` no longer eagerly loads Pyro. The imports are deferred until `fit_fully_bayesian_model_nuts` is called or `SaasFullyBayesianSingleTaskGP`/`SaasFullyBayesianMultiTaskGP` are accessed from `botorch.models`. Reviewed By: saitcakmak Differential Revision: D99687047
c00e1b7 to
4b773a2
Compare
sdaulton
added a commit
to sdaulton/botorch
that referenced
this pull request
Apr 9, 2026
Summary: X-link: facebook/Ax#5148 `import botorch` eagerly loaded Pyro via two import paths: 1. `botorch.fit` → `from pyro.infer.mcmc import MCMC, NUTS` 2. `botorch.models.__init__` → `fully_bayesian.py` → Pyro imports This diff makes fully Bayesian imports lazy so that `import botorch` no longer eagerly loads Pyro. The imports are deferred until `fit_fully_bayesian_model_nuts` is called or `SaasFullyBayesianSingleTaskGP`/`SaasFullyBayesianMultiTaskGP` are accessed from `botorch.models`. Reviewed By: saitcakmak Differential Revision: D99687047
sdaulton
added a commit
to sdaulton/Ax-1
that referenced
this pull request
Apr 9, 2026
Summary: X-link: meta-pytorch/botorch#3265 `import botorch` eagerly loaded Pyro via two import paths: 1. `botorch.fit` → `from pyro.infer.mcmc import MCMC, NUTS` 2. `botorch.models.__init__` → `fully_bayesian.py` → Pyro imports This diff makes fully Bayesian imports lazy so that `import botorch` no longer eagerly loads Pyro. The imports are deferred until `fit_fully_bayesian_model_nuts` is called or `SaasFullyBayesianSingleTaskGP`/`SaasFullyBayesianMultiTaskGP` are accessed from `botorch.models`. Reviewed By: saitcakmak Differential Revision: D99687047
Summary: X-link: facebook/Ax#5148 Pull Request resolved: meta-pytorch#3265 `import botorch` eagerly loaded Pyro via two import paths: 1. `botorch.fit` → `from pyro.infer.mcmc import MCMC, NUTS` 2. `botorch.models.__init__` → `fully_bayesian.py` → Pyro imports This diff makes fully Bayesian imports lazy so that `import botorch` no longer eagerly loads Pyro. The imports are deferred until `fit_fully_bayesian_model_nuts` is called or `SaasFullyBayesianSingleTaskGP`/`SaasFullyBayesianMultiTaskGP` are accessed from `botorch.models`. Reviewed By: saitcakmak Differential Revision: D99687047
4b773a2 to
072d5c0
Compare
sdaulton
added a commit
to sdaulton/Ax-1
that referenced
this pull request
Apr 9, 2026
Summary: Pull Request resolved: facebook#5148 X-link: meta-pytorch/botorch#3265 `import botorch` eagerly loaded Pyro via two import paths: 1. `botorch.fit` → `from pyro.infer.mcmc import MCMC, NUTS` 2. `botorch.models.__init__` → `fully_bayesian.py` → Pyro imports This diff makes fully Bayesian imports lazy so that `import botorch` no longer eagerly loads Pyro. The imports are deferred until `fit_fully_bayesian_model_nuts` is called or `SaasFullyBayesianSingleTaskGP`/`SaasFullyBayesianMultiTaskGP` are accessed from `botorch.models`. Reviewed By: saitcakmak Differential Revision: D99687047
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:
X-link: facebook/Ax#5148
import botorcheagerly loaded Pyro via two import paths:botorch.fit→from pyro.infer.mcmc import MCMC, NUTSbotorch.models.__init__→fully_bayesian.py→ Pyro importsThis diff makes fully Bayesian imports lazy so that
import botorchno longereagerly loads Pyro. The imports are deferred until
fit_fully_bayesian_model_nutsis called or
SaasFullyBayesianSingleTaskGP/SaasFullyBayesianMultiTaskGPareaccessed from
botorch.models.Reviewed By: saitcakmak
Differential Revision: D99687047