Skip to content

Instantly share code, notes, and snippets.

@tenpercent
Created December 9, 2019 19:50
Show Gist options
  • Save tenpercent/84b1c3763f13c6eadc2414103bcfe992 to your computer and use it in GitHub Desktop.
Save tenpercent/84b1c3763f13c6eadc2414103bcfe992 to your computer and use it in GitHub Desktop.
Replace pytorch version provided by google colab with the one supporting TPU
TORCH_VER="20191208"
pip uninstall -y torch torchvision
rm -r wheels
mkdir -p wheels
for f in {torch,torch_xla,torchvision}; do
whl="${f}-nightly+${TORCH_VER}-cp36-cp36m-linux_x86_64.whl";
gsutil cp "gs://tpu-pytorch/wheels/${whl}" wheels/;
pip install "wheels/${whl}";
done
apt-get install -y libomp5
curl -vvv -d '{}' "http://$(echo $COLAB_TPU_ADDR | sed -Ee 's;[0-9]+$;8475;')/requestversion/XRT-dev${TORCH_VER}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment