|
IRON 1a5eed49d3c0721a318ac369f725acc96b7c4584
|
Namespaces | |
| namespace | device |
| namespace | tile |
Functions | |
| type[Device] | __getattr__ (str name) |
| Device | from_name (str name, *int|None n_cols=1) |
Variables | |
| dict | _NAME_TO_BASE |
| dict | _MAX_COLS = {"NPU1": 4, "NPU2": 8} |
Device representations for supported AMD Ryzen AI NPU targets.
| type[Device] iron.device.__getattr__ | ( | str | name | ) |
| Device iron.device.from_name | ( | str | name, |
| *int | None | n_cols = 1 |
||
| ) |
Resolve a device-name string (and optional column count) to a Device.
Designed to consume the ``--dev`` CLI flag that almost every
programming example exposes. Replaces the per-example
``_device_for(dev_str)`` boilerplate.
Args:
name: One of:
- ``"npu"`` / ``"npu1"`` — Phoenix/Hawk Point (AIE2)
- ``"npu2"`` — Strix/Krackan (AIE2P)
- ``"xcvc1902"`` / ``"xcve2302"`` / ``"xcve2802"`` — Versal AIE1
Case-insensitive.
n_cols: Number of columns to use for NPU devices. ``1`` (the
default) selects the single-column variant
(``NPU1Col1`` / ``NPU2Col1``). ``2..N-1`` selects
``NPU{1,2}Col{n_cols}``. Passing the device's max
(``4`` for NPU1, ``8`` for NPU2) — or ``None`` as a
family-agnostic "max" sentinel — selects the unrestricted
multi-column device (``NPU1`` / ``NPU2``). Ignored for
Versal devices.
Returns:
Device instance.
Raises:
ValueError: ``name`` unrecognized, or ``n_cols`` out of range
for the chosen NPU family.
|
protected |
|
protected |