cloud
cloud(
model,
*,
remote=False,
cache=True,
dashboard=None,
notify=False,
instance=None,
progress=True,
project=None,
until=None,
overwrite=False,
)Context manager that intercepts PyMC operations with remote execution, caching, live dashboard, and push notifications.
Remote containers stay warm for 20 minutes after the last run.
Runs the full MCMC workflow in the cloud: pm.sample (NUTS via nutpie / pymc / numpyro / blackjax, and custom step= methods), pm.sample_smc, pm.sample_prior_predictive / pm.sample_posterior_predictive, and pm.compute_log_likelihood (for az.loo / az.waic / az.compare). Optimization-based inference (pm.fit variational, pm.find_MAP) and non-InferenceData utilities (pm.compute_deterministics, pm.draw) are not yet routed to the cloud and still run locally. For remote pm.sample, return_inferencedata=False and a per-draw callback= can’t be matched exactly and warn instead of silently diverging.
Usage::
with cp.cloud(model, remote=True): # cloud + live dashboard
with cp.cloud(model, remote=True, notify=True): # cloud + dashboard + ntfy
with cp.cloud(model, remote=True, dashboard=False): # cloud, no dashboard
with cp.cloud(model, cache="disk"): # local + disk cache
with cp.cloud(model, notify=True): # local + ntfy notifications
Methods
| Name | Description |
|---|---|
| destroy | Tear down the environment and clean up the project volume. |
destroy
cloud.destroy()Tear down the environment and clean up the project volume.
Call after the with block to immediately stop the container and delete the project’s volume::
session = cp.cloud(model, remote=True)
with session:
idata = pm.sample(draws=2000)
session.destroy()