Back to paths

Provisioning & the TPU VM

How you actually get TPUs and run on them — the TPU VM lifecycle, XPK → Kueue → DWS-Flex on GKE, single- vs multi-host slices, the DCN networking a multi-host job needs, and attaching storage.

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

Prerequisites: Why TPUs? Cloud TPUs & the TPU VM, Cloud TPU Architecture — how you consume TPUs


The one-line summary

Knowing what a TPU is (topic 1.1) isn't the same as getting one and running on it. In practice you submit a job with , which queues through and provisions GKE nodes; you land on a host VM attached to the chips; you attach storage; and — the part people get wrong — you configure the DCN networking the hosts need. At scale, capacity, not concepts, is the wall you hit.

How you actually run a job

You rarely hand-write Kubernetes for a multi-host slice. The real path is:

XPK → Kueue → GKE provisions DWS Flex-start nodes → host VM(s) ↔ chips.

You request a slice (say v6e-256); drives (quota, priority, gang-scheduling) which provisions the nodes; you get root on the host VM(s) physically attached to the chips, install JAX or PyTorch-XLA, and run.

The capacity wall

At scale you can't always get the chips — so you choose a capacity mode. Two things actually decide it: how long the job runs and whether it tolerates interruption — because Dynamic Workload Scheduler () has two modes, each capped by duration.

ModeMax run timePreemptible?vs on-demandBest for
On-demandunboundedNofull pricea small slice you need now, no commitment
Reservation1–3 yr (CUD)No30–55% offlong runs that need a guarantee
Spotuntil preemptedYes~60–90% offcheap, fault-tolerant jobs that checkpoint often
DWS · Flex Start≤ 7 daysNo (once started)up to ~53% offbursty work, flexible start — queued
DWS · Calendar1–90 daysNoup to 30% offa scheduled run, guaranteed start

So even Calendar is cheaper than on-demand — every mode but on-demand carries a discount (TPU reservation docs). The catch is Spot: its headline discount erodes once preemptions force restarts, which is what the orchestrator below makes visible.

Rule of thumb: can it restart cleanly? → Spot. Otherwise go by length — ≤ 7 days, flexible start → Flex Start; a fixed start date, ≤ 90 days → Calendar; longer → a Reservation; just a few chips right now → On-demand.

But the cheapest rate isn't always the cheapest run. Deploy the same job on Spot, then on Flex Start, and compare the total cost in the run history — once Spot's preemptions and restarts are paid for, and once Calendar's reserved window is billed whether the job uses it or not:

Simulation: capacity-orchestrator

The networking trap (DCN, not ICI)

A multi-host slice is several host VMs whose chips are wired by . But the host processes must rendezvous — and that traffic rides the (the VPC), not ICI.

Don't forget the disks

A slice with no fast storage just starves. Attach high-throughput storage — Hyperdisk ML, Filestore, or Managed Lustre — so the chips stay fed. That disk is exactly what your input pipeline (L200) will read from.

Put it together

Steps
  1. Read the shape

    In the selector, pick v6e-256. How many host VMs is that, and is it single- or multi-host? What networking does that imply?

  2. Choose a capacity mode

    For (a) a bursty 2-hour experiment and (b) a 3-week pre-training run, name the capacity mode you'd pick — and why.

  3. Avoid the trap

    A teammate says "open the ICI firewall so the hosts can talk." Correct them in one sentence.

Review

Flashcards1 / 5

How you run a multi-host TPU job

Check yourself

Quick exam1 / 3 · 0 correct

You want a low-cost slice for a short, bursty experiment and don't want it preempted mid-run. Which capacity mode?

Your notes on this lesson