Skip to content

Instantly share code, notes, and snippets.

@princefr
Last active November 1, 2019 19:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save princefr/1ac08507f1937ca8c6a54ed928d4d684 to your computer and use it in GitHub Desktop.
Save princefr/1ac08507f1937ca8c6a54ed928d4d684 to your computer and use it in GitHub Desktop.
CTPU engines with PyTorch
gcloud config set compute/zone us-central1-f # change the compute zone.
ctpu up --tpu-size=v3-8 --machine-type n1-standard-8 # create a tpu v3 machine + 8 nodes
tpu succesfully created ?
connect to gcloud vm instance, if you don't have one create one
docker pull gcr.io/tpu-pytorch/xla:r0.5 # pull pytorch xla into the vm
docker run -it --shm-size 16G gcr.io/tpu-pytorch/xla:r0.5
(pytorch) root@CONTAINERID:/$ export XRT_TPU_CONFIG="tpu_worker;0;$10.240.1.2:8470"
(pytorch) root@CONTAINERID:/$ python pytorch/xla/test/test_train_mnist.py
To launch the training
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment