Devices
Device Selection
The full list of available devices can be retrieved with get_devices().
import qai_hub as hub
client = hub.Client()
devices = client.get_devices()
print(devices)
Or using the Command Line Interface:
qai-hub list-devices
Device Types
There are three types of devices:
General devices: Most devices are exactly what is listed. If there is no
(Family)or(Proxy)in the device name, all workloads targeting the device will run on that exact hosted device.Family devices: Device names that end with
(Family)indicate a device family. This allows users to target a device family instead of a specific type of device to improve queue times. For instance, targeting the Samsung Galaxy S25 (Family) allows Workbench to run your workload on any variant of the Samsung Galaxy S25 (Samsung Galaxy S25, Samsung Galaxy S25 Ultra, Samsung Galaxy S25+) rather than requiring a specific device to be available. We highly recommend targeting the Family device when possible.Proxy devices: Device names that end with
(Proxy)indicate that we are using a substitute device to serve as a target for a non-hosted device. These proxy devices allow users to filter for device/model compatibility in AI Hub Models and create assets in AI Hub Workbench that will run on the listed device. While we identify proxy devices that are as similar to the non-hosted device as possible, because we do not host the actual device, the metrics, performance, and accuracy on the actual device will vary from what is published on the AI Hub Models pages. Proxy metrics are always run on the NPU. When running on your own device, ensure that you are leveraging the NPU for similar results; running on the CPU could potentially yield completely different metrics.
Device Filtering
This returns a list of Device objects.
Devices can be filtered based on name, OS, or attributes. To get a specific device,
filter by name and OS.
import qai_hub as hub
client = hub.Client()
devices = client.get_devices(name="Samsung Galaxy S24 (Family)")
print(devices)
devices_os13 = client.get_devices(os="13", attributes="os:android")
print(devices_os13)
OS versions can be expressed as a single value or half-open interval. For example,
os=[10, 12) will select OS major versions 10 and 11, but not 12.
import qai_hub as hub
client = hub.Client()
devices_os10_to_os11 = client.get_devices(os="[10, 12)", attributes="os:android")
print(devices_os10_to_os11)
devices_os12_and_more = client.get_devices(os="[12,)", attributes="os:android")
print(devices_os12_and_more)
Devices can be further filtered by attributes. The following example selects all
devices with a Snapdragon® 8 Gen 2 SOC that support TensorFlow Lite. Supported attributes
are documented in Device.
import qai_hub as hub
client = hub.Client()
devices = client.get_devices(attributes=["chipset:qualcomm-snapdragon-8gen2", "framework:tflite"])
print(devices)
The name, OS, and attributes can be used together as well. The list of devices returned contain those that match all supplied filters. This list can be empty. The following code selects all devices with a Snapdragon® 8 Gen 2 SOC and Android OS version 12 and up.
import qai_hub as hub
client = hub.Client()
devices = client.get_devices(attributes=["chipset:qualcomm-snapdragon-8gen2", "os:android"], os="[12,)")
print(devices)
The name, OS, and attributes can be used to select a single device as well
using the Device class.
import qai_hub as hub
device_sn8gen2 = hub.Device(attributes="chipset:qualcomm-snapdragon-8gen2")
device_os12 = hub.Device(os="12", attributes="os:android")
device_galaxy_s23 = hub.Device(name="Samsung Galaxy S23 Ultra")
If more than one device match the supplied filters, an arbitrary device with the latest available OS version is selected.