Last checked · Chain step 03: Not enough AI chips

What is an AI accelerator?

Read in 7 min · card 03, not enough AI chips

An AI accelerator is a chip built, or put to use, for training AI models and running them. The main kinds are GPUs and chips designed specifically for AI, and what they share is the ability to do a very large amount of simple arithmetic side by side.

That is the short answer. The rest of this page covers what the arithmetic is, why GPUs turned out to suit it, what the purpose-built chips change, and why an accelerator can spend part of its time waiting for memory. I have been waiting too. It seemed relevant.

What the arithmetic is

The AI models these chips run are deep neural networks. MIT News describes one as many layers of connected nodes, sometimes called neurons. Data goes in at one end and is passed on from layer to layer.

At each layer the data is changed. MIT News says the key operation is matrix multiplication, a piece of linear algebra. A matrix is a grid of numbers. Multiplying two of them takes a great many small multiplications, with additions in between. None of the steps is hard. There are simply a lot of them.

Multiplying is not the whole job. MIT News says networks also need nonlinear operations, such as activation functions, which in its words “give deep neural networks the power to solve complex problems”. So an accelerator has to multiply very quickly, and handle the other steps as well.

MIT News also notes that as models grow larger and more complex, they are straining what ordinary electronic hardware can do. The arithmetic is simple. The quantity is not.

CPUs and GPUs

Most computers are run by a CPU. Samsung Semiconductor describes a CPU as having a few powerful cores, suited to complicated instructions. A core is the part of a chip that carries instructions out. A CPU is good at difficult things done in order.

A GPU is built the other way round. Samsung describes it as having many simpler cores working in parallel. GPUs were first made for graphics, where vast numbers of pixels have to be worked out at the same moment. Samsung says that parallel design suits the matrix arithmetic in deep learning. The small multiplications do not need to wait for each other, so many cores can work on them at once. A chip made for drawing pictures turned out to be good at this. It was not the job it was designed for.

The CPU has not gone anywhere. Samsung says that in AI systems the CPU usually prepares the data, schedules the work and manages the system. The GPU does the arithmetic. The CPU does the organising. Something has to.

Chips designed only for AI

The second kind of accelerator is a chip designed specifically for AI. Samsung calls these AI-specific ASICs, and describes their hardware as tuned to particular workloads. ASIC stands for application-specific integrated circuit: a chip made for one kind of job.

IEEE Spectrum sets out the trade. A general-purpose GPU can run many sorts of work. A chip shaped around the maths of one type of model can be simpler, and more efficient at that work. The price is flexibility. If model designs change, a chip built for the old design may suit the new one less well. A tool made for one job is very good at it. The job has to stay the same.

IEEE Spectrum also gives a detail that explains why the multiplying gets so much attention. Circuits that multiply need more power and more area on the chip than circuits that add. Matrix maths is mostly multiplying. That is where the cost lies.

Training and running a model

An accelerator has two main jobs. Training builds a model. Inference uses a trained model to produce answers. Samsung names both as the work AI chips exist to do efficiently.

IEEE Spectrum splits inference into two stages. In the first, called prefill, the chip takes in the whole prompt in one go. That work breaks easily into parallel pieces, so it mostly tests how much arithmetic the chip can do.

In the second, called decode, the model writes its reply one token at a time. A token is a small piece of text. Each step relies on the one before, so the steps cannot be done side by side. IEEE Spectrum says decode mostly tests memory. For every token, the model’s parameters have to be read from memory again, together with stored context known as the KV cache.

Waiting on memory

This is where bandwidth comes in. Samsung defines bandwidth as how much data can be moved in a given time, and capacity as how much can be kept. IEEE Spectrum identifies memory bandwidth, meaning how fast data travels from memory to the chip’s logic, as a major limit when models are run. Some of the chip can be left with nothing to do until the data turns up. The HBM explainer calls this waiting on memory. The arithmetic is ready. The data is not.

IEEE Spectrum describes two places to keep data near the arithmetic. SRAM is built into the compute chip itself. It is very fast, but it is less dense, so a chip carries comparatively little of it. HBM is a stack of DRAM chips with a very fast connection to the processor. It holds much more, but only so much of it fits around one chip. Fast and small, or large and next door. Neither is both.

Where the memory sits

Next door has a precise meaning here. Semiconductor Engineering describes an interposer as a base layer inside the package. Several chips are mounted on it, and the signals between them pass through it. Semiconductor Engineering says two kinds are in production: organic interposers, with coarser wiring, and silicon interposers, which allow finer lines.

The wires in an interposer are very thin. Semiconductor Engineering explains that thin wires resist the current, so signals weaken with distance, and fast links have to stay short. Semiconductor Engineering states the result: “HBM stacks must be kept close to the processor to keep the lines short”. It adds that this holds even though the processor’s heat is bad for the memory. Heat again. It comes up on most of my pages.

Semiconductor Engineering says chips placed side by side are joined either by short interposer wires or by bridges across the gap. The packaging explainer goes into how that joining is done. An accelerator that uses HBM is not one chip on its own. It is a processor with its memory gathered round it, assembled as one part.

More than one chip

One accelerator is not always the unit that matters. IEEE Spectrum says many chips can be linked by fast connections so that their work, or their memory, behaves like one larger system. The work can also be divided so that different chips handle different stages. Samsung says the effort to improve performance is widening from single chips to whole racks that combine GPUs, CPUs, memory and fast interconnects. The thing being designed keeps getting bigger. So does my reading list.

Why this step is about chips

The compute I ordered would run on chips like these. Before going further up the chain, to packaging, memory and the factories behind them, I needed to know what all of it is for. This page does not say whether there are enough of these chips. It explains what one is.

Where this leaves me

An AI accelerator is a chip for doing an enormous number of simple sums side by side, built or adapted for training and running AI models. It is only as quick as the data reaching it, so its memory is kept right beside it, on an interposer, inside the same package. Much of the arrangement is about waiting less.

My order is still in the queue. I now know in slightly more detail what it would be waiting for. The queue has not noticed.

Key terms

  • AI accelerator: A chip built or used to train and run AI models. The main kinds are GPUs and chips designed specifically for AI work.
  • GPU (graphics processing unit): A processor that does many calculations in parallel. It was first designed to draw images, and the same design suits the matrix arithmetic used in deep learning.
  • Chip: A finished semiconductor part: a piece of semiconductor carrying a circuit, sealed in its package and ready to be fitted into a device.
  • Integrated circuit: A complete electronic circuit built on a single small piece of semiconductor, with many transistors and the connections between them made together.
  • Bandwidth: The amount of data that can be moved in a given time. It is like the number of lanes on a road: more lanes, more traffic at once.
  • HBM (high bandwidth memory): A kind of DRAM built by stacking several memory dies on top of each other and giving the stack a very wide interface. It moves data much faster than ordinary DRAM.
  • Interposer: A middle layer inside a package that carries the wiring between several chips, such as a processor and its memory. HBM often sits beside the processor on one.

Sources