Expand description
Cross-backend cost interface.
Each backend implements BackendCostModel to expose its execution
characteristics (kernel throughput, dispatch overhead, memory bw).
The runtime can then estimate the cost of running a graph on each
available backend and pick the fastest.
This is what enables “auto device” — given a graph, pick CPU or Metal automatically based on which is faster for THIS workload on THIS hardware.
Structs§
- CpuCost
Model BackendCostModelimpl backed byrlx_cpu::cost::HwModel.
Traits§
- Backend
Cost Model - Hardware-aware cost characteristics for a backend on the current machine.
Functions§
- estimate_
graph_ cost - Estimate forward-pass time (ns) for a graph on the given backend. Uses node-level cost contributions; conservative — actual time may be lower due to hardware parallelism we don’t model.
- pick_
best_ device - Pick the device with the lowest predicted cost for this graph.