You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: API.md
+22-1Lines changed: 22 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -23,13 +23,34 @@ gpus = get_gpus() # Returns a list of `torchruntime.device_db.GPU` instances co
23
23
24
24
**Important:** This API could break in the future, so if you're writing a program using this, please open a new Issue on this repo and let me know what you're trying to do.
25
25
26
-
## Get torch platform
26
+
## Get torch platform (given any GPU)
27
27
This will return the recommended torch platform to use for the PC. It will analyze the GPUs and OS on the PC, and suggest the most-performant version of torch for that.
28
28
29
+
*Note: this is different from the installed torch platfrom (see the next paragraph)!*
30
+
29
31
E.g. `cu124` or `rocm6.1` or `directml` or `ipex` or `xpu` or `cpu`.
30
32
31
33
```py
32
34
from torchruntime.platform_detection import get_torch_platform
33
35
34
36
torch_platform = get_torch_platform(gpus) # use `torchruntime.device_db.get_gpus()` to get a list of recognized GPUs
35
37
```
38
+
39
+
## Get installed torch platform
40
+
This will return the installed torch platform, if any. E.g. "cuda", "mps", "cpu" etc.
41
+
42
+
```py
43
+
from torchruntime.utils import get_installed_torch_platform
0 commit comments