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.
100Foundational TPU architecture & provisioningLesson 8 of 8ShowHide
Chapter 1 of 2 in TPU Training Infrastructure
- Provisioning & the TPU VMYou're here
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.
| Mode | Max run time | Preemptible? | vs on-demand | Best for |
|---|---|---|---|---|
| On-demand | unbounded | No | full price | a small slice you need now, no commitment |
| Reservation | 1–3 yr (CUD) | No | 30–55% off | long runs that need a guarantee |
| Spot | until preempted | Yes | ~60–90% off | cheap, fault-tolerant jobs that checkpoint often |
| DWS · Flex Start | ≤ 7 days | No (once started) | up to ~53% off | bursty work, flexible start — queued |
| DWS · Calendar | 1–90 days | No | up to 30% off | a 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:
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
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?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.
Avoid the trap
A teammate says "open the ICI firewall so the hosts can talk." Correct them in one sentence.
Review
How you run a multi-host TPU job
Check yourself
You want a low-cost slice for a short, bursty experiment and don't want it preempted mid-run. Which capacity mode?