--- layout: "docs" page_title: "device Stanza - Job Specification" sidebar_current: "docs-job-specification-device" description: |- The "device" stanza is used to require a certain device be made available to the task. --- # `device` Stanza
| Placement |
job -> group -> task -> resources -> **device**
|
|---|
([Constraint][]: nil) - Constraints to restrict
which devices are eligible. This can be provided multiple times to define
additional constraints. See below for available attributes.
- `affinity` ([Affinity][]: nil) - Affinity to specify a preference
for which devices get selected. This can be provided multiple times to define
additional affinities. See below for available attributes.
## `device` Constraint and Affinity Attributes
The set of attributes available for use in a `constraint` or `affinity` are as
follows:
| Variable | Description | Example Value |
|---|---|---|
| ${device.type} | The type of device | "gpu", "tpu", "fpga" |
| ${device.vendor} | The device's vendor | "amd", "nvidia", "intel" |
| ${device.model} | The device's model | "1080ti" |
| ${device.attr.<property>} | Property of the device | ${device.attr.memory} => 8 GiB |
| Base Unit | Values |
|---|---|
| Byte | **Base 2**: KiB, MiB, GiB, TiB, PiB, EiB **Base 10**: kB, KB (equivalent to kB), MB, GB, TB, PB, EB |
| Byte Rates | **Base 2**: KiB/s, MiB/s, GiB/s, TiB/s, PiB/s, EiB/s **Base 10**: kB/s, KB/s (equivalent to kB/s), MB/s, GB/s, TB/s, PB/s, EB/s |
| Hertz | MHz, GHz |
| Watts | mW, W, kW, MW, GW |