Skip to content

Make fully Bayesian imports lazy (#3265)#3265

Open
sdaulton wants to merge 1 commit into
meta-pytorch:mainfrom
sdaulton:export-D99687047
Open

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

Conversation

@sdaulton
Copy link
Copy Markdown
Contributor

@sdaulton sdaulton commented Apr 6, 2026

Summary:
X-link: facebook/Ax#5148

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/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
Copy link
Copy Markdown

codecov Bot commented Apr 6, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.98%. Comparing base (0c93a38) to head (072d5c0).

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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 (#3265) 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:
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 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
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.

1 participant