1. Create Google cloud account if we don’t have one.
  2. Create a project.
  3. Create VM instance with a single CPU or GPU, OS, hard disk space, CPU memory, etc.
  4. Install tool (ctpu) on procured VM instance to create, manage and delete TPU instances. This step would require authorization which can be done using gcloud (comes installed by default in VM instances).
  5. Setup google cloud storage bucket.
  6. We can now use TPUs and store data in bucket. After using TPUs remember to release tpu instance, bucket storage (after saving output if needed), and VM instance
wget https://dl.google.com/cloud_tpu/ctpu/latest/linux/ctpu && chmod a+x ctpu
gcloud auth application-default login
ctpu up --tpu-onlyctpu statusctpu delete
ctpu up --name=$TPU_NAME --project=$PROJECT --zone=$ZONE --tpu-size=v3-8  --tpu-only   --tf-version=1.15.dev20190821 --noconf
gsutil mb gs://<your bucket name>gsutil cp <source> gs://<your bucket name>gsutil rm -r gs://<your bucket name>
gsutil config -b
ctpu delete gsutil rm -r gs://<your bucket name>

--

--

Machine learning practitioner

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store