Skip to content

Commit 821f270

Browse files
authored
[ingress][torch-mlir] Fix install issue by using py3.12 in venv (#1)
Uses `uv`, i.e. Python's package manager++ du jour, for managing venv.
1 parent d0e11c1 commit 821f270

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

ingress/Torch-MLIR/install-virtualenv.sh

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,17 @@ fi
1111

1212

1313
# Install torch-mlir inside a virtual environment
14+
echo "First ensure uv is installed"
15+
16+
python -m pip install uv --upgrade
17+
1418
echo "Preparing the virtual environment"
15-
python3 -m venv torch-mlir-venv
19+
python -m uv venv torch-mlir-venv --python 3.12
20+
21+
#echo "Preparing the virtual environment"
22+
#python3 -m venv torch-mlir-venv
1623
source torch-mlir-venv/bin/activate
17-
python -m pip install --upgrade pip wheel
24+
uv pip install --upgrade pip wheel
1825

1926
# GPU support ("AMD", "NVIDIA", "Intel")
2027
EXTRA_INDEX_URL=""
@@ -34,15 +41,15 @@ else
3441
fi
3542

3643
echo "Installing torch and models"
37-
pip3 install --pre torch torchvision torchrec transformers $EXTRA_INDEX_URL
44+
uv pip install --pre torch torchvision torchrec transformers $EXTRA_INDEX_URL
3845
if [ $? != 0 ]; then
3946
exit 1
4047
fi
4148

4249

4350
echo "Installing torch-mlir"
4451
# This only seems to work on Ubuntu
45-
pip3 install --pre torch-mlir \
52+
uv pip install --pre torch-mlir \
4653
--extra-index-url https://download.pytorch.org/whl/nightly/cpu \
4754
-f https://github.com/llvm/torch-mlir-release/releases/expanded_assets/dev-wheels
4855
if [ $? != 0 ]; then

0 commit comments

Comments
 (0)