resolve_lagllama_device_string
lagllama_device.resolve_lagllama_device_string
Lag-Llama device selection. models/lagllama/settings.yaml uses device: cpu for CPU-only workers and local runs. Explicit cuda / cuda:0 values are preserved. Requested cpu is never upgraded based on job tier so multivariate / covariate fan-out stays on the configured device (notably CPU-only Batch jobs).
resolve_lagllama_device_string(requested, *, worker_compute_tier, cuda_available) -> str
Return the device string passed to torch.device for Lag-Llama.
| Parameter | Type | Default | Description |
|---|---|---|---|
requested |
str |
- | Value from model settings (e.g. "cpu", "cuda"). |
worker_compute_tier |
str |
- | Raw WORKER_COMPUTE_TIER env (e.g. "gpu"). Ignored for device selection; kept for API stability with existing call sites. |
cuda_available |
bool |
- | Whether CUDA is available at runtime. Ignored unless requested is a CUDA device string (callers may use it in the future for validation). |