Why GPUs Dominate Neural Network Training
A GPU is a freight train, a CPU a race car: deep learning moves identical math across huge batches. GPUs win on transformers and CNNs. The footgun is using them for tiny models, where data transfer overhead eats the gains.
WHY IT EXISTS: Training neural networks means repeating the same arithmetic, mostly matrix multiplication and backpropagation, across millions of parameters and data points. CPUs were built for low-latency, branching, general-purpose tasks with unpredictable memory access. They have relatively few cores and cannot keep enough execution units busy to saturate the massive parallelism inherent in tensor operations. GPUs were originally designed to process millions of pixels in parallel, which maps directly onto the batch-heavy, identical math that dominates deep learning.
THE MENTAL MODEL: Picture a CPU as a race car and a GPU as a freight train. The race car gets one complex instruction to its destination extremely fast, but it only carries a few passengers. The freight train moves slower per car, yet it hauls thousands of identical containers at the same time. Neural network training is not a series of clever detours; it is the same multiply-add operation repeated across an entire batch of embeddings, weights, and gradients. The hardware that wins is the one built for throughput over latency.
HOW IT WORKS: A modern CPU contains tens of powerful cores optimized for complex control flow, large caches, and branch prediction. A GPU contains thousands of simpler cores grouped into streaming multiprocessors that execute the same instruction across many data elements in lockstep, a design known as SIMT. Frameworks like PyTorch and JAX compile training steps into kernels that launch on the GPU, keeping every core busy with large tensors. The CPU does not disappear; it handles data loading, augmentation, batch collation, and orchestration, feeding the GPU through PCIe while the GPU spends hours crunching dense convolutions and matrix multiplications.
WHEN TO USE IT: Reach for a GPU when your workload is dominated by large dense matrix operations, convolutional networks, transformers, or any model where frameworks express computation as tensor contractions. The speedup is most dramatic when batch sizes are large enough to fill the GPU's memory and keep all streaming multiprocessors occupied. GPUs also shine when you scale to multiple devices via data or tensor parallelism.
WHEN NOT TO USE IT: Do not default to a GPU for every machine learning task. Small batch sizes leave cores idle and waste time on kernel launch overhead. Tree-based models, heavy data preprocessing, and tasks with irregular memory access or heavy branching often run faster on a CPU. If your model is small enough to fit in CPU cache and trains in minutes, the complexity of device memory management and host-to-device transfer is usually not worth it.
ONE CANONICAL EXAMPLE: A computer vision team training a ResNet classifier on ImageNet will see dramatic speedup on a single GPU versus a high-end CPU because every forward and backward pass is a giant batch of convolutions and fully-connected layers. The CPU reads JPEGs from disk, decodes them, and ships batches to GPU memory, while the GPU spends hours executing the same convolution kernels across millions of images. Removing the GPU from that pipeline turns a day-long job into a week-long one.
Get five bites like this every day.
Tezvyn delivers a daily feed of 60-second tech bites with quizzes to lock in what you learn.