Marin uses Fray for scheduling and resource management (dispatching to Iris on shared clusters, or to a local backend for laptop runs). The fray library provides unified resource configuration types that translate to concrete cluster resource requests.
The main entry point for resource configuration. Use the static factory methods to create configurations:
from fray.cluster import ResourceConfig
# TPU configuration
tpu_config = ResourceConfig.with_tpu("v4-8")
tpu_multislice = ResourceConfig.with_tpu("v4-8", slice_count=2)
# GPU configuration
gpu_config = ResourceConfig.with_gpu("H100", count=8)
gpu_auto = ResourceConfig.with_gpu() # auto-detect GPU type
# CPU-only configuration
cpu_config = ResourceConfig.with_cpu()::: fray.types.ResourceConfig
These are the underlying device types wrapped by ResourceConfig:
::: fray.types.CpuConfig
::: fray.types.GpuConfig
::: fray.types.TpuConfig