Roofline calculator
Draw the roofline for H100, H200, B200, MI300X, TPU and Trainium, find the ridge point, and place a kernel by its arithmetic intensity to see whether it is memory-bound or compute-bound and how far below the roof it sits.
Hardware
Kernel
2 FLOPs per weight read, 2 bytes per weight. Deeply memory-bound on every part ever made.
What the interviewer is actually asking
Every performance and kernel loop asks some form of "is this memory-bound or compute-bound, and how do you know?" The roofline is the one-picture answer. Interviewers listen for the ridge point (peak divided by bandwidth), for decode at batch one sitting at intensity around one, and for the realization that fusion and batching are both ways of moving a point to the right.
Questions people ask
Peak compute divided by memory bandwidth, in FLOPs per byte. On an H100 SXM that is 989 TFLOPS over 3.35 TB/s, about 295. A kernel with lower arithmetic intensity is memory-bound and cannot reach the peak no matter how well it is written; one above it is compute-bound.
