Skip to content

Commit

Permalink
install torch torch_xla prerelease 2.1 wheel
Browse files Browse the repository at this point in the history
  • Loading branch information
ManfeiBai committed Aug 31, 2023
1 parent 6b57410 commit 194e3a6
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 33 deletions.
22 changes: 14 additions & 8 deletions tests/pytorch/r2.1/common.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,13 @@ local volumes = import 'templates/volumes.libsonnet';
sudo apt install -y libopenblas-base
# for huggingface tests
sudo apt install -y libsndfile-dev
pip install --user \
https://storage.googleapis.com/pytorch-xla-releases/wheels/tpuvm/torch-2.1-cp310-cp310-linux_x86_64.whl \
'torch_xla[tpuvm] @ https://storage.googleapis.com/pytorch-xla-releases/wheels/tpuvm/torch_xla-2.1-cp310-cp310-linux_x86_64.whl'
pip3 install --user --pre --no-deps torchvision --extra-index-url https://download.pytorch.org/whl/nightly/cpu
# TODO change back to torch2.1 once pytorch released torch2.1
# pip install --user \
# https://storage.googleapis.com/pytorch-xla-releases/wheels/tpuvm/torch-2.1-cp310-cp310-linux_x86_64.whl \
# 'torch_xla[tpuvm] @ https://storage.googleapis.com/pytorch-xla-releases/wheels/tpuvm/torch_xla-2.1-cp310-cp310-linux_x86_64.whl'
pip3 install --user --pre --no-deps torch torchvision --extra-index-url https://download.pytorch.org/whl/nightly/cpu
pip3 install https://storage.googleapis.com/pytorch-xla-releases/wheels/tpuvm/torch_xla-nightly%2B20230825-cp310-cp310-linux_x86_64.whl
pip install torch_xla[tpuvm]
pip3 install pillow
git clone --depth=1 -b release/2.1 https://github.com/pytorch/pytorch.git
cd pytorch
Expand Down Expand Up @@ -129,10 +132,13 @@ local volumes = import 'templates/volumes.libsonnet';
sudo apt install -y libopenblas-base
# for huggingface tests
sudo apt install -y libsndfile-dev
pip install --user \
https://storage.googleapis.com/pytorch-xla-releases/wheels/xrt/tpuvm/torch-2.1-cp310-cp310-linux_x86_64.whl \
'torch_xla[tpuvm] @ https://storage.googleapis.com/pytorch-xla-releases/wheels/xrt/tpuvm/torch_xla-2.1-cp310-cp310-linux_x86_64.whl'
pip3 install --user --pre --no-deps torchvision --extra-index-url https://download.pytorch.org/whl/nightly/cpu
# TODO change back to torch2.1 once pytorch released torch2.1
# pip install --user \
# https://storage.googleapis.com/pytorch-xla-releases/wheels/tpuvm/torch-2.1-cp310-cp310-linux_x86_64.whl \
# 'torch_xla[tpuvm] @ https://storage.googleapis.com/pytorch-xla-releases/wheels/tpuvm/torch_xla-2.1-cp310-cp310-linux_x86_64.whl'
pip3 install --user --pre --no-deps torch torchvision --extra-index-url https://download.pytorch.org/whl/nightly/cpu
pip3 install https://storage.googleapis.com/pytorch-xla-releases/wheels/tpuvm/torch_xla-nightly%2B20230825-cp310-cp310-linux_x86_64.whl
pip install torch_xla[tpuvm]
pip3 install pillow
git clone --depth=1 -b release/2.1 https://github.com/pytorch/pytorch.git
cd pytorch
Expand Down
14 changes: 0 additions & 14 deletions tests/pytorch/r2.1/hf-mae.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -122,18 +122,6 @@ local utils = import 'templates/utils.libsonnet';
},
},
},
// TODO: Remove after 2.1 release cut
local xrt = self.xrt,
xrt:: common.XrtTpuVmMixin {
tpuSettings+: {
tpuVmExports+: |||
export XLA_USE_BF16=$(XLA_USE_BF16)
|||,
tpuVmExtraSetup: |||
echo 'export XLA_USE_BF16=1' >> ~/.bash_profile
|||,
},
},
local v2_8 = self.v2_8,
v2_8:: {
accelerator: tpus.v2_8,
Expand All @@ -147,7 +135,5 @@ local utils = import 'templates/utils.libsonnet';
accelerator: tpus.v4_8,
},
configs: [
hf_mae + v3_8 + hf_vit_mae + timeouts.Hours(2) + xrt,
hf_mae + v4_8 + hf_vit_mae + timeouts.Hours(2) + xrt,
],
}
20 changes: 14 additions & 6 deletions tests/pytorch/r2.1/llama2-model.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,13 @@ local utils = import 'templates/utils.libsonnet';
pip3 install numpy
sudo apt-get install numactl -y
sudo apt-get install libopenblas-dev -y
pip3 install https://storage.googleapis.com/pytorch-xla-releases/wheels/tpuvm/torch-nightly-cp310-cp310-linux_x86_64.whl
pip3 install https://storage.googleapis.com/pytorch-xla-releases/wheels/tpuvm/torch_xla-nightly-cp310-cp310-linux_x86_64.whl
pip3 install torch_xla[tpuvm]
# TODO change back to torch2.1 once pytorch released torch2.1 from current used pre-release wheel
# pip3 install https://storage.googleapis.com/pytorch-xla-releases/wheels/tpuvm/torch-nightly-cp310-cp310-linux_x86_64.whl
# pip3 install https://storage.googleapis.com/pytorch-xla-releases/wheels/tpuvm/torch_xla-nightly-cp310-cp310-linux_x86_64.whl
# pip3 install torch_xla[tpuvm]
pip3 install --user --pre --no-deps torch torchvision --extra-index-url https://download.pytorch.org/whl/nightly/cpu
pip3 install https://storage.googleapis.com/pytorch-xla-releases/wheels/tpuvm/torch_xla-nightly%2B20230825-cp310-cp310-linux_x86_64.whl
pip install torch_xla[tpuvm]
# install tokenizer model
wget https://storage.googleapis.com/tpu-pytorch/lsiyuan-experiment/llama/spiece.model
Expand Down Expand Up @@ -107,9 +111,13 @@ local utils = import 'templates/utils.libsonnet';
pip3 install numpy
sudo apt-get install numactl -y
sudo apt-get install libopenblas-dev -y
pip3 install https://storage.googleapis.com/pytorch-xla-releases/wheels/tpuvm/torch-nightly-cp310-cp310-linux_x86_64.whl
pip3 install https://storage.googleapis.com/pytorch-xla-releases/wheels/tpuvm/torch_xla-nightly-cp310-cp310-linux_x86_64.whl
pip3 install torch_xla[tpuvm]
# TODO change back to torch2.1 once pytorch released torch2.1
# pip3 install https://storage.googleapis.com/pytorch-xla-releases/wheels/tpuvm/torch-nightly-cp310-cp310-linux_x86_64.whl
# pip3 install https://storage.googleapis.com/pytorch-xla-releases/wheels/tpuvm/torch_xla-nightly-cp310-cp310-linux_x86_64.whl
# pip3 install torch_xla[tpuvm]
pip3 install --user --pre --no-deps torch torchvision --extra-index-url https://download.pytorch.org/whl/nightly/cpu
pip3 install https://storage.googleapis.com/pytorch-xla-releases/wheels/tpuvm/torch_xla-nightly%2B20230825-cp310-cp310-linux_x86_64.whl
pip install torch_xla[tpuvm]
# install tokenizer model
wget https://storage.googleapis.com/tpu-pytorch/lsiyuan-experiment/llama/spiece.model
Expand Down
14 changes: 9 additions & 5 deletions tests/pytorch/r2.1/sd-model.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,15 @@ local utils = import 'templates/utils.libsonnet';
# mv quantize.py ~/.local/lib/python3.8/site-packages/taming/modules/vqvae/
# taming-transformers and CLIP override existing torch and torchvision so we need to reinstall
pip uninstall -y torch torchvision
pip install --user \
https://storage.googleapis.com/pytorch-xla-releases/wheels/xrt/tpuvm/torch-nightly-cp310-cp310-linux_x86_64.whl \
'torch_xla[tpuvm] @ https://storage.googleapis.com/pytorch-xla-releases/wheels/xrt/tpuvm/torch_xla-nightly-cp310-cp310-linux_x86_64.whl'
pip3 install --user --pre --no-deps torchvision --extra-index-url https://download.pytorch.org/whl/nightly/cpu
# TODO change back to torch2.1 once pytorch released torch2.1
# pip uninstall -y torch torchvision
# pip install --user \
# https://storage.googleapis.com/pytorch-xla-releases/wheels/xrt/tpuvm/torch-nightly-cp310-cp310-linux_x86_64.whl \
# 'torch_xla[tpuvm] @ https://storage.googleapis.com/pytorch-xla-releases/wheels/xrt/tpuvm/torch_xla-nightly-cp310-cp310-linux_x86_64.whl'
# pip3 install --user --pre --no-deps torchvision --extra-index-url https://download.pytorch.org/whl/nightly/cpu
pip3 install --user --pre --no-deps torch torchvision --extra-index-url https://download.pytorch.org/whl/nightly/cpu
pip3 install https://storage.googleapis.com/pytorch-xla-releases/wheels/tpuvm/torch_xla-nightly%2B20230825-cp310-cp310-linux_x86_64.whl
pip install torch_xla[tpuvm]
# Setup data
wget -nv https://s3.amazonaws.com/fast-ai-imageclas/imagenette2.tgz
Expand Down

0 comments on commit 194e3a6

Please sign in to comment.