Skip to content

Commit ec983bd

Browse files
committed
Add docstring to get_iree_devices
1 parent 5a28d36 commit ec983bd

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

sharktank/sharktank/utils/iree.py

+12
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,18 @@
2626
def get_iree_devices(
2727
*, driver: str | None = None, device_count: int = 1
2828
) -> List[iree.runtime.HalDevice]:
29+
"""Gets a list of IREE HAL devices for the given driver.
30+
31+
The first available device_count devices will be created,
32+
unless the IREE_DEVICE environment variable is set to an
33+
explicit list of device URIs.
34+
35+
For example, to select HIP devices 5 and 3:
36+
```
37+
export IREE_DEVICE=hip://5,hip://3
38+
python ...
39+
```
40+
"""
2941
if "IREE_DEVICE" in os.environ:
3042
device_uris = [d.strip() for d in os.environ["IREE_DEVICE"].split(",")]
3143
driver_names = [n.split("://")[0] for n in device_uris]

0 commit comments

Comments
 (0)