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

Kernel-level profiling

See one GPU kernel's report: busy SMs, memory traffic and Tensor Core use.


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 · 32.05 · KERNEL PROFILEmm1 · 16 rows · 42.3 µs
01
Stage 1 of 5 · One kernel
Nsight Compute replays one kernel, mm1, and reads its counters. The launch splits the output into 128 blocks.
Explain it simply

Nsight Compute is a profiler, a tool that measures one kernel at a time. It runs mm1 again and again and reads the GPU's counters. On the left, the output matrix is cut into 128 square tiles of 128 by 128. Each piece is one block of 256 threads. Its time leaves out the 4 microsecond launch of 32.01.

The kernel mm1 is picked from the call. Its output is split into 128 blocks. It takes 42.3 microseconds.

kernel, blocks, resultsSMs, weightsHBM traffic, activationsidle SMs
one call's kernelslnmm1add1actmm2add2resoutlaunch: 128 blocks1 × 128 tiles of 128 × 128output 16 × 16,384Nsight Compute: mm1duration 42.3 µsgrid 128 blocks × 256 threadswork 2.15 GFLOP · 134.9 MBone kernelt = 2 µs + max(math 2.2 µs, memory 40.3 µs) = 42.3 µsone call's kernelslnmm1add1actmm2add2resoutlaunch: 128 blocks1 × 128 tiles of 128 × 128output 16 × 16,384Nsight Compute: mm1duration 42.3 µsgrid 128 blocks × 256 threadswork 2.15 GFLOP · 134.9 MBone kernelt = 2 µs + max(math 2.2 µs, memory 40.3 µs) = 42.3 µs
Toy: one MLP block of an 8B-class layer on the toy GPU of 32.01
STAGE 1 / 5
MATH · STAGE 1HOVER A SYMBOL OR A SHAPE
t=t0+max⁡(FP uSM, QBeff)\sy{t}{out}{t} = t_0 + \max\left(\frac{\sy{f}{out}{F}}{\sy{p}{param}{P}\,u_{SM}},\ \frac{\sy{q}{data}{Q}}{\sy{bw}{param}{B}_{\text{eff}}}\right)
t=2+max⁡(2.2, 40.3)=42.3 μst = 2 + \max(2.2,\ 40.3) = 42.3\,\mu\text{s}

The time is a startup plus the slower of math and memory.

Common mix-ups

MYTHHigh SM utilization means the GPU computes at full speed.

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

Predict, then reveal
3 CHECKS · PRO
Q01At 1,024 rows, does mm1 stay memory-bound?

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.