Testing PyTorch XLA with Google Colab TPUs
If you are not aware, PyTorch XLA project is an effort to run PyTorch on TPU (Tensor Processing Unit) architecture which offers even higher performance in training Deep Learning models compared to GPU’s.
In my previous post I showed you how to use serveo.net to SSH into your Google Colab provided container.
In this short post I will show you how to use the same principle to connect to provided free TPUs. Beware that PyTorch XLA is in its inception phase and you may run into bugs.
Open a Colab notebook and set it up (Runtime -> Runtime Type -> Select Python 3 and TPU)
Create a code cell and paste the following:
import os tpu_addr = os.environ['COLAB_TPU_ADDR'] print('Local TPU address', tpu_addr) import random, string, getpass password = ''.join(random.choice(string.ascii_letters + string.digits) for i in range(20)) alias = ''.join(random.choice(string.ascii_letters +
Continue reading →