Availit World How AI really works, in your language

Lesson 27 of 4632 minFacts checked October 20, 2026

Chips: what AI runs on

Everything a model does comes down to a chip multiplying numbers and, far more often than you would think, waiting for those numbers to arrive. This lesson opens up a GPU, shows why the speed of memory matters more than raw computing power for chat, and follows the wires that join thousands of chips into one machine. You will see why DeepSeek, Google and Huawei design their models and chips around each other, and how to read a spec sheet without being fooled.

In this lesson you will

  • Name the parts of a GPU and say what each one does
  • Use the roofline to tell whether a job is limited by memory or by computing power
  • Explain how FlashAttention speeds up attention without changing the result
  • Describe data, tensor, pipeline and expert parallelism, and why the links between chips matter
  • Compare today’s AI chips and read a spec sheet honestly
On this page
  1. Why a GPU?
  2. Inside an H100
  3. The roofline: memory or maths?
  4. FlashAttention: same maths, fewer trips
  5. Many chips, one model
  6. The wires between chips
  7. The chips, side by side
  8. Power, failures and cost
  9. Remember
  10. Check yourself

Why a GPU?

Almost all the work in a neural network is matrix multiplication: billions of multiply-and-add steps that do not depend on each other. A CPU has a few dozen strong cores, built to run complicated programs one step after another. A GPU has thousands of simple lanes that all do the same thing to different numbers at the same time, which is exactly what matrix multiplication needs.

Since 2017, NVIDIA’s GPUs have also had tensor cores: units that multiply a small block of numbers by another block in one step. They do nearly all of a language model’s maths. Other makers have their own versions: AMD calls them matrix cores, and Google’s TPUs are built around large matrix units.

How much maths an H100 can do
132 SMs × 4 tensor cores = 528 tensor cores

An SM (streaming multiprocessor) is one of the GPU’s small processors.

peak ≈ 989 trillion operations per second in BF16

Counting each multiply and each add as one operation. In 8-bit FP8 it is twice that: 1,979 trillion.

Quick check

A spec sheet says 4,000 trillion FP8 operations per second, with “with sparsity” in the small print. What should you plan with?

Show the answer

Answer: 2,000 trillion Sparse figures are twice the dense rate, and language models almost never use that kind of sparsity. Halve it.

Inside an H100

NVIDIA’s H100 is the data-centre GPU behind many of today’s models. Here is what is inside it.

NVIDIA H100 SXM, part by part
How many, or how bigWhat it does
Streaming multiprocessors (SMs)132Small processors that each run many threads at once
Tensor cores4 per SM, 528 in allMultiply blocks of matrices
Registers256 KB per SMThe numbers being worked on right now
Shared memory and L1 cache (SRAM)256 KB per SM, up to 228 KB of it as shared memoryFast scratch space that a program manages itself
L2 cache50 MBShared by all SMs; saves trips to HBM
HBM3 memory80 GB at 3.35 TB/sHolds the weights and the KV cache
NVLink900 GB/sLinks to the other GPUs in the server
PowerUp to 700 WAbout seven old 100-watt light bulbs

From NVIDIA’s Hopper architecture article and H100 data sheet.

The memory ladder (A100 figures, from the FlashAttention paper)
  1. On-chip SRAMAbout 19 TB/s, but only 20 MB in all: 192 KB in each of 108 SMs
  2. HBM beside the chip1.5 TB/s, 40 GB
  3. The computer’s main memory (CPU DRAM)12.8 GB/s from the GPU’s side, more than 1 TB

Each step closer to the maths units is ten to a hundred times faster and far smaller. Every program that runs on a GPU, called a kernel, loads its inputs from HBM, computes, and writes its results back to HBM. For many kernels, the loading and writing take longer than the maths. Most of the speed tricks in this course are really about moving fewer bytes.

The roofline: memory or maths?

Every job on a chip needs two things: operations (maths) and bytes (data moved from memory). Whichever runs out first sets the speed. The arithmetic intensity of a job is how many operations it does for each byte it reads.

The ridge point of an H100
ridge point = peak operations per second ÷ memory speed

Above this intensity the maths units are the limit; below it, memory is.

989 trillion ÷ 3.35 trillion bytes per second ≈ 295 operations per byte

The H100 needs 295 operations for every byte it reads, or its maths units wait.

decode for one user: 2 operations per weight ÷ 2 bytes per weight = 1 operation per byte

