Skip to content

simulo.Runtime

A Simulo-curated runtime a job executes in. Torch-free metadata recorder.

You normally never construct one: every simulo.App defaults to DEFAULT_RUNTIME. Pick a Simulo runtime by name and layer your own environment variables and public-PyPI packages on top:

runtime = (
simulo.Runtime.from_registry("simulo/gpu-rl:2026.06")
.pip_install("wandb==0.17.0")
.env({"WANDB_PROJECT": "cartpole"})
)
app = simulo.App("cartpole", runtime=runtime)

Nothing is installed on your machine — the runtime is Simulo-built and lives in the cloud; submit only records which runtime the app picked plus the declared env/dependency layers, and the cloud materialises them at execution time.

Real usage, from the shipped cartpole training app — the imports() boundary, the half of the contract the class docstring’s own example above doesn’t show: the one heavy import deferred so discovery never resolves it:

with app.runtime.imports():
import torch # resolved only in execution mode, on the worker

The pip_install() / env() chain above is real too — from the shipped pip-install-shapely app, which layers both onto a picked runtime to bring in a third-party PyPI library and a task parameter together.

simulo.Runtime(runtime_id: str)
Runtime.from_registry(image: str) -> Runtime

classmethod

Pick a Simulo runtime by name (e.g. "simulo/gpu-rl:2026.06").

Runtime.imports() -> AbstractContextManager[None]

Remote-only-import boundary.

In execution mode this is a plain nullcontext (the imports really happen). In discovery mode it installs a stub import finder that records the deferred top-level imports without resolving them — how heavy libraries (torch and friends) stay off your machine at submit.

Runtime.torch_jit(fn: F) -> F

Record the function’s qualname; JIT-compile only on the worker.

In discovery (submit) this is a no-op marker — it records the qualname and returns fn unchanged, so no torch import happens locally. In execution mode (the backend runner, which has the heavy runtime) it replaces @torch.jit.script: torch is imported lazily inside the method so module load stays lean.

Runtime.runtime_id: str

property

The Simulo runtime name passed to from_registry().