Device selection
Choose the device type (runtime + hardware) your model runs on. This guide covers supported types, discovery, deterministic vs. fallback selection, and pinning specific cards.
Last updated
Was this helpful?
Was this helpful?
from degirum_tools import ModelSpec
model_spec = ModelSpec(
model_name="…",
zoo_url="degirum/axelera",
inference_host_address="@local",
)
model = model_spec.load_model()print(
"supported:", model.supported_device_types
) # e.g., ['AXELERA/METIS']model.device_type = "AXELERA/METIS" # Pick a type to query
print("available indices:", model.devices_available) # e.g., [0]# Lock to one runtime/hardware type
model_spec = ModelSpec(
..., model_properties={"device_type": "AXELERA/METIS"}
)
model = model_spec.load_model()# Prefer Metis, then CPU as a last resort
model_spec = ModelSpec(
...,
model_properties={
"device_type": ["AXELERA/METIS", "CPU"]
},
)
model = model_spec.load_model() # First available winsmodel.device_type = "AXELERA/METIS"
print(model.devices_available) # e.g., [0]
model.devices_selected = [0] # Choose the first available card