Each 16-bit weight is read once and used for one multiply and one add. That is 1/295 of what the chip could do: about 0.3 % busy.

Drawn on a graph, this gives the roofline: a slope where memory speed sets the limit, then a flat roof where computing power does. The picture comes from a 2009 paper by Williams, Waterman and Patterson at Berkeley, and chip designers and kernel writers still think with it.

Batching helps, because one read of the weights serves every user in the batch: 100 users give about 100 operations per byte. But each user also has a KV cache, and it is read for that user alone. With 2,000-token chats on Llama 3.1 8B, the intensity can never pass about 65 operations per byte, however many users you add. So decode stays memory-bound. Prefill uses each weight for every token of the prompt, which puts it at thousands of operations per byte, under the flat roof.

Try itFind the roof

Start with one user: about 205 tokens per second, and the maths units under 1 % busy. Raise it to 200 users: each still gets about 49 tokens per second and the total is near 10,000, but the dot stays on the slope. Now pick 100-token contexts and 1,000 users, and the dot reaches the roof. Then try 32,000 tokens: only 13 users fit on an H100.

This interactive part needs JavaScript.

This one picture explains a lot. Chips for serving chase memory speed and size: the H200 has exactly the H100’s maths but 43 % more memory speed. Tricks that shrink the bytes, such as GQA, MLA and quantization, speed up decode. And speculative decoding works because idle maths can check several draft tokens for the price of one read of the weights.

Quick check

The H200 has the same computing power as the H100, but 4.8 TB/s of memory speed instead of 3.35. For one person chatting with an 8B model, about how much faster is it?

Show the answer

Answer: About 1.4 times Decode for one user is limited by memory, so speed follows memory speed: 4.8 ÷ 3.35 ≈ 1.43.

Is each job limited by memory speed or by computing power?

0 of 6 sorted
  • One person chatting with an 8B model

    Answer: Memory speed

  • Reading a 20-page document before the first word appears

    Answer: Computing power

  • Pretraining, with millions of tokens in every step

    Answer: Computing power

  • 200 users decoding at once, each with a 32,000-token chat

    Answer: Memory speed

  • 1,000 users with very short chats on one H100

    Answer: Computing power

  • The big model checking 4 draft tokens in speculative decoding

    Answer: Memory speed

FlashAttention: same maths, fewer trips

Attention compares every token with every other token. Done the simple way, the kernel writes the whole table of scores to HBM, reads it back for the softmax, writes the result, and reads it again. For one head with 8,000 tokens the table has 64 million entries, 128 MB in 16 bits, and there is one for every head in every layer.

  1. Cut the queries, keys and values into tiles small enough to fit in SRAM.
  2. Load one tile, compute its scores and its part of the softmax, and add its share to the output, all on the chip.
  3. Move to the next tile. Keep a running maximum and a running total, and rescale what you have so far when the maximum changes.
  4. Write only the final output to HBM. In training, recompute the scores in the backward pass instead of storing them: that is faster than reading them back.
The softmax trick that makes tiles possible
softmax(xᵢ) = e^(xᵢ − m) ÷ Σⱼ e^(xⱼ − m)

m is the largest score so far. Subtracting it stops the numbers from overflowing and does not change the answer.

new maximum m′ ⇒ total′ = total × e^(m − m′) + Σ e^(x − m′)

When a tile brings a bigger score, the old total is rescaled, not recomputed. The partial output is rescaled the same way.

result = exact attention

Not an approximation: the same numbers as the simple way, up to rounding.

FlashAttention came from Tri Dao and colleagues at Stanford and the University at Buffalo in 2022. It made attention 7.6 times faster on GPT-2 and whole training runs 3 times faster. Long contexts became affordable, because the memory it needs grows with the length of the text, not with its square.

How much of the chip’s peak maths attention kernels use
  • FlashAttention, A100 40 % of peak
  • FlashAttention-2, A100 73 % of peak
  • FlashAttention-2, H100 35 % of peak
  • FlashAttention-3, H100 75 % of peak

The upper end of what each paper reports, for 16-bit maths. FlashAttention-3 also reaches close to 1.2 quadrillion operations per second in FP8.

Quick check

Why is FlashAttention faster than ordinary attention?

Show the answer

Answer: It keeps the work in fast on-chip memory instead of writing the big score table to HBM The maths is the same. It saves time by moving far fewer bytes to and from HBM.

Many chips, one model

A 405-billion-parameter model is 810 GB in 16 bits. Training it needs much more than the weights.

