Back to paths

OCS — Light Is the Network

A TPU pod doesn't rewire itself with cables or packet switches — it tilts microscopic mirrors and steers laser beams. How the Optical Circuit Switch turns mirror angles into topology, slices pods, heals around dead cubes, and reshapes the network per job.

intermediate~8 min#ml-systems#hardware#networking
100Foundational TPU architecture & provisioningLesson 5 of 8Show

Prerequisites: TPU Evolution — Chasing the Bottleneck, TPU Topologies — the two networks & the shapes


The one-line summary

You met the in the evolution story — V4's answer to pods too big for static copper. Here's the part that sounds like science fiction: a TPU pod rewires itself by tilting microscopic mirrors. The network is light, and topology is just the current mirror configuration.

Two views of the same photons

The explorer below shows both panes at once: on the left, the logical topology software sees; on the right, the Palomar OCS — a matrix of MEMS mirrors — that photons see. The same pulse is drawn in both. Walk the five operations:

Simulation: tpu-ocs-explorer
  1. Global ring — a photon leaves a cube face, bounces off one mirror, lands at the next cube. The switch never reads the data.
  2. Pod slicing — re-tilt the mirrors and one supercomputer becomes two. The slices share zero optical links: isolation enforced by physics, not QoS.
  3. Cross-rack jobs — logical neighbors ≠ physical neighbors. Any healthy cubes, anywhere on the floor, can be warped into a contiguous slice.
  4. Spare-cube repair — when a cube dies, drop 2 circuits, raise 2 to the hot spare: 4 mirror moves and the job keeps its torus shape.
  5. Topology shuffle — every press is a new network, born purely from mirror angles. Circuits are set per job, never per packet.

Keeping the beam locked: the two-color trick

A fair question: how does a tilted mirror reliably hit a fiber thousands of mirror-widths away — and hold it for a week-long job, through vibration and thermal drift? Apollo's answer is a second color. The data rides O-band signal light; alongside it, an 850 nm monitor beam is injected and read by a camera, merged and split by a dichroic mirror (one that reflects one wavelength and passes the other). The camera sees exactly where each beam lands, and a control loop nudges the MEMS mirrors back on target — closed-loop alignment. That servo is what makes an all-optical switch reliable enough to anchor a 4,096-chip pod with no packets to retransmit.

The two-color trick: O-band signal light (green) is steered between two fiber arrays by two 136-mirror MEMS arrays, while an 850 nm monitor beam (rose) — merged and split by dichroic mirrors and read by a camera — drives closed-loop alignment of those mirrors. — Recreated in house style; design after Google's Mission Apollo (2022).

Why the cube is the unit

Inside a 4×4×4 cube, all 64 chips are hard-wired electrically — that never changes. Only the cube's 48 optical in/out pairs rise to the OCS layer. So everything the OCS does — slicing, healing, reshaping — happens at cube granularity. (The explorer shows 8 of 64 cubes and 1 of 6 link dimensions; the real pod runs that picture six times in parallel, which is how it builds full — even twisted — 3D toruses.)

What it costs, what it buys

The entire OCS layer is under 5% of system cost and ~3% of power (per the TPU v4 paper) — and in exchange the pod gains slicing, fault-healing, and per-job topology. That's why the evolution lesson called OCS the only way to physically wire a 100×-pod: a static harness of this size would fail constantly; mirrors route around death in milliseconds.

Why this matters

Every idea later in the path leans on this: slices of arbitrary shape (topologies), schedulers that build them from whatever's healthy (provisioning), and Multislice jobs that treat pods as LEGO. Once you've seen that topology is software, none of those feel arbitrary.

Put it together

Steps
  1. Slice the pod

    Switch to pod slicing and explain in one sentence why Job A physically cannot slow down Job B — without mentioning QoS.

  2. Predict the repair

    Before pressing run the failure: how many mirrors must move to splice the spare in? Run it and check your prediction against the mirrors moved telemetry.

  3. Shuffle and reflect

    Press topology shuffle a few times. Why is "the network reconfigures in milliseconds" fast enough for training jobs but useless for packet switching?

Review

Flashcards1 / 5

What does an OCS actually switch?

Check yourself

Quick exam1 / 4 · 0 correct

To change which cube talks to which, what physically changes?

Go deeper

Your notes on this lesson