Needs support XPU
Now haystack supports only devices:
https://github.com/deepset-ai/haystack/blob/main/haystack/utils/device.py
CPU = "cpu"
GPU = "cuda"
DISK = "disk"
MPS = "mps"
But the list of supported devices (for example in torch) includes:
https://pytorch.org/docs/stable/xpu.html
XPU
Naturally, the list of supported devices in torch is even wider.
Proposed modification (minimal) to include support for XPU (intel GPU):
class DeviceType(Enum):
"""
Represents device types supported by Haystack.
This also includes devices that are not directly used by models - for example, the disk device is exclusively used
in device maps for frameworks that support offloading model weights to disk.
"""
CPU = "cpu"
GPU = "cuda"
DISK = "disk"
MPS = "mps"
XPU = "xpu" # THIS IS NEW DEVICE SUPPORT
def __str__(self):
return self.value
Or load supported devices by torch dynamically, if it possible.
Hello @strcom and thank you for your suggestion! @sjrl and I briefly discussed the proposed modification that extends the DeviceType Enum and we like it. (Loading supported devices by torch dynamically is not our preference because new devices types don't need to be added often.) Would you be interested in opening a PR yourself? I assume you have a Intel GPU at hand to test the proposed modification? Here are simple contributing guidelines.