Zero Labs
Industry News / AI

Why An AI Model Only Uses 0.34% of The GPU Compute: How GPUs Actually Work, Part 2

Source · Towards AI By Suchitra Malimbada

From the publisher’s feed, collected in the ZeroLabs newsroom.

Arithmetic intensity, the roofline model, and the LLM-specific consequences of how modern GPUs are built.An H100 SXM5 delivers 989 TFLOPS of dense FP16 tensor compute and 3.35 TB/s of HBM3 bandwidth. When that chip generates a token from a 70 billion parameter model in FP16, its Tensor Cores run at roughly one third of one percent of their peak rate. The rest of the time, they wait for weights to arrive from memory. Part one walked through how the SIMT execution model and the six-tier memory hierarchy are built. Part two explains why those choices make memory bandwidth, not FLOPS, the binding constraint on LLM inference.Table of ContentsArithmetic Intensity and the Roofline ModelThe Memory WallPrefill and DecodeKV Cache, Batch Size, and QuantizationClosing ThoughtsReferences1. Arithmetic Intensity and the Roofline Model1.1 Arithmetic intensity as the right metricArithmetic intensity is the ratio of arithmetic operations performed to bytes loaded from memory. The unit is ops per byte. A kernel that reads a 100 MB tensor and performs 100 million floating-point operations on it has an arithmetic intensity of 1 op/byte. A kernel that reads the same tensor and performs 100 billion operations on it has an intensity of 1,000 ops/byte. The metric matters because every operation on a GPU requires data, and data has to come from somewhere in the memory hierarchy.A matrix-matrix multiplication, the operation underlying nearly all deep learning compute, has high arithmetic intensity. Multiplying two N x N matrices reads 2N^2 elements and performs 2N^3 operations. At N = 4096, the intensity is 4,096 ops per element, or roughly 2,048 ops/byte in FP16. A matrix-vector multiplication, by contrast, reads roughly N^2 elements and performs 2N^2 operations, giving an intensity of about 2 ops per element regardless of N. The difference between the two operations is what separates training and prefill, where the hardware runs near peak, from decode, where it does not.Why intensity is the right metric, rather than FLOPS or bandwidth alone, follows from how the two interact. Peak FLOPS describes how fast the execution units can compute when data is available. Peak bandwidth describes how fast data can arrive. The operation that determines runtime is the slower of the two for a given workload, and which one is slower depends entirely on the ratio of compute to data, which is arithmetic intensity.1.2 The roofline model and the two regimesThe roofline model formalizes the relationship between arithmetic intensity and achievable performance. For a given chip with peak FLOPS F and peak bandwidth B, the maximum performance achievable at arithmetic intensity I is P = min(F, B * I). The formula gives two regimes. When B * I = F, performance is compute-limited and flat at peak FLOPS.Plotted with intensity on the x-axis and achievable performance on the y-axis, the model produces a curve that rises diagonally and then flattens into a ceiling. The diagonal portion is the memory-bound region. The flat portion is the compute-bound region. The intensity at which the two regions meet is called the ridge point, and it is the threshold a workload must clear to fully use the chip’s compute capacity.The ridge point falls out of the chip’s specifications directly. For an H100 SXM5 at FP16, peak compute is 989 TFLOPS and peak bandwidth is 3.35 TB/s, which puts the ridge point at about 295 ops/byte. At FP8, peak compute doubles to 1,979 TFLOPS while bandwidth stays the same, raising the ridge point to roughly 590 ops/byte. A workload running at 1 op/byte sits more than two orders of magnitude below either ridge point, deep in the bandwidth-limited region, where doubling the chip’s FLOPS would not change the runtime by a measurable amount.1.3 Ridge point progression across generationsRidge points have climbed across NVIDIA’s data center GPU generations, with the steepest jump arriving at Hopper. The V100 SXM2, released in 2017, paired 125 Tensor Core FP16 TFLOPS with 0.9 TB/s of HBM2 bandwidth, giving a ridge point near 139 ops/byte. The A100 SXM4 80GB raised FP16 Tensor Core compute to 312 TFLOPS and bandwidth to 2.04 TB/s, holding the ridge point steady at about 153 ops/byte. The H100 SXM5 brought FP16 Tensor Core compute to 989 TFLOPS and bandwidth to 3.35 TB/s for a ridge point of about 295 ops/byte at FP16, and 590 ops/byte at FP8 where compute doubles while bandwidth holds.The progression tells a consistent story. FP16 Tensor Core compute scaled roughly 8x from V100 to H100, while bandwidth scaled less than 4x over the same period. The ridge point roughly doubled as a result, and at FP8 it quadrupled. A workload that comfortably saturated a V100 at 140 ops/byte sits below the ridge point on an H100, where the same intensity falls in the bandwidth-limited region.The pattern shapes which workloads benefit from generational upgrades. Training large transformer models, which runs at intensities in the hundreds of ops/byte, scales well with FLOPS gains because it sits near or above the ridge point on every recent generation. LLM decode, at roughly 1 op/byte, gets nothing from FLOPS scaling and benefits only when bandwidth improves. The gap between the two has widened with every generation, and the next chapter looks at why that gap is structural rather than an artifact of any single chip.2. The Memory Wall2.1 FLOPS growth outpacing bandwidth growthThe pattern from the previous section, where compute scales faster than bandwidth across generations, is structural rather than coincidental. Logic transistors have continued to scale roughly along Moore’s law trajectories, while HBM bandwidth is limited by the number of pins on the package, the signaling rate per pin, and the physical width of the memory bus. The trade-off shapes every generation that follows. A chip designer who scales FLOPS faster than bandwidth has built a chip that is faster for some workloads and identical for others, and the workloads that benefit most are the ones with intensity well above the new ridge point. Inference workloads, which sit at single-digit ops/byte, fall into the second category.The widening gap is what the industry calls the memory wall. Compute capability is no longer the binding constraint on a growing class of workloads, even though it is still what most spec sheets lead with. The wall does not appear on the data sheet because the data sheet shows peak FLOPS, and peak FLOPS is achievable only when arithmetic intensity sits above the ridge point. For workloads below the ridge point, the chip’s effective performance is set by bandwidth, and bandwidth has been the slower-scaling resource for nearly a decade.2.2 The H200 thought experiment as empirical proofThe H200 is the cleanest natural experiment for the memory wall argument. NVIDIA released it as a refresh of the H100 that keeps the compute architecture identical and upgrades only the memory subsystem. The H200 ships with 141 GB of HBM3e at 4.8 TB/s of bandwidth, compared to the H100’s 80 GB of HBM3 at 3.35 TB/s. Peak FP16 and FP8 TFLOPS are the same on both chips because they use the same SMs and the same Tensor Cores.LLM inference benchmarks show the H200 running between 1.2x and 1.9x faster than the H100 on the same models with the same software, depending on batch size and workload. MLPerf v4.0 measured a 37 to 45 percent throughput increase on Llama 2 70B in server and offline scenarios, which lines up closely with the 1.43x bandwidth ratio of 4.8 / 3.35. NVIDIA’s own product brief reports up to 1.9x at maximum throughput on Llama 2 70B with TensorRT-LLM in FP8. Training workloads, which sit above the ridge point on both chips, show smaller H200 advantages because compute is the binding constraint there and compute has not changed.The experiment isolates one variable cleanly. Same SMs, same Tensor Cores, same software stack, more bandwidth. The performance delta on inference comes from one place. The H200 versus H100 comparison is the empirical confirmation that decode runtime tracks bandwidth rather than FLOPS, and it tends to be the cleanest piece of evidence to point at when someone argues that adding more compute to a chip would speed up LLM inference. Adding more compute would not change runtime for workloads below the ridge point, and the bandwidth-isolated comparison shows why.2.3 What this means for reading benchmarksGPU benchmarks have to be read with the ridge point in mind, because raw peak numbers describe a ceiling that most workloads never approach. A chip advertised at 1,000 TFLOPS of FP16 compute might run an FP16 decode workload at 3 TFLOPS sustained, which is three-tenths of one percent of peak. The gap reflects an arithmetic intensity well below the ridge point, and no amount of kernel tuning can close it without changing the workload’s intensity itself.Reading a benchmark productively means asking which regime the workload sits in. A few questions tend to be enough.What is the arithmetic intensity of the operation being measured?Where does that intensity fall relative to the chip’s ridge point at the relevant precision?If the workload is memory-bound, what bandwidth utilization is the benchmark reporting?If the workload is compute-bound, what fraction of peak FLOPS is being achieved?A vendor that reports 95% of peak FLOPS on a training workload is showing strong performance because that workload sits above the ridge point and the chip’s compute is the relevant resource. The same percentage on an inference workload would be an unusual measurement, an unusual workload, or a number that does not match what a normal user would observe in production. The next chapter looks at how the two phases of LLM inference, prefill and decode, sit on opposite sides of the ridge point and create exactly this kind of asymmetry within a single model running on a single chip.3. Prefill and Decode3.1 The two-workload problem on one modelLLM inference runs in two phases with opposite hardware demands, and both phases tend to share the same pool of GPUs in production. The first phase, prefill, processes the entire input prompt at once and produces a single output token along with a populated KV cache. The second phase, decode, generates output tokens one at a time, reading the KV cache and the full set of model weights for every new token. Both phases run the same model, but they sit on opposite sides of the ridge point introduced in the previous chapter.The split matters because the two phases tend to interfere with each other when scheduled together. A compute-heavy prefill request entering a batch of active decode requests pins the Tensor Cores, which forces the memory-starved decode requests to stall. The interference shows up as jitter in inter-token latency, where some tokens come back quickly and others come back hundreds of milliseconds later depending on what else happened to be running on the GPU at that moment. Modern serving stacks like vLLM and SGLang spend a lot of effort on scheduling for this reason, and architectures like Splitwise and DistServe route prefill and decode to physically separate GPU pools.Why the two phases behave so differently comes down to the structure of the computation in each. Prefill operates on a tensor of shape [batch_size, prompt_length, hidden_dim], which produces large matrix-matrix multiplications across the full prompt. Decode operates on a tensor of shape [batch_size, 1, hidden_dim], because only one token is being generated per step, which collapses every matrix-matrix multiplication into a matrix-vector multiplication. The transition from GEMM to GEMV happens at a precise point in the inference pipeline, and the chapter's remaining sections trace what each side of that transition looks like on the hardware.3.2 Prefill as GEMM, compute-boundPrefill saturates the H100’s Tensor Cores because every projection in the transformer becomes a large matrix-matrix multiplication when the full prompt is processed in parallel. For a prompt of length N flowing through a layer with hidden dimension D, the query, key, value, and output projections all reduce to multiplications of an N x D activation matrix against a D x D weight matrix. Prefill on an H100 SXM achieves between 200 and 400 ops/byte of arithmetic intensity, which sits well above the FP16 ridge point of roughly 295 ops/byte. The same source reports Tensor Core utilization between 90% and 95% during prefill, which means the chip is doing close to the work it was designed to do.Weight reuse is the mechanism that pushes the intensity into compute-bound territory. A weight matrix gets read from HBM once during prefill, and every token in the prompt multiplies against that same matrix before the next weight needs to be loaded. This is what raises the ratio of arithmetic operations to bytes loaded. A 4,096-token prompt going through a 4,096-dimensional layer reads 4096 x 4096 x 2 = 32 MB of weights in FP16 and performs roughly 134 million multiply-accumulates per attention head, which works out to several hundred ops per byte before counting any activation traffic. The bandwidth subsystem stays comparatively idle while the Tensor Cores run flat out.Time to first token, is the metric that prefill governs. A long prompt means a long prefill, because the GEMM dimensions scale with prompt length and the compute time scales with them. The work is highly parallelizable across the prompt, which is why prefill saturates the chip, but the wall-clock time still grows with input length. Quoting fast first-token latency tends to mean optimizing for shorter prompts or running prefill on a separate, compute-dense pool of GPUs that does nothing else.3.3 Decode as GEMV, deriving the 0.34% numberDecode runs at roughly one op per byte because it generates one token per step, which collapses every matrix-matrix multiplication into a matrix-vector multiplication. For each new token, the model loads the full set of weights from HBM and performs a forward pass against a single activation vector. The weights get used once per step instead of once per prompt token, which strips out the reuse that made prefill compute-bound. The arithmetic intensity drops by two orders of magnitude as a direct consequence, and the workload moves from sitting above the ridge point to sitting deep below it.The 0.34% utilization figure for FP16 decode on a 70B model falls out of three numbers the hook already named. A 70B model in FP16 has 140 GB of weights. One decode step reads all of them, which takes 140 / 3,350 = 0.0418 seconds, or about 41.8 milliseconds, at the H100's peak HBM3 bandwidth of 3.35 TB/s. During those 41.8 ms, the chip performs roughly 140 GFLOPs of arithmetic, because each weight is used in approximately two operations, one multiply and one accumulate. The H100's peak FP16 throughput is 989 TFLOPS, which means the chip's theoretical capacity over the same time window is 989,000 x 0.0418 ≈ 41,340 GFLOPs. The ratio of actual work to theoretical capacity is 140 / 41,340 ≈ 0.34%. The remaining 99.66% of Tensor Core capacity goes unused while the next weight tile loads from HBM.The calculation only counts weight traffic. KV cache reads, activation traffic, and other memory transfers add to the total bytes loaded per step, but at small batch sizes and modest context lengths, weights dominate by one to two orders of magnitude. The 0.34% figure is the floor on utilization under the most generous assumption that nothing besides weights touches HBM. Real workloads at long context push the denominator up and the utilization down.A short version of the same calculation is worth keeping in mind for any model.Weights size in bytes equals parameter count times bytes per parameter.Time per token equals weights size divided by HBM bandwidth.Useful work per token equals roughly two operations per parameter.Peak work in the same time window equals peak FLOPS times the time per token.Utilization equals useful work divided by peak work.The structure of the calculation explains why decode performance tracks bandwidth rather than FLOPS. The numerator depends on the model’s parameter count, the denominator depends on the chip’s bandwidth, and the time per token cancels out of the utilization ratio entirely. Doubling the chip’s peak FLOPS while leaving bandwidth unchanged would leave the time per token and the work performed unchanged. The gap between actual and peak utilization would widen instead. The same logic underlies the H200 thought experiment from the previous chapter, viewed from the other side.Decode also explains why inference acceleration research clusters around a narrow set of techniques. The runtime is set by bandwidth times bytes loaded, which means the available ways to make decode faster are to load fewer bytes through quantization or KV cache compression, to load the same bytes more usefully through batching or speculative decoding, or to skip layers entirely. None of these techniques change the FLOPS rating of the chip, because FLOPS were never the constraint in the first place. The next chapter walks through how the KV cache, batch size, and quantization act as the three main levers practitioners pull to push decode workloads back toward the ridge point.4. KV Cache, Batch Size, and Quantization4.1 KV cache as the second memory pressureDecode reads two things from HBM on every token. The weights are the first, and the previous chapter walked through how they set the floor on time per token for any given model and chip. The KV cache is the second, and its size grows with both the number of concurrent requests and the length of each request’s history. For long contexts or large batches, the KV cache can exceed the weight memory itself, at which point the cache becomes the dominant source of bandwidth pressure rather than the weights.Cache size follows directly from the attention mechanism. For each token in each request, the model stores one key vector and one value vector per layer per attention head, and these vectors get read on every subsequent decode step. The formula is 2 x L x H x D x S x B x bytes_per_element, where L is the number of layers, H is the number of attention heads, D is the dimension per head, S is the sequence length, B is the batch size, and the factor of 2 accounts for storing both keys and values. The 2 also reflects the fact that nothing else gets cached. Activations, gradients, and intermediate states are recomputed every step.Llama 3 70B at a 32K context illustrates how aggressive the scaling is. The model has 80 layers, 8 KV heads under GQA, and 128 dimensions per head. At FP16, that works out to 2 x 80 x 8 x 128 x 32,768 x 2 = 10.7 GB of KV cache per request. At a batch size of 8, the cache occupies 86 GB, which exceeds the H100's 80 GB of HBM3 entirely. The model weights have not even loaded yet.GQA and KV cache quantization are the two main architectural responses to this pressure. Grouped Query Attention shares keys and values across multiple query heads, which directly reduces H in the formula. Llama 3 70B uses 64 query heads but only 8 KV heads, an 8x reduction in cache size compared to multi-head attention with full key-value heads per query. KV cache quantization stores the cache in 8-bit or 4-bit formats rather than FP16, which cuts bytes per element by 2x or 4x at the cost of some precision in the attention scores. Production stacks like vLLM and TensorRT-LLM support both, and the choice tends to come down to how much quality degradation a given application can tolerate.4.2 Batch size as the control variableBatch size determines which regime decode operates in, because increasing the batch size amortizes weight reads across multiple requests without changing how many bytes get loaded. At batch size 1, the chip reads 140 GB of weights to produce one token, giving an arithmetic intensity of roughly 1 op/byte. At batch size 32, the same 140 GB read produces 32 tokens, raising the effective intensity to 32 ops/byte. The chip still sits below the FP16 ridge point of 295, but the gap has closed by a factor of 32.The transition out of the memory-bound regime happens around batch size 128 to 256 for typical 70B-class models on an H100. At that scale, weight reuse across the batch raises arithmetic intensity into the hundreds, and the workload starts to behave more like prefill, with Tensor Cores becoming the binding constraint rather than HBM. The H200 advantage over the H100 narrows in this regime, because the two chips have identical compute specifications, and bandwidth stops being the limiting factor once the workload moves above the ridge point. The same logic explains why the H100 and H200 look nearly identical on training benchmarks, where arithmetic intensities are already in the hundreds.But production rarely reaches these high batch sizes for two reasons. The first is KV cache footprint. At Llama 3 70B with a 32K context, a batch of 128 would require roughly 1.4 TB of KV cache, which is impossible to fit on any single GPU and difficult to fit even across an 8-GPU node without aggressive cache compression or offloading. The second reason is inter-token latency. Larger batches share the same forward pass, which means every request in the batch waits for the slowest request to complete each step. Doubling the batch size tends to roughly double the time per token, even though throughput in tokens per second goes up. Real-time applications with strict latency budgets, like chat interfaces or voice assistants, cap batch size well below the compute-bound transition for this reason, and they accept the lower utilization as the cost of keeping responses fast.The practical consequence is that most production deployments live firmly in the memory-bound region. Throughput-oriented batch services, like overnight document processing or large-scale evaluation, can push toward the ridge point. Latency-oriented services cannot. The choice between the two regimes is a deployment decision rather than a hardware decision, and it determines which optimizations actually help for a given workload.4.3 Quantization as the bandwidth multiplierQuantization speeds up decode by reducing bytes per parameter, which directly reduces the time per token in the memory-bound regime. The relationship is linear. Moving from FP16 to FP8 halves the weight footprint, which halves the bytes read per decode step, which halves the time per token at constant bandwidth. The same logic applies to FP4 and INT4, where the savings compound further at the cost of additional quality degradation.The mechanism worth understanding is that quantization helps decode even when the Tensor Cores were already idle. The previous section derived a utilization figure of 0.34% for FP16 decode on a 70B model. Halving the bytes per weight to FP8 does not raise that utilization, because the time per token also halves, and useful work per token stays the same. What changes is the absolute throughput. The chip produces tokens twice as fast, even though the Tensor Cores are doing the same proportional amount of work as before. The bandwidth-bound regime makes byte count the relevant metric, and quantization is the most direct lever for reducing it.Quantization shows up in every production inference stack for this reason, and most public LLM APIs run quantized models by default. The throughput gain is large, the implementation is well-understood, and the quality cost on well-calibrated quantization schemes is often small enough to be acceptable for most applications. Methods like GPTQ, AWQ, and bitsandbytes NF4 differ in how they choose quantization scales and how they handle outliers in the weight distribution, but all of them exploit the same underlying observation. In a workload where bandwidth is the binding constraint, the size of the data being moved sets the runtime, and any technique that reduces that size translates almost directly into faster inference.5. Closing ThoughtsThe framework from these four chapters is enough to reason about a new chip, a new model, or a new optimization before running it. Arithmetic intensity, ridge points, and the memory wall describe the analytical lens. Prefill and decode show how a single model splits across the lens’s two regimes. KV cache pressure, batch size, and quantization explain why production inference looks the way it does, and why every inference acceleration paper in the last three years has clustered around the same handful of techniques. The next article in this series turns to the transformer itself from the inference perspective, walking through the attention math, the KV cache mechanics, and the VRAM accounting in enough detail to predict the memory footprint of any model from its architecture alone.Connect with me, www.linkedin.com/in/suchitra-iduminaWhy An AI Model Only Uses 0.34% of The GPU Compute: How GPUs Actually Work, Part 2 was originally published in Towards AI on Medium, where people are continuing the conversation by highlighting and responding to this story.