On the roofline, which intervention moves an LLM decode workload most directly toward higher peak throughput?
Decode sits on the roofline's memory-bandwidth slope, so the lever that helps is one that cuts bytes moved per FLOP. INT4 quantization does that; pruning FLOPs does not.
Picture a kitchen where the chef is lightning fast, but ingredients arrive on one slow conveyor belt. The chef finishes each dish instantly, then stands around waiting for the belt. Making the chef faster does nothing, because the belt is the bottleneck. Cutting the recipe's steps does nothing either, because the chef was never the holdup. The only thing that helps is shrinking each ingredient so more fits on the belt per trip. Squeeze every ingredient to a quarter of its size and the same belt now delivers four times as many per second, so the chef finally has enough to work with. The roofline is just a chart that tells you whether you are chef-limited or belt-limited.
Detailed answer & concept explanation~8 min readEverything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example.
Everything important, quickly.
4 min: roofline axes + ridge point formula + why decode is left of ridge (memory bound) and prefill right + which levers raise arithmetic intensity (quantization, batching) versus which only cut FLOPs.
Real products, models, and research that use this idea.
- NVIDIA's H100 (989 TFLOP/s bf16, 3.35 TB/s HBM3) gives a bf16 ridge near 295 FLOPs per byte; LLM decode sits far left of it.
- vLLM uses continuous batching to raise decode arithmetic intensity, amortizing one weight read across many concurrent requests toward the ridge.
- DeepSeek V4 and Llama 4 ship INT4 and FP8 weight quantization specifically to cut the bytes streamed per decode step.
- TensorRT-LLM (NVIDIA) exposes roofline-style profiling so engineers can confirm a decode kernel is HBM bound before tuning it.
- FlashAttention raises the attention kernel's arithmetic intensity by tiling, moving it rightward toward the compute roof on H100 and B200.
What an interviewer would ask next. Try answering before peeking at the approach.
QHow exactly does batching move a decode kernel along the roofline?
QWhy does INT4 quantization raise arithmetic intensity but FP16 to BF16 does not?
Don't say thisRed flags and common mistakes that signal junior thinking. Click to expand.
Red flags and common mistakes that signal junior thinking. Click to expand.
Assuming that cutting FLOPs (pruning, smaller matmuls) speeds up decode. Decode is bandwidth bound, so only cutting bytes moved per token helps; fewer FLOPs leave the bottleneck untouched.
The night-before-the-interview bullets. Scan these on the way to the call.
Primary sources. Skim if you want the original framing.
Same topic, related formats. Practice these next.