Concepts / CPU and GPU Memory in AI Accelerators

CPU and GPU Memory in AI Accelerators

An AI accelerator uses three memory tiers: on-chip SRAM caches, GPU high-bandwidth memory, and CPU system memory, each with a different balance of speed and size.

  • Programming

A Fast Cook and a Distant Pantry

Picture a kitchen where a cook can chop vegetables at great speed, but every ingredient has to be fetched from a storage room across the building. The cook spends most of the shift walking, not chopping. An AI accelerator faces a similar problem. Its arithmetic units can process numbers extremely quickly, yet they can only do useful work when the numbers they need are already within reach.

This article answers a practical question: when a model runs, where do its numbers live, and how long does it take to get them to the place where they are used? The short answer is that an accelerator does not have one memory. It has a layered arrangement in which each layer trades capacity for speed. Learning to read that arrangement is the first step toward understanding why some workloads run quickly and others stall.

The Three Memory Tiers

An AI accelerator can draw on three memory tiers: CPU system memory, the GPU's own high-bandwidth memory, and on-chip memory built into the silicon. Each tier offers a different balance of speed and size. The three are described one at a time below, and then compared side by side.

Where Each Tier Sits Relative to the Compute

Position matters as much as speed. The on-chip tier is inside the same silicon as the compute units, so it is the closest. GPU HBM is a separate pool dedicated to the GPU and placed near it, so it sits one step farther out. CPU system memory is the most distant: the accelerator reaches it through the connection to the host CPU. Read the diagram below from the compute outward. Each step adds capacity and adds distance.

Compute unitsarithmetic on numbers inreachOn-chip SRAMinside the chip, 40 MB orlessGPU HBMdedicated to the GPU, 24 to80 GB typical consumerCPU system memoryreached through the CPUconnection, 16 to 64 GBlaptopclosestone step outvia host connection
Where does each memory tier sit relative to the compute units, and what lies between the compute and each tier?

Bandwidth Versus Capacity

Two properties describe each tier, and they are separate. Bandwidth is how fast data can be read or moved. Capacity is how much data the tier can hold. A chip can be strong on one and weak on the other, and both matter when judging whether a chip suits a memory-heavy workload. The table below collects the source's typical figures so the three tiers can be compared directly.

TierLocation relative to computeTypical bandwidthTypical capacity
On-chip SRAMInside the chip, closestOften exceeding 10 TB/sTypically 40 MB or less
GPU HBMDedicated to the GPU, placed nearby256 GB/s to more than 1.5 TB/sAround 24 to 80 GB on a consumer GPU
CPU system memoryReached through the CPU connection, farthest25 GB/s to 50 GB/sRoughly 16 to 64 GB on a laptop, 1 TB or more on a high-end workstation

Typical figures for the three memory tiers, as given in the source

Why the Fastest Tier Is the Smallest

Read across the table and a pattern appears: every step toward the compute increases speed and reduces room. The on-chip tier can be read at the highest rate but is measured in tens of megabytes, while CPU memory can hold tens or hundreds of gigabytes at a fraction of that rate. Designers cannot simply make the fastest memory bigger without changing the chip. That constraint is why the hierarchy exists at all.

On-chip SRAMfastest, smallestGPU HBMfaster than CPU memory,larger than SRAMCPU system memoryslowest, largesttrades capacity for speedtrades capacity for speed
Why does moving closer to the compute increase speed but reduce capacity, and how do the tiers form a single hierarchy?

Following One Chunk of Data

Speed numbers become meaningful when you watch a specific piece of data move. The scenario below is an invented illustration, not a measured benchmark. It uses the tier characteristics from the earlier sections to show how the same chunk of data can be far from the compute at one moment and close to it the next.

Worked example

One Chunk of Data Moving Toward the Compute Units

A chunk of model data begins in CPU system memory and must be used by the compute units. Trace where it sits at each stage and identify which step is the slowest.

  1. 1
    Start in CPU system memory

    The chunk sits in the largest pool, reached through the CPU connection. This is the farthest tier and the slowest, with transfer speeds of roughly 25 to 50 GB/s.

  2. 2
    Move into GPU HBM

    The chunk is staged into the GPU's dedicated high-bandwidth memory, which is placed close to the GPU and can be read much faster, from 256 GB/s to more than 1.5 TB/s.

  3. 3
    Move into on-chip SRAM

    A working portion of the chunk is staged into on-chip SRAM, the closest tier. It can be read at often more than 10 TB/s, but only about 40 MB or less fits.

  4. 4
    Feed the compute units

    The arithmetic units now use the staged numbers. Work proceeds quickly as long as the next needed values are already staged in the fast tiers.

Result

The chunk is far from compute at the start and close at the end. The step that takes longest is the first transfer out of CPU system memory, because that tier is the slowest.

What do you think happens?

