Back to paths

Why TPUs? Cloud TPUs & the TPU VM

Why AI needs purpose-built accelerators, what a Cloud TPU actually is (an ML ASIC you reach through a host VM), and how single chips ladder up into Pods.

beginner~11 min#ml-systems#hardware#accelerators
100Foundational TPU architecture & provisioningLesson 1 of 8Show

The one-line summary

A TPU is a chip Google built to do one thing fast: the matrix math at the heart of neural networks. You never touch the chip directly — you SSH into a host VM that's wired to it, run your JAX or PyTorch code there, and it dispatches the heavy work to the TPU.

Why build special hardware at all?

Modern AI — both training and inference — is dominated by matrix multiply at enormous scale. A general-purpose CPU spends most of its time shuttling operands in and out of memory rather than computing (the memory wall). GPUs help, but Google went further and built an tuned for exactly this workload. The payoff is more matmul throughput per watt and per dollar — which, at the scale of a flagship model, is the whole game.

You'll see how it wins in the next topic (the systolic array). Here, the goal is the mental model: what a TPU is, and how you reach it.

What a TPU is

A TPU is an — an application-specific integrated circuit — purpose-built for ML, so it cannot run general-purpose code. Its compute core is the :

  • the (a systolic array — 128×128, so 16,384 multiply-accumulates per cycle; bf16 in, fp32 out) where matmuls run,
  • a for activations, softmax, and elementwise math, and
  • a scalar unit for control flow and addressing.

Memory is , and chips talk to their neighbours over . Use the interactive cutaway below to click each part and read what it does — you'll come back to it in the exercises:

Simulation: tpu-vm-anatomy

How you actually use one: the TPU VM

You don't rent a bare chip — you get a Linux host VM physically attached to the chips (on the 8th gen, an Arm-based Axion CPU, to keep data prep from bottlenecking the accelerator). You with root access, install JAX or PyTorch-XLA, and run your program. It launches onto the TPU over PCIe and the compute stays on-chip — there is no per-operation network hop to the accelerator, because the host is the accelerator's host. (That's why later orchestration is about scheduling these host+chip units, not about a remote API.)

From one chip to tens of thousands

A TPU's power comes from ganging chips together. The ladder:

  • Chip — one or more TensorCores plus HBM.
  • Host — the VM you SSH into; it drives the chips attached to it.
  • Slice — a block of chips wired by .
  • Pod — a contiguous set of chips on one ICI network (a torus — 3D on training chips such as v4/v5p, 2D on v5e/v6e — or a Boardfly topology for inference).
  • — multiple slices joined over the slower Data-Center Network (DCN) for jobs bigger than one Pod.
The scale ladder: chip → host → slice → pod → Multislice. Cyan is ICI (inside a pod); amber is the slower DCN (only between pods) — the boundary the topology topic makes concrete.

Almost everything later in this path is about climbing this ladder efficiently — the topology topic makes the Pod concrete.

See it in a real data center

The ladder above is the abstraction; this is the physical reality. Google's own walkthrough shows the TPU system that surrounds the chip — the data-center networking, the optical circuit switches and liquid cooling you'll meet in the evolution and topology topics, and even the biometric security of the buildings where it all runs.

Which TPU, and when

The 8th generation makes this topic's point loudest: it splits the chip by workload into two parts you choose between.

  • TPU 8t — training. Keeps (for embeddings) plus an LLM decoder engine (silicon that accelerates token-by-token generation), on a 3D-torus network, with native FP4 (4-bit float) that doubles MXU throughput; built for pre-training at superpod scale.
  • TPU 8i — inference. Swaps the SparseCores for a (≈5× lower on-chip collective latency), carries 3× the on-chip SRAM (384 MB) to hold the — the per-token attention buffer that grows with sequence length — and uses the Boardfly network (≈7 hops across 1,024 chips vs 16 on a torus).

The same training-vs-inference logic runs back through the lineage: v5e / v6e (Trillium) for cost-efficient inference, v5p / v7 (Ironwood) for training (the MXU grew to 256×256 with Trillium, v6e). accelerates the giant embedding lookups — table reads that map each token ID to its dense vector, a gather pattern — in recommendation/ranking and MoE routing. The takeaway isn't the part numbers — it's that the box is tailored to the workload, which is why you reason about training vs serving from the silicon up.

Why this matters

This is the picture the whole path builds on: how the chip computes (the systolic array), how chips scale (ICI, the torus, Pods), and how you feed and operate them (the VM, orchestration, sharding). Keep the anatomy above in mind — every later topic zooms into one part of it.

Put it together

Steps
  1. Find where matmuls run

    In the anatomy sim, click the MXU and confirm that's where matrix multiplies happen — and that HBM is what keeps it fed.

  2. Trace your code's path

    Click Host, then PCIe, then the chip. Explain in one sentence why there's no network hop between your program and the accelerator.

  3. Pick a generation

    Say whether you'd reach for a TPU 8i or a TPU 8t to (a) serve a Gemma model and (b) pre-train a new LLM — and name the one silicon difference that decides it.

Suggested videos

Show 1 videoHide videos

Review

Flashcards1 / 7

TPU

Check yourself

Quick exam1 / 4 · 0 correct

What kind of processor is a TPU?

Go deeper

Your notes on this lesson