Before you start: words you need#
| Word | Plain meaning |
|---|---|
| TPU | Tensor Processing Unit: Google’s own AI chip, rented through Google Cloud. |
| MXU | Matrix multiply unit: the large block inside a TPU that does matrix maths. |
| Systolic array | A grid of multiply-add cells through which data flows in step, like blood pumped by a heart (“systole”). |
| Torus | A network where each chip connects to its neighbours and the edges wrap around, like a doughnut. |
| Optical circuit switch (OCS) | A switch that uses tiny mirrors to redirect beams of light between fibres. |
| Pod | The largest group of TPUs that can run one program together. |
| XLA | Google’s compiler that turns a whole model into code for TPUs (and GPUs). |
1. What is it?#
A GPU is thousands of small programmable cores that happen to have matrix units. A TPU is the opposite: a few very large matrix units (MXUs) with just enough programmable logic around them to keep them fed. Each MXU is a systolic array, a grid of multiply-accumulate cells through which data pulses in lock-step, so each value fetched from memory is reused hundreds of times without touching a register file or cache.
TPUs are also networked differently. Instead of switches, chips connect directly to their neighbours in a 3D torus, 64 chips to a rack-sized cube, and optical circuit switches join cubes into pods that the XLA compiler programs as one machine. The current generation, Ironwood (TPU7x), forms 9,216-chip pods. The eighth generation, announced in April 2026, splits into two chips: TPU 8t for training and TPU 8i for inference.
Facts checked on 11 November 2026.
2. Why does it matter?#
- A large share of the world’s AI inference runs on TPUs: Google’s own Gemini traffic, and customers such as Anthropic (which announced access to up to a million TPU chips) and Apple.
- TPUs are the clearest example of a design built for one job, and the clearest proof that the physics of Module 2 applies everywhere: a TPU is just as memory-bound at small batch as a GPU.
- vLLM gained an official TPU backend (vLLM TorchTPU) in October 2026, so open models can be served on TPUs with the same engine as on GPUs.
3. Simple analogy#
A systolic array is a bucket brigade. Instead of every worker running to the well (memory) for each bucket, buckets pass hand to hand along the line, and every worker does a little work on each one. Very efficient — but only if there is a steady stream of buckets. With one bucket, almost everyone in the line stands idle.
4. Tiny example#
A 256 × 256 MXU needs about 2 × 256 = 512 clocks to fill and drain. Multiply a matrix by one row of input (one decode token at batch 1): about 1 clock of useful work in 512, so 0.2% of the cells are busy. With 1,024 rows (a long prompt in prefill): 1,024 useful clocks out of 1,535, about 67%. Same chip, same maths, a 300x difference in efficiency — set entirely by batch size.
5. Technical explanation#
The systolic array#
An MXU on recent TPUs is a 256 × 256 grid of cells. For a matrix multiply Y = X · W:
- A 256 × 256 tile of weights is loaded into the cells, one weight per cell.
- Activations enter from the left edge, skewed by one clock per row, and move one cell right per clock.
- Each cell multiplies the activation passing through by its weight, adds the partial sum arriving from the cell above, and passes the new sum down.
- Finished dot products leave the bottom edge, one column per clock.
Every weight is fetched once and used for every row of X; every activation is fetched once and
used by 256 cells. No cell reads a register file or a cache. That is where TPUs get their energy
efficiency — and why they need large batches to fill.
Around the MXUs#
- Vector unit: elementwise work (activations, normalisation, softmax).
- Scalar unit: control flow and address generation; very long instruction words drive all units at once.
- VMEM: software-managed on-chip memory; the compiler decides what lives there.
- SparseCores (since v4): small dataflow cores for embedding lookups, the scattered, memory-bound part of recommendation models.
- HBM: 192 GB of HBM3e at 7.37 TB/s on Ironwood.
- ICI (inter-chip interconnect): direct links to neighbours, about 1.2 TB/s per chip.
Ironwood is Google’s first TPU with two compute dies in one package, each with its own TensorCore, SparseCores and HBM, joined by a die-to-die link.
Torus, cubes and optics#
A torus wires each chip to its neighbours in each dimension and wraps the edges around, so a 4 × 4 × 4 cube has no edge chips: each chip has exactly six links. There are no switch chips at all, which saves cost and power. The trade is hops: two far-apart chips are several hops away, whereas an NVL72’s switches make every pair one hop (7.d).
Between cubes, optical circuit switches use MEMS mirrors to steer light from any input fibre to any output fibre. They do not read packets, so they add almost no latency or power, and re-pointing them changes the pod’s shape in seconds: a job gets a torus of exactly the size it asked for, and a failed rack can be routed around. An Ironwood pod is 144 cubes: 9,216 chips with 1.77 PB of HBM.
The generations#
| Generation | Year | Notes |
|---|---|---|
| v1 | 2015 | Inference only, INT8, DDR3 memory |
| v2, v3 | 2017–18 | Training, HBM, bfloat16 (Google invented it); v3 liquid-cooled |
| v4 | 2021 | Optical circuit switches, SparseCores, 4,096-chip pods |
| v5e / v5p | 2023 | Cost-efficient and performance variants |
| v6e Trillium | 2024 | 256 × 256 MXUs, 4.7x v5e per chip |
| v7 Ironwood (TPU7x) | 2025 | Two dies, FP8, 192 GB HBM3e, 9,216-chip pods; Google’s first TPU described as built for inference |
| TPU 8t | announced April 2026 | Training: 12.6 PF FP4, 216 GB HBM, 128 MB SRAM per chip; superpods of 9,600 chips (~121 EF FP4, Google’s figure); TSMC N3 |
| TPU 8i | announced April 2026 | Inference: 10.1 PF FP4, 288 GB HBM, 384 MB SRAM per chip; pods of 1,152 chips; TSMC N3 |
Google said both eighth-generation chips reach general availability later in 2026; check Google Cloud for regions and pricing. The split is the news: Google concluded that training and inference want different chips — the same conclusion that led NVIDIA to add LPX racks for decode (7.e). The 8i’s large SRAM keeps more of the working set on chip, attacking the decode bandwidth wall.
Software#
TPUs are programmed through XLA, which takes a whole computation graph and fuses, tiles and schedules it for the MXUs and the torus. JAX is the native front end; PyTorch runs through PyTorch/XLA; Pallas is the kernel language; vLLM TorchTPU and JetStream serve models. XLA’s sharding annotations let one program span a whole pod: the collectives over ICI are generated for you.
6. Under the hood#
A clock-by-clock model of a weight-stationary systolic array. It checks the answer against an ordinary matrix multiply, then measures how full a 256 × 256 array is at different batch sizes.
// systolic.go — a weight-stationary systolic array, clock by clock.
package main
import "fmt"
// run multiplies X (B×n) by W (n×n) on an n×n array; returns Y and the clocks taken.
func run(X, W [][]float64) ([][]float64, int) {
B, n := len(X), len(W)
xreg := make([][]float64, n) // activation held in each cell, moving right
preg := make([][]float64, n) // partial sum held in each cell, moving down
for i := range xreg {
xreg[i], preg[i] = make([]float64, n), make([]float64, n)
}
Y := make([][]float64, B)
for i := range Y {
Y[i] = make([]float64, n)
}
clocks := B + 2*n - 1
for t := 0; t < clocks; t++ {
nx, np := make([][]float64, n), make([][]float64, n)
for k := 0; k < n; k++ {
nx[k], np[k] = make([]float64, n), make([]float64, n)
for j := 0; j < n; j++ {
var xin, pin float64
if j == 0 { // left edge: row k gets X[b][k], skewed by k clocks
if b := t - k; b >= 0 && b < B {
xin = X[b][k]
}
} else {
xin = xreg[k][j-1]
}
if k > 0 {
pin = preg[k-1][j]
}
nx[k][j] = xin
np[k][j] = pin + xin*W[k][j]
}
}
xreg, preg = nx, np
// the bottom row holds Y[b][j] at clock b + j + n - 1
for j := 0; j < n; j++ {
if b := t - j - (n - 1); b >= 0 && b < B {
Y[b][j] = preg[n-1][j]
}
}
}
return Y, clocks
}
func main() {
n, B := 4, 3
X, W := make([][]float64, B), make([][]float64, n)
for b := range X {
X[b] = make([]float64, n)
for k := range X[b] {
X[b][k] = float64(b + k + 1)
}
}
for k := range W {
W[k] = make([]float64, n)
for j := range W[k] {
W[k][j] = float64((k*n+j)%5) - 2
}
}
Y, clocks := run(X, W)
ok := true
for b := 0; b < B; b++ {
for j := 0; j < n; j++ {
want := 0.0
for k := 0; k < n; k++ {
want += X[b][k] * W[k][j]
}
ok = ok && want == Y[b][j]
}
}
fmt.Printf("4x4 array, batch 3: correct=%v in %d clocks; Y[0] = %v\n\n", ok, clocks, Y[0])
fmt.Println("256x256 MXU batch clocks cells busy")
for _, batch := range []int{1, 8, 64, 256, 1024, 8192} {
c := batch + 2*256 - 1
fmt.Printf("%14d %8d %10.1f%%\n", batch, c, 100*float64(batch)/float64(c))
}
}Output:
4x4 array, batch 3: correct=true in 10 clocks; Y[0] = [5 5 0 -10]
256x256 MXU batch clocks cells busy
1 512 0.2%
8 519 1.5%
64 575 11.1%
256 767 33.4%
1024 1535 66.7%
8192 8703 94.1%The small run proves the dataflow computes a real matrix product. The table is the important part. Real MXUs overlap one tile’s drain with the next tile’s fill, so steady-state use is better than this one-shot table, but the core fact holds: each weight loaded into the array is used once per row of the batch. Compilers therefore fold sequence length and batch into the rows (prefill and training have plenty), and decode at small batch is where TPUs, like GPUs, are limited by memory instead.
7. Performance implications#
- Prefill and training: large row counts fill the MXUs; TPUs are very efficient.
- Decode at small batch: memory-bound, exactly like GPUs (2.e). Ironwood’s 7.37 TB/s HBM, not its MXUs, sets the per-user speed; TPU 8i’s 384 MB SRAM targets this.
- Collectives: the torus is excellent for all-reduce (data and tensor parallelism) and less ideal for the irregular all-to-all of expert parallelism, which crosses many hops (9.f, 14.e).
8. Production implications#
- Access: TPUs are available through Google Cloud (and, announced, through Oracle Cloud from 2027), not for purchase. Capacity is reserved by slice size.
- Software choice: JAX-native teams get the most from TPUs; PyTorch teams use PyTorch/XLA or vLLM TorchTPU. Check that your model and quantization format are supported.
- Debugging: XLA compiles the whole graph, so performance problems show up as compiler decisions; learn the profiler (XProf) before committing.
- Lock-in: TPU-only code paths tie you to one cloud; vLLM support reduces this for serving.
9. Common mistakes#
- Expecting TPUs to be efficient at batch 1. No systolic array is.
- Comparing pod sizes across generations without units. Ironwood pods are 9,216 chips; TPU 8i pods are 1,152 larger chips; TPU 8t superpods are 9,600 chips.
- Treating the torus like a switched fabric. Hop count matters for all-to-all.
- Porting PyTorch code and expecting GPU-like eager performance. TPUs want compiled graphs.
10. Hands-on exercise#
- Run
systolic.go. Change the array to 8 × 8 and the batch to 1. How many clocks does one matrix-vector product take, and what fraction of cells did useful work? - In a 4 × 4 × 4 torus, what is the largest number of hops between two chips? Without the wrap-around links?
- Why does a torus suit the all-reduce of data-parallel training better than the all-to-all of expert parallelism?
11. Interview questions#
- In a weight-stationary array, what moves and what stays still?
- Why does a systolic array waste most of its cells at batch 1?
- What does an optical circuit switch do, and what does it not do?
- Name one advantage and one cost of a torus compared with a switched NVLink domain.
- Why did Google split its eighth generation into a training chip and an inference chip?
12. Further reading#
Checked on 11 November 2026.
- Google Cloud documentation: TPU7x (Ironwood)
- Google: our eighth-generation TPUs, two chips for the agentic era
- Google unveils TPU 8t and 8i (DCD)
- Inside Google’s TPU 8 strategy (Tom’s Hardware)
- Google Ironwood at Hot Chips 2025 (ServeTheHome)
- TPU v4: an optically reconfigurable supercomputer (Jouppi et al., ISCA 2023)
- vLLM TorchTPU roadmap