Why does AI need GPUs? Explained with a kitchen full of cooks
AI needs GPUs because models do huge numbers of small sums at once, and a GPU has many small cores built to work side by side. Explained with many cooks chopping at once instead of one fast chef.
- Author
Umair Mateen- Published
- Reading time
- 5 min
- Category
- AI
In one sentence: AI needs GPUs (graphics processing units) because running and training an AI model means doing huge numbers of small, simple sums at the same time, and a GPU has many more, smaller cores built to work side by side, while a normal processor (CPU) has a few fast cores that mostly work one task after another.
The everyday picture
Picture a restaurant that gets an order for a wedding: 5,000 carrots, all chopped the same way. The restaurant has one brilliant head chef. She is fast, skilled and can cook any dish on the menu. But she has only two hands.
Now picture a second kitchen with a thousand junior cooks, each with a knife and a board. None of them is as skilled as the head chef. But each one chops a handful of carrots at the same moment, and the whole pile is done in minutes.
The head chef is the CPU, the main processor in every computer. The room full of cooks is the GPU. For one tricky dish, the head chef wins. For a mountain of the same simple job, the many cooks win easily. AI is mostly a mountain of the same simple job.
The CPU stays in charge and hands the heavy maths to the GPU. Many GPU cores work on small pieces at once, then the results are combined into the answer.
How it works, step by step
- The AI task (the big order) arrives. Answering a question or reading a photo means running it through a model with millions or billions of numbers, called weights.
- The work is mostly multiplying and adding (chopping carrots). Inside the model, inputs are multiplied by weights and added up, in big grids of numbers called matrices. IBM describes this as the "tensor math and matrix multiplication" that machine learning needs. Most of these small sums don't depend on each other, so they can happen at once.
- The CPU (the head chef) stays in charge. IBM calls the GPU a co-processor: the CPU runs the program and hands the heavy maths to the GPU.
- The GPU's cores (the many cooks) split the job into thousands of small pieces and work them out together. NVIDIA explains that CPUs have a few cores for one-after-another work, while GPUs have far more cores for parallel work. Newer GPUs also have parts built just for matrix maths, which NVIDIA calls Tensor Cores.
- The results are combined (the dish is plated up) into the answer you see. This happens when a model is trained and again every time it answers, which is called inference.
Try it · Side by side
Head chef or a room of cooks: who wins which job?
Tap what matters to you (pick one or more) and see which option fits.
One fast chef (CPU)
- Built for it: handles many kinds of tasks, one after another
- A few cores, so it works through the pile slowly
- Usually too slow to be practical
- Often enough, and already in every computer
- Cheaper and easy to find
Many cooks (GPU)
- Needs the CPU to give it work
- Many cores work on the pile at once
- The usual choice, with parts built for matrix maths
- Can be more than you need
- Costs more and uses more power
Pick what matters to you and the better fit lights up.
Where the picture stops
- Real cooks each think for themselves. GPU cores mostly follow the same recipe step together, each on a different piece of the numbers.
- Cooks fetch ingredients from a shared pantry. A GPU works fastest when the model's numbers sit in its own fast memory, so very large models are often split across many GPUs.
- A kitchen of cooks could also cook other dishes. GPUs were first built to draw graphics, and today there are also chips made only for AI, such as Google's TPUs and the NPUs in some laptops and phones (IBM).
Why it matters for your business
- It shapes what AI costs. IBM notes GPUs cost more than CPUs, can be hard to get and use more energy. Those costs sit behind the prices you pay for AI tools and APIs.
- You usually rent, not buy. Most businesses use AI through a provider's API or rent GPUs in the cloud, so the provider runs the kitchen.
- Not every job needs a GPU. IBM says many modern CPUs can handle smaller machine-learning tasks, and Google Cloud's guide suggests CPUs for quick prototypes and simple, small models.
- It decides self-hosting plans. Running an open model on your own servers means sizing GPUs and their memory for the model you pick.
Try it · Myth or fact
AI chips: myth or fact?
Decide for yourself first, then tap each statement to check it.
0 of 4 checked
An example
Imagine a 15-person law firm that wants to sort old contracts by type. Its first test, on a small model, runs fine on an ordinary office server's CPU. Later it wants a large open model to summarise each contract. That model is too slow on the CPU, so the firm compares two options: renting a cloud GPU by the hour, or calling an AI provider's API and paying per use.
Frequently asked questions
Can AI run without a GPU?
Yes, for small models and light work a CPU can be enough. Large models usually need GPUs or other AI chips to answer at a useful speed.
What is the difference between a CPU and a GPU?
A CPU has a few powerful cores that handle many kinds of tasks quickly, one after another. A GPU has many more, simpler cores that do the same kind of maths in parallel.
Why were GPUs made for games?
Drawing a game screen means working out the colour of millions of pixels at once, which is also a big pile of small, similar sums. That made GPUs a natural fit for AI later.
What is a TPU?
A TPU is Google's own chip built mainly for the large matrix sums in machine learning. It does a similar job to a GPU but is specialised for AI.
Related explainers
The DevDrift helps teams choose between AI APIs and self-hosted models: see how.
Sources
Could you explain this to a colleague now?
Mark it and posts that mention it will show a tick. Saved in this browser only.