Memory to train with the Adam optimizer (from the ZeRO paper)
2 + 2 + 12 = 16 bytes per parameter

16-bit weights (2), 16-bit gradients (2), and 32-bit copies of the weights plus Adam’s two running averages (12).

405 billion × 16 bytes ≈ 6,480 GB

Before counting activations, the values saved for the backward pass.

6,480 GB ÷ 80 GB ≈ 81 H100s, just to hold it

And thousands more to finish in weeks rather than decades.

Ways to split the work
What is splitWhat travels between chipsWhere it is used
Data parallelThe data: each chip has a copy of the model and its own share of the batchGradients, once per step, to average themEverywhere. ZeRO and FSDP also split the copies of the weights and optimizer state
Tensor parallelEach big matrix, across chipsPartial results, twice per layer, for every tokenInside one server, over NVLink (Megatron-LM, NVIDIA, 2019)
Pipeline parallelThe layers, into stages on different chipsActivations, from one stage to the nextAcross servers. Chips sit idle in “bubbles” while the pipeline fills (GPipe, Google, 2018)
Expert parallelThe experts of an MoE modelEvery token, to its experts and back (all-to-all)MoE models such as DeepSeek-V3 (64-way)
Context parallelA long sequence, into piecesKeys and values, between the piecesLong-context training, as in Llama 3

Llama 3 405B (Meta, 2024)

  • Up to 16,384 H100s at 700 W each, 8 per server, joined by NVLink
  • “4D” parallelism: tensor, context, pipeline and data
  • Tensor parallel 8 ways: exactly one server
  • 38–43 % of the chips’ peak maths spent on the model

DeepSeek-V3 (DeepSeek, 2024)

  • 2,048 H800s, whose NVLink was cut from 900 to 400 GB/s for export rules
  • 16-way pipeline (its own DualPipe design), 64-way expert parallel across 8 servers, ZeRO-1 data parallel
  • No tensor parallel at all, to avoid the slow links
  • Trained in FP8, with 20 of each GPU’s 132 SMs set aside for communication

The last line of the Llama 3 card is called MFU, model FLOPs utilization: the share of the chips’ peak maths spent on the model’s own calculations. The rest is lost to waiting for memory, for other chips, and for restarts. Around 40 % is good for a training run of this size.

Quick check

Which way of splitting needs the fastest links, so it is usually kept inside one server?

Show the answer

Answer: Tensor parallel Tensor parallel exchanges partial results for every token in every layer. Llama 3 used it 8 ways, exactly the 8 GPUs of one server.

The wires between chips

Splitting a model only works if the pieces can talk quickly. Links come in two kinds: scale-up links that join a few chips into what acts like one big GPU, and scale-out networks that join many servers into a cluster.

How fast chips talk
SpeedJoins
An H100 to its own HBM3,350 GB/sThe chip and its memory
NVLink, H100900 GB/s per GPUThe 8 GPUs in one server
NVLink, H800400 GB/s per GPUThe same, cut for export rules
NVLink, GB200 NVL721,800 GB/s per GPU, 130 TB/s for the rack72 GPUs in one rack
Google ICI, Ironwood TPU1,200 GB/s per chip, both directionsUp to 9,216 chips in one pod
InfiniBand, 400 Gb/s50 GB/s per cardServers in a cluster

NVLink figures count both directions together. The GB200 figure is the rack’s 130 TB/s spread over 72 GPUs, from 3.6 TB/s per two-GPU superchip.

DeepSeek’s hardware paper (2025) shows how much this matters. In MoE decode, every token travels to its experts and back in every layer, so the network, not the chip, sets the top speed.

DeepSeek’s speed limit for DeepSeek-V3 decode
(1 + 2 bytes) × 32 tokens × 9 experts × 7,000 numbers ÷ 50 GB/s ≈ 121 µs

Sending tokens out in FP8 (1 byte) and back in BF16 (2 bytes), 32 tokens per chip, to 8 routed experts and 1 shared one, over 400 Gb/s InfiniBand.

2 × 121 µs × 61 layers ≈ 14.8 ms per token ≈ 67 tokens per second

Two micro-batches take turns, and there are 61 layers. This is the best case, before any other delay.

the same sum at 900 GB/s (GB200 NVL72) ≈ 6.7 µs ⇒ about 1,200 tokens per second

DeepSeek’s own estimate, which it says has not been tested.

