Unit 10 of 12 · about 4 hours · derive, measure
Useful work, achieved throughput and roofline placement
A throughput number needs an operation and byte definition. A roofline supplies a bound to test, not a diagnosis to infer from position alone.
You'll be able to
- Derive useful operations and minimum bytes separately from executed instructions and measured traffic.
- Compute achieved throughput and a roofline bound with consistent units and memory boundaries.
- Place measured points against declared ceilings and explain why a point below a roof does not establish its bottleneck.
Covers
Read
In this order, only the parts listed
0 of 3 done
- Operations, traffic and the first GPU rooflineAI Systems Performance Engineering - Chapters 6 to 8
Chapter 6, Roofline Model: Compute-Bound or Memory-Bound Workloads; Chapter 8, Kernel Memory Throughput Versus Peak HBM Memory Bandwidth and Kernel Compute Throughput Versus Peak GPU FLOPS
Use the model with your own GPU's peaks, not the book's Blackwell values. Low arithmetic intensity identifies the lower roof; it does not prove that measured execution saturates bandwidth.
- Original roofline model and additional ceilingsRoofline: An Insightful Visual Performance Model
Technical report EECS-2008-134, October 2008 revision: sections 3, The Roofline Model, and 4, Adding Ceilings to the Model, including Figure 1
Stop before the platform survey and application case studies. Note that the paper defines operational intensity using traffic after cache filtering, between caches and DRAM.
- Nsight Compute 2026.3.1: roofline and memory boundariesNsight Compute Profiling Guide
Section 2.9, Roofline Charts, Overview and Analysis; section 2.10, Memory Chart, Overview
Match the precision and execution path of the roofline section to the kernel. Keep modeled useful work distinct from profiler operation counters.
Focus on
- Define useful FLOPs from the operation's mathematical contract. Count a multiply-add as two FLOPs, even if one fused instruction executes it; padding, recomputation and address arithmetic are separate executed work.
- Distinguish useful bytes, requested loads/stores and actual traffic at each memory level. Cache hits, transaction overfetch and repeated reads can make those counts differ.
- With work , bytes , elapsed seconds , bandwidth ceiling and compute ceiling , use , , , and . The ridge is ; the model gives .
- State dtype, dense or sparse path, memory level and peak source. Vendor theoretical ceilings and empirically calibrated reference lines are different evidence. Use decimal GB/s consistently, not GiB/s mislabeled as GB/s.
Common mistakes · 3
- Dividing useful bytes by time and calling the result actual DRAM throughput when cache reuse or transaction overfetch is unknown.
- Comparing scalar FP32 work with a sparse low-precision tensor-core peak.
- Adding redundant arithmetic to move right on the roofline and claiming more useful work was accomplished.
Try it yourself
Closed-book, before checking anything
Quiz yourself
Answer first, then mark it. Missed ones go to Review.
0 got · 0 missed
1.A vector copy has no floating-point arithmetic. Should it have a positive FLOP/s point?Answer
No. Report copy bandwidth with a defined read-plus-write byte count. A log-scale FLOP roofline cannot place zero FLOPs directly.
2.Can useful-byte throughput exceed a device's DRAM bandwidth without violating physics?Answer
Yes, when cache reuse means useful bytes exceed actual DRAM traffic. The numerator and memory boundary differ.
3.Does a point far below the sloping roof prove a bandwidth bottleneck?Answer
No. Launch gaps, insufficient parallelism, dependencies, synchronization or instruction limits may prevent reaching that roof.
4.If a kernel executes padded multiply-adds that do not contribute to the output, do they increase useful FLOPs?Answer
No. They increase executed work. Report useful and executed counts separately.
You're done when
Your plot can be regenerated from declared work, byte and timing definitions, with every ceiling sourced or labeled empirical and every unmeasured traffic count labeled modeled.
Only when you can do this without notes.
Leads to
Notes
Resources · 3 for this unit, 9 more in the section
- AI Systems Performance Engineering - Chapters 6 to 8Chris Fregly · primary
Read Chapters 6 to 8: GPU architecture and occupancy, profiling and tuning memory access, and occupancy, warp efficiency and instruction-level parallelism, with their Nsight Systems, Nsight Compute and roofline workflows. Treat every quoted speedup as a hypothesis for your own hardware.
- Nsight Compute Profiling GuideNVIDIA · required
Study the profiling model, replay, metric collection, sections, roofline and source correlation. Collect the smallest counter set that can falsify your bottleneck hypothesis and record profiler overhead.
- Roofline: An Insightful Visual Performance ModelUC Berkeley · required
Read the original model and construct one roofline plot with explicit peak assumptions, useful operations and bytes. Add measured points and explain gaps from launch, resource, cache or instruction effects.
Also in this section
- AI Systems Performance Engineering companion code - Chapters 6 to 8Chris Fregly · required
Use selected baseline and optimized pairs from
code/ch06,code/ch07andcode/ch08plus the shared benchmark and verification machinery. Run only hardware-compatible paths, inspect the tests first, retain raw artifacts and document any guard or unavailable feature. - Nsight Systems User GuideNVIDIA · required
Learn capture, statistics, CUDA API and GPU timeline views, NVTX ranges and report export. Produce one trace that attributes a host gap, transfer or synchronization cost without using the kernel profiler first.
- Compute SanitizerNVIDIA · required
Run memcheck plus applicable racecheck, initcheck and synccheck cases against seeded defects. Preserve minimal reproducers and regression tests, and distinguish unsupported checks from a clean result.
- CUTLASS GEMM Performance Measurement MethodologyNVIDIA · support
Apply the environment, clock, warmup, timing, verification and reporting guidance to the benchmark harness. Generalize the method beyond GEMM and document every intentional deviation.
- CS336 Assignment 2 - Section 2.1 ProfilingStanford University · support
Do the
benchmarking_script,nsys_profile,mixed_precision_accumulationandmemory_profilingproblems on a model size that fits your GPU instead of the handout's B200 settings. Keep raw timings, traces and memory snapshots. - TensorTonic Language Modeling from Scratch - Measure Kernel Timeline UtilizationTensorTonic · support
Solve the timeline-utilization problem after the timeline unit, then repeat the calculation on a trace you captured yourself.
- GPU Microbenchmark and Kernel Suite - Harness and InstrumentationRoadmap-Final · support
Complete Milestones A and B: correct references, synchronized timing, raw samples, noise characterization, environment capture, operation and byte models, timeline traces and profiler evidence.
- PyTorch 2.14 numerical accuracy and tensor testingPyTorch · reference
Read the numerical-accuracy introduction, Extremal values, non-finite inputs and Ampere precision sections, plus the
assert_closecontract andmake_tensorparameters. These supply current comparison semantics missing from the pool's project checklist. - CUDA 13.4 Floating Point and IEEE 754NVIDIA · reference
Read sections 2.2, 3.1 to 3.2 and 4.4 for reduction order and single-precision flush-to-zero flags. Do not use the historical CPU-has-no-FMA statements as current hardware facts.