Course · TPU Setup: Provisioning & Runtime VerificationPhase 19 · Study guide

Can you provision a Cloud TPU VM, verify that JAX actually executes on its chips, and prove clean teardown?

Cloud TPU Mini-Course · Step 1 of 3Cloud TPU VM + CPU verifierBite-sized · 2 lessons (~45m)

Revision v0.18.1 ·

Choosing an accelerator begins with a workload and a per-device capacity calculation. Aggregate HBM can look sufficient while a replicated parameter or optimizer array still exceeds the memory available to one device. Work through the placement and headroom assumptions before creating a resource. Then compare the requested runtime with the observed backend and topology. A numerical check answers whether the tested arithmetic agrees; the receipt answers which environment ran it. Keep the named creation route and its matching cleanup steps together so the experiment has a clear beginning and end.

Preparation: Setup & first steps

Runtime: CPU topology/contract verifier; Cloud TPU VM (v5litepod-4 / v6e-4) or Colab TPU for target runs

Check your starting point

You created a Cloud TPU VM and gcloud says READY. What still has to happen before you trust a JAX run on it?

Compare your reasoning

Bootstrap ~/jax-tpu-lab/.venv with jax[tpu], verify inside Python that jax.default_backend() == 'tpu' and jax.device_count() matches your slice, and run a synchronized pmap reduction receipt.

If this is unfamiliar, work through Select a TPU slice and provision your Cloud TPU VM before attempting the project.

Build in stages

1. Select a single-host TPU topology and provision the VM

Identify the requested API and machine type independently from observed JAX devices/processes. Calculate the 48 GiB replicated and ideal-sharded state ledger on four 16 GiB chips, include the 80% budget and assumed activation cost, and explain why aggregate capacity is insufficient. Keep the named resource create/describe/cleanup log.

2. Bootstrap .venv and verify the runtime contract receipt

Install the pinned runtime, run build_runtime_receipt(), compare arithmetic_ok with the local closed-form oracle, and inspect expected backend/count flags and requested_target_ready. Calculate separate 4-/8-device expectations. The target-only TPU_REQUIRE_TARGET path must reject CPU, wrong count or missing saved-source identity. Retrieve the receipt and identify its digest as an integrity field, not a signature.

Try a changed condition

Make a prediction before opening the reasoning. Keep your answer and the evidence you would collect.

Your runtime receipt reports four local devices. Is that always four physical chips, and does it establish a production-model run?

Compare an approach

No. The mapping depends on generation and topology; TPU7x exposes chiplets as devices. Record machine type and device kinds with a synchronized numerical check. A small runtime receipt qualifies only its tested work, and the named control-plane resources still need explicit cleanup.

Diagnose a likely failure

Symptom: You closed your SSH terminal after finishing a run, assuming the Cloud TPU VM stopped billing.

Check next: Use the cleanup command for the route that created the named resource. A queued resource must be deleted through its owning route. Confirm those exact resource names are absent; leave unrelated project resources alone.

Decide what is ready

Keep the per-device ledger, requested-versus-observed runtime/source/environment identity, synchronized arithmetic and fail-closed target checks. Record absence of the exact named owned VM and queued resource after route-specific cleanup; a project-wide empty list is not required.

Where to put your project code

Write your code in: projects/tpu-runtime-audit/starter/model.py (copy projects/tpu-runtime-audit/starter/model.py first: cp projects/tpu-runtime-audit/starter/model.py projects/tpu-runtime-audit/starter/model.py).

Verify your implementation: python3 projects/tpu-runtime-audit/tests/check.py --stage all --impl projects/tpu-runtime-audit/starter/model.py

Run the staged project checks on your implementation in projects/tpu-runtime-audit/starter/model.py and record your transfer experiment results in your portfolio.

Open Inspect CPU device inventory, BF16 storage, and collective participant arithmetic

Open Operate and recover a local JAX workload

What still needs further work

Continue immediately to Phase 20 (TPU Workflows: Launching Jobs & Checkpointed Experiments) to stage code and run resumable training loops.