Huawei took the other road and made the wires huge. Its CloudMatrix384 joins 384 Ascend 910 NPUs and 192 Kunpeng CPUs across 16 racks with one Unified Bus, so any chip can reach any other directly. Serving DeepSeek-R1 with its experts spread over 320 chips, Huawei reported 1,943 tokens per second per NPU in decode, at under 50 ms per token. It used INT8, since the Ascend 910 has no FP8 units.

Google’s TPUs use a third design: chips wired straight to their neighbours. An Ironwood pod joins up to 9,216 chips, 42.5 exaflops of FP8 maths in all, and draws nearly 10 MW.

Quick check

A network card is sold as 400 Gb/s. How many gigabytes per second is that?

Show the answer

Answer: 50 Gb is gigabits. There are 8 bits in a byte, so 400 ÷ 8 = 50 GB/s.

The chips, side by side

Today’s AI chips
What it isBF16, trillion operations per secondMemoryMemory speedPower
NVIDIA RTX 4090Gaming card16524 GB1,008 GB/s450 W
NVIDIA H100 SXMData-centre GPU98980 GB3,350 GB/s700 W
NVIDIA H200The H100 with more, faster memory989141 GB4,800 GB/s700 W
NVIDIA B200 (in a GB200 NVL72)Data-centre GPU, sold in racks of 722,500186 GB8,000 GB/s–
AMD MI300XData-centre GPU1,307192 GB5,300 GB/s750 W
AMD MI355XData-centre GPU2,500288 GB8,000 GB/s1,400 W
Google Ironwood TPUGoogle’s own chip, rented in Google Cloud4,614 in FP8192 GB7,370 GB/s–
Apple M5 MaxLaptop chipNot publishedUp to 128 GB, shared614 GB/s–
Apple M5 UltraMac Studio chipNot publishedUp to 512 GB, shared1,200 GB/s–

Dense figures from each maker’s spec sheet. The B200 row is the GB200 NVL72 rack divided by 72. Google gives Ironwood’s peak only in FP8, so it cannot be compared directly with the BF16 column.

Memory on one chip
  • RTX 4090 24 GB
  • H100 80 GB
  • H200 141 GB
  • B200 186 GB
  • MI300X 192 GB
  • Ironwood 192 GB
  • MI355X 288 GB
  • M5 Ultra 512 GB

What fits: a 70B model in 8 bits (about 70 GB) fits on one H100. In 16 bits (140 GB) it needs two H100s or one MI300X.

Apple’s chips use unified memory: the CPU and GPU share one pool. A Mac Studio with 512 GB can hold a 4-bit version of a 671B model, which no single data-centre GPU can. But at 1.2 TB/s it reads memory more slowly than one H100, so it suits one person at home, not thousands of users.

See your own GPUbash
# Which GPU is this, and how busy is it?
nvidia-smi --query-gpu=name,memory.total,memory.used,utilization.gpu,power.draw --format=csv

# Refresh every second while a model runs
nvidia-smi -l 1

# How are the GPUs in this machine connected?
nvidia-smi topo -m
  • utilization.gpu means some kernel was running during the sample, not that the maths units were full. A decode job can show 100 % while its tensor cores are nearly idle.
  • In topo -m, NV18 means 18 NVLink links between two GPUs, as in an H100 server. PIX, PHB and SYS mean the path goes over PCIe or through the CPU, which is much slower.
  • On AMD GPUs, rocm-smi shows the same things. On a Mac, open Activity Monitor and choose Window, then GPU History.

Power, failures and cost

  • A gaming RTX 4090: 450 W.
  • One H100: up to 700 W. One MI355X: 1,400 W.
  • One 8-GPU DGX B200 server: about 14.3 kW.
  • One Ironwood pod of 9,216 chips: nearly 10 MW.

At this scale, power is a design problem of its own. Meta reports that when all of Llama 3’s GPUs paused together, for a checkpoint or a restart, the data centre’s power use swung by tens of megawatts, “stretching the limits of the power grid”.

What stopped Llama 3 405B’s training
  • Faulty GPU 30.1 % of unexpected stops
  • GPU memory (HBM3) 17.2 % of unexpected stops
  • Software bug 12.9 % of unexpected stops
  • Network switch or cable 8.4 % of unexpected stops
  • Unplanned host maintenance 7.6 % of unexpected stops
  • GPU on-chip memory (SRAM) 4.5 % of unexpected stops

