Add xpu support for Intel Arc#60
Conversation
|
Thanks for the PR! The XPU support is great to have. One small thing: in the current implementation, "device_map": {"": 0} if (device == "cuda" and torch.cuda.is_available())
else {"": "xpu:0"} if xpu_availiable()
else deviceThis overrides the user’s selection, so even if someone chooses To keep behavior consistent with CUDA and MPS, could you update it so that:
Something like: if device == "cuda" and torch.cuda.is_available():
device_map = {"": 0}
elif device == "xpu" and xpu_availiable():
device_map = {"": "xpu:0"}
else:
device_map = deviceThis way XPU works correctly without changing behavior for existing CUDA/CPU/MPS users. Let me know if you need help adjusting it — I can prepare a patch if needed! |
|
Good catch. Updated the PR. |
|
Will this pull request still be merged? I modified the code according to the commit file, and it works fine on my B580. |
|
I hope so. I don't have access to do the merge. Maintainers have to do that. |
Adds support for running on Intel Arc using xpu. Tested on Intel Arc A770M 16GB with pytorch 2.8.0+xpu. Not tested if it breaks cuda support (but it shouldn't).