Skip to content
This repository was archived by the owner on Sep 10, 2025. It is now read-only.

Commit 778efd6

Browse files
committed
add xpu
1 parent f20f5e7 commit 778efd6

File tree

2 files changed

+25
-14
lines changed

2 files changed

+25
-14
lines changed

install/install_requirements.sh

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,14 @@ fi
3535
# newer version of torch nightly installed later in this script.
3636
#
3737

38+
#(
39+
# set -x
40+
# $PIP_EXECUTABLE install -r install/requirements.txt --extra-index-url https://download.pytorch.org/whl/nightly/cu121
41+
#)
42+
3843
(
3944
set -x
40-
$PIP_EXECUTABLE install -r install/requirements.txt --extra-index-url https://download.pytorch.org/whl/nightly/cu121
45+
$PIP_EXECUTABLE install -r install/requirements.txt --extra-index-url https://download.pytorch.org/whl/nightly/xpu
4146
)
4247

4348
# Since torchchat often uses main-branch features of pytorch, only the nightly
@@ -47,7 +52,7 @@ fi
4752
# NOTE: If a newly-fetched version of the executorch repo changes the value of
4853
# PYTORCH_NIGHTLY_VERSION, you should re-run this script to install the necessary
4954
# package versions.
50-
PYTORCH_NIGHTLY_VERSION=dev20241002
55+
PYTORCH_NIGHTLY_VERSION=dev20241001
5156

5257
# Nightly version for torchvision
5358
VISION_NIGHTLY_VERSION=dev20241002
@@ -64,21 +69,21 @@ TUNE_NIGHTLY_VERSION=dev20241010
6469
# The pip repository that hosts nightly torch packages. cpu by default.
6570
# If cuda is available, based on presence of nvidia-smi, install the pytorch nightly
6671
# with cuda for faster execution on cuda GPUs.
67-
if [[ -x "$(command -v nvidia-smi)" ]];
68-
then
69-
TORCH_NIGHTLY_URL="https://download.pytorch.org/whl/nightly/cu121"
70-
elif [[ -x "$(command -v rocminfo)" ]];
71-
then
72-
TORCH_NIGHTLY_URL="https://download.pytorch.org/whl/nightly/rocm6.2"
73-
else
74-
TORCH_NIGHTLY_URL="https://download.pytorch.org/whl/nightly/cpu"
75-
fi
76-
72+
#if [[ -x "$(command -v nvidia-smi)" ]];
73+
#then
74+
# TORCH_NIGHTLY_URL="https://download.pytorch.org/whl/nightly/cu121"
75+
#elif [[ -x "$(command -v rocminfo)" ]];
76+
#then
77+
# TORCH_NIGHTLY_URL="https://download.pytorch.org/whl/nightly/rocm6.2"
78+
#else
79+
# TORCH_NIGHTLY_URL="https://download.pytorch.org/whl/nightly/cpu"
80+
#fi
81+
TORCH_NIGHTLY_URL="https://download.pytorch.org/whl/nightly/xpu"
7782
# pip packages needed by exir.
7883
REQUIREMENTS_TO_INSTALL=(
7984
torch=="2.6.0.${PYTORCH_NIGHTLY_VERSION}"
8085
torchvision=="0.20.0.${VISION_NIGHTLY_VERSION}"
81-
torchtune=="0.4.0.${TUNE_NIGHTLY_VERSION}"
86+
#torchtune=="0.3.0.${TUNE_NIGHTLY_VERSION}"
8287
)
8388

8489
# Install the requirements. --extra-index-url tells pip to look for package
@@ -89,6 +94,12 @@ REQUIREMENTS_TO_INSTALL=(
8994
"${REQUIREMENTS_TO_INSTALL[@]}"
9095
)
9196

97+
(
98+
set -x
99+
$PIP_EXECUTABLE install --extra-index-url "${TORCH_NIGHTLY_URL}" \
100+
torchtune=="0.3.1"
101+
)
102+
92103
(
93104
set -x
94105
$PIP_EXECUTABLE install torchao=="0.5.0"

torchchat/cli/cli.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ def _add_model_config_args(parser, verb: str) -> None:
167167
"--device",
168168
type=str,
169169
default=default_device,
170-
choices=["fast", "cpu", "cuda", "mps"],
170+
choices=["fast", "cpu", "cuda", "mps", "xpu"],
171171
help="Hardware device to use. Options: cpu, cuda, mps",
172172
)
173173

0 commit comments

Comments
 (0)