Before the chunk reaches the compute units, which tier must it pass through first if it starts in CPU system memory, and which tier is the closest to the compute?

  • GPU HBM first, on-chip SRAM is the closest

  • On-chip SRAM first, GPU HBM is the closest

  • CPU system memory is the closest tier

Reveal answer
Answer:

GPU HBM first, on-chip SRAM is the closest

The chunk moves outward-in from CPU system memory to GPU HBM, then to on-chip SRAM, which sits inside the chip next to the compute units. On-chip SRAM is the closest tier and the fastest.

CPU system memoryabout 25 to 50 GB/s,slowestGPU HBM256 GB/s to more than 1.5TB/sOn-chip SRAMoften more than 10 TB/sCompute unitsuse staged numbersstaged instaged inread by
When a workload runs, what path does a chunk of data take from CPU system memory to GPU HBM to on-chip SRAM and into the compute units, and where does the slowdown occur?

The slowdown is most likely to come from the outer edge of the path. The first transfer out of CPU system memory is the slowest link, and any data the compute units need that has not yet been staged into the fast tiers forces a wait. A workload that fits comfortably in the fast tiers behaves very differently from one that spills into the slow ones.

Why Memory Shapes Optimization and Accelerator Choice

Because the hierarchy determines speed, a large share of GPU optimization is about keeping useful data in the fast tiers for as long as possible. The source notes that, at the time it was written, mainstream frameworks such as PyTorch and TensorFlow did not yet offer fine-grained control over memory access. That gap pushed many engineers toward lower-level GPU programming languages, including CUDA, OpenAI's Triton, and ROCm. CUDA was originally called Compute Unified Device Architecture. ROCm is AMD's open source alternative to NVIDIA's proprietary CUDA.

The same reasoning applies when choosing an accelerator. Raw compute tells you how fast the arithmetic can run, but it does not tell you whether the numbers will be in reach. Bandwidth and capacity are separate properties of memory, and both matter when judging whether a chip suits a memory-heavy workload. A chip with strong compute but small or slow memory can stall on the same chunks of data that a better-balanced chip handles smoothly.

Mistakes Learners Make About Accelerator Memory

  • Common mistake

    Assuming the accelerator has one memory

    Why it fails

    An accelerator uses three tiers, each with a different balance of speed and size, not a single pool.

    Do this instead

    Name the three tiers: on-chip SRAM, GPU HBM, and CPU system memory, and place each relative to the compute.

  • Common mistake

    Treating bandwidth and capacity as the same property

    Why it fails

    Bandwidth is how fast data moves, and capacity is how much fits. They are separate, and a chip can be strong on one and weak on the other.

    Do this instead

    Judge a chip on both properties when it will run a memory-heavy workload.

  • Common mistake

    Assuming the biggest memory is the best place for active data

    Why it fails

    CPU system memory is the largest but the slowest. Data kept only there forces the compute units to wait.

    Do this instead

    Stage the next needed values into the fast tiers rather than leaving them in the largest pool.

  • Common mistake

    Believing raw compute alone decides which accelerator suits a workload

Practice: Reading a Memory Layout

MEDIUM

A workload repeatedly needs the same small set of values, about 20 MB in total, while the rest of the model sits in CPU system memory. Which tier should hold the repeatedly used values to keep the compute units fed, and why would keeping them only in CPU system memory slow the run? Explain your answer using the bandwidth and capacity figures for each tier.

Hints
  • Compare the capacity of on-chip SRAM with the 20 MB working set.
  • Think about which tier can be read at the highest rate and how far each tier is from the compute.

Summary

  1. 1
    An AI accelerator uses three memory tiers: on-chip SRAM inside the chip, GPU HBM dedicated to the GPU, and CPU system memory reached through the CPU connection.
  2. 2
    The tiers trade speed for size. On-chip SRAM is the fastest, often exceeding 10 TB/s, but typically holds 40 MB or less. CPU system memory is the slowest, at roughly 25 to 50 GB/s, but the largest.
  3. 3
    Bandwidth and capacity are separate properties, and both matter when judging whether a chip suits a memory-heavy workload.
  4. 4
    Data moves outward from CPU memory to GPU HBM to on-chip SRAM, and the first transfer out of CPU memory is often the slowest link. Performance depends on keeping the next needed values staged in the fast tiers.
  5. 5
    Memory access is a central target of GPU optimization, which is why the choice of accelerator depends on memory as well as raw compute.

At a glance

  • An AI accelerator uses three memory tiers: on-chip SRAM, GPU high-bandwidth memory, and CPU system memory, each trading speed against size.
  • The fastest tier, on-chip SRAM, is also the smallest, because fast memory cannot simply be made larger without changing the chip.
  • Data moves outward from CPU memory through GPU HBM to on-chip SRAM, and slowdowns often come from data that has not yet been staged into the fast tiers.
  • Memory access is central to GPU optimization, so accelerator choice depends on memory bandwidth and capacity as well as raw compute.

More concepts starting with C