|
LIRRA
1.0.0
|
Functions | |
| bool | _cuda_available () |
| str | resolve_device (str|None device=None) |
| str | configure_jax_device (str|None device=None) |
| dict[str, object] | jax_device_summary () |
Variables | |
| tuple | _VALID = ("cpu", "gpu", "auto") |
CPU/GPU switch for JAX, MJX and Brax. The same code runs on the laptop (CPU smoke tests) and on the cluster (GPU training). Select the device with, in order of precedence: 1. the ``device`` argument (``"cpu"``, ``"gpu"`` or ``"auto"``), 2. the ``RL_STL_DEVICE`` environment variable, 3. ``"auto"``: GPU if ``nvidia-smi`` exists and the JAX CUDA plugin is installed (``uv sync --extra cuda12``), otherwise CPU. JAX reads its platform configuration at import time, so :func:`configure_jax_device` must run **before** the first ``import jax`` anywhere in the process (including indirect imports via brax/playground).
|
protected |
| str rl_stl.utils.device.configure_jax_device | ( | str | None | device = None | ) |
Set JAX/XLA environment variables for the resolved device and return it.
| dict[str, object] rl_stl.utils.device.jax_device_summary | ( | ) |
Describe the devices JAX actually sees (imports jax).
| str rl_stl.utils.device.resolve_device | ( | str | None | device = None | ) |
|
protected |