From eca7a2d670a40f97cac208151ec7096adf30572b Mon Sep 17 00:00:00 2001 From: "Lim, Xiang Yang" Date: Tue, 6 Jan 2026 05:19:40 +0100 Subject: [PATCH] feat: initial enablement for XPU device --- README.md | 6 ++++++ src/sharp/cli/predict.py | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 5955753..64bde50 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,12 @@ Afterwards, you can install the project using pip install -r requirements.txt ``` +If you are using *Intel GPU*, you can install the project using the command below + +``` +pip install -r requirements.txt --extra-index-url https://download.pytorch.org/whl/xpu +``` + To test the installation, run ``` diff --git a/src/sharp/cli/predict.py b/src/sharp/cli/predict.py index 8914bb5..19e8dc8 100644 --- a/src/sharp/cli/predict.py +++ b/src/sharp/cli/predict.py @@ -70,7 +70,7 @@ "--device", type=str, default="default", - help="Device to run on. ['cpu', 'mps', 'cuda']", + help="Device to run on. ['cpu', 'mps', 'cuda', 'xpu']", ) @click.option("-v", "--verbose", is_flag=True, help="Activate debug logs.") def predict_cli( @@ -103,6 +103,8 @@ def predict_cli( if device == "default": if torch.cuda.is_available(): device = "cuda" + elif torch.xpu.is_available(): + device = "xpu" elif torch.mps.is_available(): device = "mps" else: