Google TPUs documentation

First TPU Setup on Google Cloud

Hugging Face's logo
Join the Hugging Face community

and get access to the augmented documentation experience

to get started

First TPU Setup on Google Cloud

This guide walks you through setting up and accessing your first TPU instance on Google Cloud Platform (GCP).

Prerequisites

Before you begin, ensure you have:

  • A Google Cloud account
  • Billing enabled on your account
  • Basic familiarity with cloud consoles

Step 1: Enable TPU Access

  1. Navigate to the TPU dashboard at: https://console.cloud.google.com/compute/tpus

    • Note: You will need to enable the TPU API if you haven’t already
    • A valid billing account must be linked to your project
  2. If prompted, enable the TPU API for your project

TPU Dashboard

Step 2: Create your TPU Instance

Click the “Create” button to setup your TPU instance.

TPU Setup

Region Selection

  1. Review available regions and zones for TPUs: https://cloud.google.com/tpu/docs/regions-zones
  2. For this example, we will use us-west-4a zone
    • Important: TPU availability may vary by region
    • Tips: Choose a region close to your primary usage location

TPU Configuration

  1. Select TPU type:
    • We will use a TPU v5e-8 (corresponds to a v5litepod8). This is a TPU node containing 8 v5e TPU chips
    • For detailed specifications about TPU types, refer to our TPU hardware types documentation
  2. Choose a runtime:
    • Select v2-alpha-tpuv5-lite runtime
    • This runtime is optimized for TPU v5e
      • More runtime information on runtime can be found in at recommended runtime for TPU section in our TPU hardware page

Step 3: Access Your TPU

After creation, your TPU instance should be accessible by ssh

  1. Access your TPU:

    • Click the SSH button in the console for immediate terminal access

    TPU SSH

  2. For permanent SSH access:

Next Steps

Now that you have a working TPU environment, you can start using it for AI workloads. We offer two main paths depending on your use case:

AI Inference and Training Tutorials

  1. Model Serving on TPU

  2. Model Training on TPU

Choose the tutorial that best matches your immediate needs: