Commit d71297f
authored
[XPU] Changed how XPU discovery works during
## Summary
Right now we check `xpu-smi` during installation to find out if machine
has XPU device. But `xpu-smi` is often missing from user devices, so we
end up discovering incorrect platform (`cpu`) and then try to install
wrong `triton` dependency. User ends up with `triton-xpu` being
overwritten by `triton`. This combination doesn't work.
So I check `sycl-ls` which should be available. The output I get on PVC
machine:
```
[level_zero:gpu][level_zero:0] Intel(R) oneAPI Unified Runtime over Level-Zero, Intel(R) Data Center GPU Max 1100 12.60.7 [1.6.32567+18]
[opencl:cpu][opencl:0] Intel(R) OpenCL, Intel(R) Xeon(R) Gold 6438Y+ OpenCL 3.0 (Build 0) [2024.18.12.0.05_160000]
[opencl:gpu][opencl:1] Intel(R) OpenCL Graphics, Intel(R) Data Center GPU Max 1100 OpenCL 3.0 NEO [25.05.32567]
```
The output I get on B570 machine:
```
[level_zero:gpu][level_zero:0] Intel(R) oneAPI Unified Runtime over Level-Zero, Intel(R) Arc(TM) B570 Graphics 20.1.0 [1.6.32567+19]
[opencl:cpu][opencl:0] Intel(R) OpenCL, Intel(R) Core(TM) Ultra 7 265K OpenCL 3.0 (Build 0) [2025.19.4.0.18_160000.xmain-hotfix]
[opencl:gpu][opencl:1] Intel(R) OpenCL Graphics, Intel(R) Arc(TM) B570 Graphics OpenCL 3.0 NEO [25.05.32567]
```
## Possible alternative
We could just import pytorch and check `torch.xpu.is_available()`. It
might even be better that way, since right now if user is missing torch
we will try to install cuda torch even for XPU devices.
## Testing Done
I tested it by installing on new conda environment from the source code
with:
```
pip install torch==2.7.0 torchvision==0.22.0 torchaudio==2.7.0 --index-url https://download.pytorch.org/whl/xpu --no-cache-dir
pip install -e .
```
- Hardware Type: XPU
- [ ] run `make test` to ensure correctness
- [ ] run `make checkstyle` to ensure code style
- [ ] run `make test-convergence` to ensure convergencesetup.py (#720)1 parent ab97c4b commit d71297f
1 file changed
+23
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
50 | 71 | | |
51 | 72 | | |
52 | 73 | | |
| |||
63 | 84 | | |
64 | 85 | | |
65 | 86 | | |
66 | | - | |
67 | | - | |
| 87 | + | |
68 | 88 | | |
69 | 89 | | |
70 | | - | |
| 90 | + | |
71 | 91 | | |
72 | 92 | | |
73 | 93 | | |
| |||
0 commit comments