Log inStart free
LESSON 26.04 · 5 STAGES · 2 CONTROLS · 3 CHECKSPRO · PREVIEW

SMs, CUDA cores and Tensor Cores

Watch one CPU core, then the SMs of a GPU, do the same math.


Pro lesson. Stage 1 is free to watch. Pro opens all 5 stages, 2 controls and 3 checks, in this lesson and every other.

Go Pro · $8.25/mo
EXPLAINER · 26.04 · GPU BAYCPU CORE · 1,024 ADDS · 341 ns
01
Stage 1 of 5 · One CPU core
One CPU core adds one pair each cycle. The 1,024 adds of c take 1,024 cycles: 341 ns at 3 GHz.
Explain it simply

The big square on the right is the vector c, laid out as 32 rows of 32. This toy CPU core has one fast lane. It adds one pair of numbers each cycle, so the squares fill one at a time. That takes 1,024 cycles.

One CPU core with one lane fills the 1,024 squares of c one at a time. It takes 1,024 cycles, 341 ns.

a and blanes at workfree lanesunused Tensor Coresresults
CPU core · 3 GHzcontrol: fetch, decode, predict, reorderbuilt to run one stream fast1 fast lane1 add a cycle16 registersL1, L2 and L3 cachesfrom 26.01: they feed the one lanec = a + babone CPU core1,024 adds ÷ 3 GHz = 341 nsCPU core · 3 GHzcontrol: fetch, decode, predict, reorderbuilt to run one stream fast1 fast lane1 add a cycle16 registersL1, L2 and L3 cachesfrom 26.01: they feed the one lanec = a + babone CPU core1,024 adds ÷ 3 GHz = 341 ns
Toy: 26.C1 vectors · arithmetic cycles only, no memory
STAGE 1 / 5
MATH · STAGE 1HOVER A SYMBOL OR A SHAPE
t=nopsfCPU\sy{t}{out}{t} = \dfrac{\sy{n}{data}{n_{\text{ops}}}}{\sy{f}{param}{f_{\text{CPU}}}}
t=1,0243 GHz=341 nst = \dfrac{1{,}024}{3\text{ GHz}} = 341\text{ ns}

The time is the operations divided by the clock rate.

Common mix-ups

MYTHA CUDA core is a small, fast CPU core.

The fix, and 1 more mix-up with the diagram to show them, come with Pro.

Predict, then reveal
3 CHECKS · PRO
Q01With 4 SMs, how many cycles do the CUDA cores need for c = a + b?

Make your guess, then test it in the diagram. All 3 checks come with Pro.

PRO LESSON · YOU WATCHED STAGE 1 OF 5
Unlock the full explainer
  • 4 more stages and 2 live controls
  • 2 mix-up cards and 3 predict-then-reveal checks
  • Watch it as a narrated video, in three voices
  • Every Pro lesson and capstone · 656 in total

$99 a year, or $15 a month. Cancel any time.