GPU

On this page 7

A GPU (graphics processing unit) is a massively parallel processor designed to perform the same operation on very large numbers of data elements at once. In hardware, and in graphics specifically, the GPU turns geometry, textures and lighting into the pixels shown on a display, and the same architecture now also accelerates machine learning, scientific simulation and video processing.

Where a CPU devotes most of its transistors to making a few threads run fast, a GPU devotes them to thousands of simple arithmetic lanes and a very wide memory system. The result is far higher throughput on uniform work, at the cost of poor performance on branch-heavy, sequential code.

How a GPU processes work in parallel

A GPU is organized into many identical clusters, called streaming multiprocessors by NVIDIA and compute units by AMD. Each cluster contains dozens of arithmetic lanes, a register file, a small programmable cache and schedulers that keep the lanes busy.

GPUs execute threads in fixed groups, a model known as SIMT (single instruction, multiple threads). NVIDIA groups 32 threads into a warp, and AMD uses wavefronts of 32 or 64 threads. All threads in a group execute the same instruction on different data; when threads take different branches, the paths run one after another, a penalty called branch divergence.

GPUs hide memory latency through massive multithreading rather than large caches. While one warp waits hundreds of cycles for data, the scheduler switches instantly to another ready warp, so the arithmetic units rarely sit idle when enough threads are available.

StageWhat happensExecuted by
Vertex shadingTransforms 3D vertices into screen positionsProgrammable shader cores
RasterizationConverts triangles into pixel fragmentsFixed-function hardware
Pixel shadingComputes color from textures and lightingProgrammable shader cores
Ray tracingTests rays against scene geometry for reflections and shadowsDedicated ray tracing units
Output mergingApplies depth testing and blending, writes the frameRender output units
Stages of the real-time graphics pipeline

Key GPU specifications and what they mean

Peak arithmetic throughput equals lanes multiplied by two operations per fused multiply-add multiplied by clock speed. A GPU with 16,384 FP32 lanes at a 2.52 GHz boost clock reaches 16,384 x 2 x 2.52 GHz = about 82.6 TFLOPS of single-precision compute. Real applications rarely sustain this peak because they are often limited by memory bandwidth.

Memory bandwidth follows from bus width and data rate. A 384-bit bus with 21 Gbps GDDR6X memory delivers 384 x 21 / 8 = 1,008 GB/s, roughly ten times the bandwidth of a dual-channel DDR5 desktop memory system.

ParameterTypical rangeWhat it affects
Shader lanesA few hundred to over 16,000Raw parallel throughput
Boost clockAbout 1.5 to 3 GHzSpeed of each lane
VRAM capacity8 to 32 GB consumer, 80 to 288 GB data centerLargest model, texture set or dataset that fits
Memory bandwidthAbout 250 GB/s to several TB/sSpeed of data-hungry workloads
Board power75 to 600 W consumer, 700 W or more data centerCooling and power supply needs
Matrix unitsPresent on most current GPUsAI training and inference speed
Main GPU parameters

Most GPUs now include specialized matrix units, such as Tensor Cores, that multiply small matrices at reduced precision (FP16, BF16, FP8 or INT8). For neural networks these units deliver many times the throughput of the general shader lanes.

Types of GPUs and how they compare

GPUs differ mainly in where they sit and which memory they use. An integrated GPU shares the CPU package and system memory, while a discrete GPU has its own board, power delivery and dedicated VRAM.

TypeMemoryTypical useMain constraint
Integrated GPUShared system RAMOffice work, video playback, light gamingShared bandwidth and power budget
Discrete consumer GPUGDDR6, GDDR6X or GDDR7Gaming, content creation, local AIVRAM capacity
Workstation GPUGDDR with ECCCAD, visualization, certified softwarePrice per performance
Data center acceleratorHBM stacksAI training, inference, HPCPower, cooling and supply
GPU categories

Compared with a CPU, a GPU offers far higher throughput but higher latency per task. The CPU still runs the operating system, prepares work and launches GPU kernels, so the two act as host and accelerator rather than as replacements for each other.

Programming and using a GPU

Graphics applications reach the GPU through APIs such as Direct3D 12, Vulkan and Metal, which submit command lists that the driver translates for the hardware. General-purpose computing uses platforms such as CUDA, ROCm (HIP), OpenCL or SYCL, and most AI developers use them indirectly through frameworks that ship optimized GPU libraries.

A workload suits a GPU when it has abundant data parallelism, regular memory access and high arithmetic intensity. Operations on images, matrices, particles and video frames fit well; parsing, transactional databases and code with unpredictable branches usually do not.

Limitations and common mistakes

The most frequent GPU bottleneck in practice is memory, not compute. A model or dataset that does not fit in VRAM either fails or spills over the PCIe link, which at about 32 GB/s per direction for PCIe 4.0 x16 is far slower than on-board memory.

SymptomLikely causeRemedy
Out-of-memory errorsModel or batch exceeds VRAMSmaller batches, lower precision or a larger-memory GPU
Low GPU utilizationCPU or data loading cannot keep upFaster input pipeline, more CPU threads
Poor speedup over CPUSmall problem size or heavy branchingBatch work or keep the task on the CPU
Stuttering in gamesShader compilation or VRAM exhaustionLower texture settings, updated drivers
Falling clocks under loadThermal or power limit reachedBetter airflow or a lower power target
Typical GPU problems

A plain-language summary

A GPU is a chip built to do a huge number of simple calculations at the same time. A single video frame contains millions of pixels. Each pixel can be colored on its own. Handling them all at once is much faster than going one by one.

Picture a CPU as a few expert craftspeople. A GPU is more like a stadium full of workers who all follow the same short instruction. For repetitive jobs such as images, video and AI, the stadium wins easily.

An example from practice

A research group fine-tunes a language model with 7 billion parameters for medical text classification. On a 32-core server CPU, one training epoch over its dataset takes about two days, which makes experimentation impractical.

The group moves training to a data center GPU with 80 GB of HBM memory and uses BF16 mixed precision with a parameter-efficient fine-tuning method, so the model weights fit in VRAM. The matrix units handle the bulk of the work, and one epoch now finishes in roughly two hours.

The team learns that the speedup depends on keeping the GPU fed: early runs reached only 40% utilization until data loading was moved to multiple CPU worker processes.