Skip to content

Make fully Bayesian imports lazy (#5148)#5148

Closed
sdaulton wants to merge 1 commit into
facebook:mainfrom
sdaulton:export-D99687047
Closed

Make fully Bayesian imports lazy (#5148)#5148
sdaulton wants to merge 1 commit into
facebook:mainfrom
sdaulton:export-D99687047

Conversation

@sdaulton
Copy link
Copy Markdown
Contributor

@sdaulton sdaulton commented Apr 6, 2026

Summary:

X-link: meta-pytorch/botorch#3265

import botorch eagerly loaded Pyro via two import paths:

  1. botorch.fitfrom 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

@meta-cla meta-cla Bot added the CLA Signed Do not delete this pull request or issue due to inactivity. label Apr 6, 2026
@meta-codesync
Copy link
Copy Markdown

meta-codesync Bot commented Apr 6, 2026

@sdaulton has exported this pull request. If you are a Meta employee, you can view the originating Diff in 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
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
@meta-codesync meta-codesync Bot changed the title Make fully Bayesian imports lazy Make fully Bayesian imports lazy (#5148) Apr 7, 2026
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
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
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
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
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:
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 9, 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
@saitcakmak saitcakmak closed this Apr 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed Do not delete this pull request or issue due to inactivity. fb-exported meta-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants