Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 5196134

Browse files
committedJan 15, 2025·
Improve build_developer.sh
- Remove existing torch and torch_xla installations. When these packages are installed from PyPI, it looks like `python setup.py` can't overwrite them in all cases. - Remove old wheels. - Install pallas specific dependencies.
1 parent 14acab7 commit 5196134

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed
 

‎scripts/build_developer.sh

+13
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ set -x # Display commands being run.
77
cd "$(dirname "$(readlink -f "$0")")"
88
cd ../../
99

10+
# First remove any left over old wheels
11+
# and old installation
12+
pip uninstall torch -y
13+
rm dist/*
14+
15+
# Install pytorch
1016
python3 setup.py bdist_wheel
1117
python3 setup.py install
1218
cd ..
@@ -17,8 +23,10 @@ if [ -d "vision" ]; then
1723
python3 setup.py develop
1824
fi
1925

26+
# Install torch_xla
2027
cd ..
2128
cd pytorch/xla
29+
pip uninstall torch_xla -y
2230
python3 setup.py develop
2331

2432
# libtpu is needed to talk to the TPUs. If TPUs are not present,
@@ -27,6 +35,11 @@ pip install torch_xla[tpu] \
2735
-f https://storage.googleapis.com/libtpu-wheels/index.html \
2836
-f https://storage.googleapis.com/libtpu-releases/index.html
2937

38+
# Install Pallas dependencies
39+
pip install torch_xla[pallas] \
40+
-f https://storage.googleapis.com/jax-releases/jax_nightly_releases.html \
41+
-f https://storage.googleapis.com/jax-releases/jaxlib_nightly_releases.html
42+
3043
# Test that the library is installed correctly.
3144
python3 -c 'import torch_xla as xla; print(xla.device())'
3245

0 commit comments

Comments
 (0)
Please sign in to comment.