provider_selection#
Metadata-driven execution-provider selection.
Which ONNX Runtime execution provider is fastest — and even which is usable —
depends on both the host (Apple CoreML vs NVIDIA CUDA/TensorRT vs CPU) and on
properties of the checkpoint itself (precision, whether its graph has static
shapes). This module keeps that knowledge in one replaceable component rather
than scattered platform if-ladders:
HostCapabilitiescarries the host facts as injectable data, with a single impureHostCapabilities.detect()classmethod.ProviderPolicyis the port;DefaultProviderPolicyis the adapter that maps(checkpoint, host)to an ordered provider chain. Users with exotic hardware implement their own policy.
Importing this module requires ONNX Runtime (the [cpu] or [gpu] extra)
and raises MissingExtraError if it is missing.
Classes#
|
Default policy mapping |
|
Execution-relevant facts about the host, captured as injectable data. |
|
Port mapping a checkpoint and host to an ordered execution-provider chain. |