11.1 Choosing CPUs, GPUs & TPUs for Training

Key Takeaways

  • Google recommends CPUs for quick prototyping, simple models, and models with many custom C++ operations or I/O limits.
  • GPUs suit medium-to-large models with larger batch sizes and models with many custom PyTorch or JAX operations that must partly run on CPUs.
  • TPUs suit large matrix-heavy models with large batches, weeks-long training, and ultra-large embeddings, but not models with custom operations in the main training loop.
  • Code that runs on TPUs is compiled by the XLA compiler, and TPU v6e no longer supports TensorFlow.
  • Agent Platform serverless training supports NVIDIA GPUs from T4 and L4 through A100, H100, H200, B200, and GB200, plus TPU VMs.
Last updated: September 2026

Section 3.3 of the exam guide begins with evaluating compute and accelerator options (for example, CPU, GPU, and TPU). The right answer depends on model type, framework, custom operations, model and batch size, and how long training runs.

Google's Guidance: CPU vs. GPU vs. TPU

HardwareBest forNot ideal for
CPUQuick prototyping. Simple models that train fast. Small models with small batches. Models with many custom C++ operations. Workloads limited by I/O or host networking. Classical ML (scikit-learn, many XGBoost jobs)Large deep networks
GPUMedium-to-large deep learning models with larger batches. Models with many custom PyTorch or JAX operations that must run at least partly on CPUs. TensorFlow ops not available on TPUsTiny models, where host overhead dominates and GPUs sit idle
TPUModels dominated by matrix computations. No custom operations inside the main training loop. Training that runs weeks or months. Large models with large batches. Ultra-large embeddings in ranking and recommendationFrequent branching, many element-wise operations, high-precision arithmetic, custom ops in the training loop

Tensor Processing Units (TPUs) are Google-designed ASICs with on-chip high-bandwidth memory. They connect into slices that scale with little code change. TPU code is compiled by XLA (Accelerated Linear Algebra). JAX, PyTorch/XLA, and TensorFlow can target TPUs, and starting with TPU v6e, TensorFlow is no longer supported. On Agent Platform, TPU training runs on TPU VMs (for example, v2, v3, v5e, and v6e generations).

GPU Options on Agent Platform Training

GPUMemoryTypical training role
NVIDIA T416 GBLow-cost small models, experimentation
NVIDIA L424 GBCost-efficient small-to-medium models and fine-tuning small LLMs with parameter-efficient methods
NVIDIA A10040 GB or 80 GBMainstream large deep learning training
NVIDIA H10080 GBHigh-performance large-model training. Mega variants add high-bandwidth GPU networking (GPUDirect-TCPXO)
NVIDIA H200141 GBVery large models needing more memory per GPU. Includes GPUDirect-RDMA
NVIDIA B200 / GB200Latest generationFrontier-scale training. Includes GPUDirect-RDMA

Older GPUs (P4, P100, V100) are also listed for training. Each accelerator is available only in certain regions and machine families, such as a2 for A100, a3 for H100/H200, a4 for B200, and g2 for L4.

Sizing Memory

Training memory holds weights + gradients + optimizer states + activations. With the Adam optimizer in mixed precision, a rough rule is about 16 bytes per parameter before activations:

Model sizeApproximate weight/gradient/optimizer memoryImplication
350 M parameters~5.6 GBFits on one T4 or L4 with room for activations
7 B parameters~112 GBDoesn't fit on one 80 GB GPU for full fine-tuning. Use sharding (FSDP/ZeRO) across GPUs, or parameter-efficient tuning (LoRA or QLoRA)
70 B parameters~1.1 TBNeeds multi-node model parallelism and sharding

Ways to reduce memory before buying bigger hardware:

  • Mixed precision (bfloat16 on A100, H100, and TPUs, or float16 with loss scaling)
  • Gradient checkpointing (recompute activations to save memory)
  • Gradient accumulation (smaller micro-batches with the same effective batch)
  • Parameter-efficient fine-tuning (LoRA, QLoRA)
  • Sharded optimizer states (Section 11.2)

Matching Hardware to Scenarios

ScenarioRecommended hardwareReason
XGBoost churn model on 5 GB of tabular dataHigh-memory CPU machine (or GPU if using XGBoost GPU training)Tree methods are fast on CPU. GPUs help mainly at larger scale
Fine-tuning a vision transformer on 2 million images in PyTorch with custom augmentation opsA100 or H100 GPUsLarge batches plus custom PyTorch ops
Training a large recommendation model with huge embedding tables in JAX, for weeksTPU sliceMatrix-heavy with ultra-large embeddings and long training
Prototype of a new loss function on a sampleCPU or a single small GPUFlexibility and low cost matter most
LoRA tuning of a 7B open model on a tight budgetL4 or A100 with QLoRAMemory-efficient tuning on cheaper GPUs

Cost and Capacity Strategies

StrategyEffect
Spot VMsLarge discounts for fault-tolerant jobs with checkpoints. Not supported with TPU Pods
Dynamic Workload Scheduler (flex-start)Waits for GPUs (L4, A100, H100, H200, B200) to become available, then starts all nodes together
Reservations / Managed Training ClustersGuaranteed capacity for critical or very large jobs
Right-sizingMeasure GPU utilization. If it's low, fix the input pipeline or use fewer or smaller accelerators

Faster hardware is often cheaper overall. A job that costs 3× more per hour but finishes 5× faster costs less in total. Compare cost per completed training run, not hourly price.

Checking Utilization Before Scaling Up

Before choosing bigger or more accelerators, look at how the current ones are used:

ObservationMeaningAction
GPU utilization low, CPU highInput pipeline or preprocessing bottleneckOptimize data loading (Chapter 9), then reassess
GPU memory near full, utilization highHardware is the limitMixed precision, then more or bigger accelerators
GPU utilization spiky in multi-GPU jobsCommunication or synchronization waitsBetter interconnect, Reduction Server, larger per-device batch
Many short CPU-bound trialsAccelerators unnecessaryCPU machines or BigQuery ML

Exam Traps

  • Choosing TPUs for a PyTorch model full of custom CUDA operations in the training loop. GPUs are the better fit.
  • Choosing GPUs for a small scikit-learn model. CPUs are simpler and cheaper.
  • Recommending TensorFlow on the newest TPU generation where it isn't supported.
  • Adding accelerators when utilization shows the input pipeline is the bottleneck.
Test Your Knowledge

A research team trains a JAX ranking model with very large embedding tables, dominated by matrix multiplications with no custom operations, for several weeks. Which accelerator does Google's guidance favor?

A
B
C
D
Test Your Knowledge

A PyTorch model relies on many custom operations that must partly run on the CPU, and the team wants to train with large batches. Which hardware is the best fit?

A
B
C
D
Test Your Knowledge

An engineer plans full fine-tuning of a 7-billion-parameter model with Adam in mixed precision on one 80 GB GPU. Using the rule of thumb of about 16 bytes per parameter for weights, gradients, and optimizer states, what should they expect?

A
B
C
D