Lesson 29← back to roadmap
GpuDeviceManager probes whatever was compiled in. BackendSelector picks the best device that matches policy.
Probe order (docs/internals/gpu-engine.md): Metal (Apple), CUDA, HIP. Each probe init+inspect+shutdowns the backend inside a try/catch. Devices are then sorted by total device memory descending.
Backend maturity
- Metal — implemented (Beta, M4-validated), default ON on Apple; distance + top-k kernels
- CUDA — experimental
- HIP / ROCm — experimental
- CPU — always available; the fallback path
Select a device from Python
python
import elips
for acc in elips.accelerators():
print(acc.name, acc.backend, acc.memory_bytes, acc.unified_memory)
# device=: "cpu" | "auto" | "metal" | "cuda:N" | "hip:N" (NOT gpu=True)
client = elips.Client(dimension=128, device="metal", fallback=True)
print(client.native.gpu_info())- device='auto' — best probed device, else CPU
- device='cpu' — never touches the GPU
- device='cuda:0'/'hip:0'/'metal' — a named backend; raises BackendUnavailableError if absent unless fallback=True