419 unexpected stops in 54 days on up to 16,384 H100s: about one every three hours. About 78 % were confirmed or suspected hardware faults. Only three needed a person to step in; automatic restarts handled the rest.

What DeepSeek-V3’s training cost
180,000 GPU hours per trillion tokens ÷ 2,048 GPUs ≈ 88 hours ≈ 3.7 days

It was trained on 14.8 trillion tokens, so pretraining took under two months.

2.788 million GPU hours × $2 per hour = $5.576 million

Pretraining, context extension and post-training together, at a rental price DeepSeek assumed.

Remember

  • A GPU is thousands of simple lanes plus tensor cores. An H100 has 132 SMs and 528 tensor cores, and does 989 trillion BF16 operations per second (dense).
  • Memory is a ladder: tiny, fast SRAM on the chip, bigger and slower HBM beside it. Most speed tricks move fewer bytes.
  • Roofline: ridge point = peak ÷ memory speed (295 operations per byte on an H100). Chat decode sits far below it, so it is limited by memory; prefill and training are limited by maths.
  • FlashAttention computes exact attention tile by tile in SRAM. FlashAttention-3 uses 75 % of an H100’s peak.
  • Big models are split by data, tensor, pipeline and expert. Tensor parallel stays inside a server because it needs the fastest links, and the network can set the top speed of MoE decode.
  • Read spec sheets carefully: dense or sparse, which precision, per chip or per rack. DeepSeek shows how to design a model around the hardware you have.

Words to know

GPU
A chip with thousands of simple maths lanes working at once. First made for graphics.
SM (streaming multiprocessor)
One of a GPU’s small processors. An H100 has 132.
Tensor core
A unit inside an SM that multiplies small blocks of matrices in one step.
HBM
High-bandwidth memory: the GPU’s main memory, stacked beside the chip. Large, but slower than on-chip memory.
SRAM
Small, very fast memory on the chip itself, a few hundred kilobytes per SM.
Kernel
A program that runs on the GPU, such as one matrix multiplication or one attention step.
Memory bandwidth
How many bytes per second can move between memory and the processor.
Arithmetic intensity
Operations done for each byte read from memory.
Ridge point
The intensity where a chip stops being limited by memory and starts being limited by maths: peak operations ÷ memory speed.
Memory-bound, compute-bound
Waiting for memory, or waiting for maths.
Sparsity (on spec sheets)
A trick that needs 2 of every 4 weights to be zero. Figures “with sparsity” are twice the usual rate.
NVLink
NVIDIA’s fast links between GPUs, inside a server or a rack.
InfiniBand
A fast network between servers.
Parallelism
Splitting work across chips: by data, by matrix (tensor), by layer (pipeline), or by expert.
MFU
Model FLOPs utilization: the share of the chips’ peak maths spent on the model itself.
TPU, NPU
Chips built only for AI, such as Google’s TPUs and Huawei’s Ascend NPUs.
Unified memory
One pool of memory shared by the CPU and GPU, as on Apple’s chips.

Go to the source

This lesson is built on these papers and documents. Paper links open arxiv.org, a separate site.

Check yourself

5 questions. Tap the answer you think is right.

0 of 5 answered

What usually limits how fast one person’s chat is written?

Show the answer

Answer: How fast the weights can be read from memory Each new token needs every weight read once but does only about one operation per byte, far below the ridge point.

What is a chip’s ridge point?

Show the answer

Answer: Its peak operations per second divided by its memory speed Jobs with more operations per byte than this are limited by maths; jobs with fewer are limited by memory. For an H100 it is about 295.

DeepSeek’s H800s had slower NVLink than H100s. What did DeepSeek do?

Show the answer

Answer: Designed the model and software around it: no tensor parallel, fewer servers per token, communication overlapped with maths This hardware-aware co-design is a big part of why DeepSeek-V3 was cheap to train.

In Llama 3’s training, what caused the most unexpected stops?

Show the answer

Answer: Faulty GPUs Faulty GPUs caused 30.1 % and GPU memory another 17.2 %. With 16,384 GPUs, something breaks every few hours.

What does DeepSeek-V3’s $5.576 million figure cover?

Show the answer

Answer: Renting GPUs for the final training run, at $2 per GPU hour The report says it excludes earlier research and experiments. It is still very low for a model of that size.

Lesson complete

Answer every question above to complete this lesson.

Your progress is saved on this device only.

Next lessonServing: one model, millions of people
Previous lesson All lessons

Choose your language