What is MFU, and how do you measure GPU efficiency? A developer at Nodus Compute published a guide explaining how to measure Model FLOPs utilization (MFU) on GPUs, deriving the per-token FLOP formula (6N + 12LHQT) from Google's PaLM paper and showing that attention costs add 27% more work for Llama 3 8B at 8,192-token context. The guide warns that using NVIDIA's sparse BF16 peak figures instead of dense halves reported MFU, and distinguishes MFU from hardware FLOPs utilization and nvidia-smi's time-based GPU utilization. Model FLOPs utilization MFU is the share of a GPU's peak dense math that your training run turns into model arithmetic: tokens per second, times FLOPs per token, divided by peak FLOPs. On Nodus, where an NVIDIA H100 SXM is listed at $2.60/hr on the pricing page https://www.nodus-compute.ai/pricing/ , raising MFU from 30% to 40% cuts the cost of a billion trained tokens by a quarter. It is the most honest efficiency number you can log, because it counts work done, not time the GPU looked busy. MFU comes from Google's PaLM paper https://arxiv.org/abs/2204.02311 , and its Appendix B gives the exact formula. A dense decoder-only model with N parameters needs 6N matmul FLOPs per training token: 2N for the forward pass and 4N for the backward pass. Self-attention adds 12 × L × H × Q × T per token, where L is layers, H is attention heads, Q is head dimension and T is sequence length. So the per-token cost is 6N + 12LHQT, and MFU is: MFU = tokens per second 6N + 12 L H Q T / peak flops per second The paper calls the attention term "a much smaller value for large models". That stops being true at long context. H × Q equals the model dimension, and Meta's Llama 3 8B has 32 layers and a model dimension of 4,096, per the Llama 3 paper https://arxiv.org/abs/2407.21783 . At 8,192 tokens of context, attention for that shape adds 12 × 32 × 4,096 × 8,192 = 12.88 GFLOPs per token. Against 6 × 8 billion = 48 GFLOPs, that is 27% more work. Leave it out and you understate MFU by the same ratio. For inference, a forward pass is one third of the training cost: 2N + 4LHQT per token. N should count parameters that do matrix multiplies. An input embedding table is a lookup, so leave it out; keep the output projection. Use the dense BF16 Tensor Core figure for the exact card, and check for an asterisk. NVIDIA's H100 page https://www.nvidia.com/en-us/data-center/h100/ lists 1,979 teraFLOPS of BF16 for the H100 SXM, marked "With sparsity". Dense is half, so 989 teraFLOPS. The HGX page https://www.nvidia.com/en-us/data-center/hgx/ lists 36 petaFLOPS of BF16 for an 8-GPU B200 board and says "Dense is ½ sparse spec shown", which gives 2,250 teraFLOPS per B200. Plugging the sparse figure in is the most common MFU mistake. It halves your reported number and makes a healthy run look broken. Match the precision too: if you train in FP8, say so and use the FP8 peak, because a BF16 MFU and an FP8 MFU are not comparable. The three numbers answer different questions, and only MFU is comparable across codebases. Hardware FLOPs utilization HFU counts every FLOP the GPU executes, including recomputation. With activation checkpointing, the forward pass runs twice, so HFU is higher than MFU for the same run. PaLM 540B reported 46.2% MFU and 57.8% HFU. The paper prefers MFU because it depends only on observed tokens per second, the architecture and the published peak, so runs on different systems compare fairly. nvidia-smi's "GPU utilization" is a time measure. NVIDIA's nvidia-smi documentation https://docs.nvidia.com/deploy/nvidia-smi/index.html defines it as the "percent of time over the past sample period during which one or more kernels was executing". A run can show 95% there and still have low MFU, because a small kernel counts as busy. Low nvidia-smi utilization usually means a starved input pipeline, which our post on low GPU utilization in PyTorch https://www.nodus-compute.ai/blog/low-gpu-utilization-pytorch/ walks through. Count tokens per GPU, time a window of steps, and synchronize the GPU only when you log. CUDA launches are asynchronous, so a timer without a sync measures how fast Python queued work, not how fast the GPU did it. We ran this code on a toy model on CPU to check that it executes; the numbers it prints on your GPU are yours to measure. python import time import torch Dense BF16 Tensor Core peak per GPU. NVIDIA lists sparse figures; dense is half. PEAK BF16 = {"H100 SXM": 989e12, "B200": 2250e12} def flops per token n params, n layers, d model, seq len, training=True : """PaLM Appendix B : 6N + 12 L H Q T per trained token, with H Q = d model. A forward pass alone is one third of that: 2N + 4 L H Q T.""" attn = 12 n layers d model seq len return 6 n params + attn if training else 2 n params + attn / 3 class MFUMeter: """Call step tokens once per optimizer step with this GPU's tokens.""" def init self, fpt, peak, usd per gpu hr=None, every=50, skip=1 : self.fpt, self.peak, self.rate = fpt, peak, usd per gpu hr self.every, self.skip = every, skip skip=1 drops the warm-up window self.n, self.tokens, self.t0 = 0, 0, None def step self, tokens : self.n += 1 if self.t0 is None: start the clock after step 1 self. sync ; self.t0 = time.perf counter ; return self.tokens += tokens if self.n % self.every: return self. sync sync only when logging dt = time.perf counter - self.t0 tps = self.tokens / dt mfu = tps self.fpt / self.peak msg = f"step {self.n} tok/s/GPU {tps:,.0f} MFU {mfu:.1%}" if self.rate: msg += f" $/B tok {self.rate / tps 3600 1e9:,.2f}" if self.skip 0: self.skip -= 1 first window includes compile/warm-up else: print msg, flush=True self.tokens, self.t0 = 0, time.perf counter @staticmethod def sync : if torch.cuda.is available : torch.cuda.synchronize Create the meter once, then call it after each optimizer step: fpt = flops per token n params=8e9, n layers=32, d model=4096, seq len=8192 meter = MFUMeter fpt, PEAK BF16 "H100 SXM" , usd per gpu hr=2.60 inside the loop, after optimizer.step : meter.step batch size seq len this rank's tokens only With data parallelism, each rank logs its own per-GPU MFU, which equals cluster MFU when ranks are balanced. Count real tokens, not padding: if you pad sequences, padded positions inflate the token count. On Nodus, anything the job prints to stdout is kept as its log and stays readable with nodus logs -f job/NAME after the run finishes, as the logs and metrics docs https://www.nodus-compute.ai/docs/guides/logs/ describe. Take one illustrative reading, not a benchmark we ran: an 8-billion-parameter model shaped like Llama 3 8B, 8,192-token sequences, 6,000 tokens per second per H100 SXM. We round N to 8 billion so the arithmetic stays readable. One measurement, three answers: always say which formula and which peak you used. Now hold the model fixed and vary MFU. Tokens per second is MFU × peak / 60.88 GFLOPs, and cost per billion tokens is the hourly rate divided by tokens per hour. At Nodus list rates for the H100 SXM $2.60/hr and B200 $5.50/hr : | MFU | H100 SXM tok/s/GPU | H100 SXM $/B tokens | B200 tok/s/GPU | B200 $/B tokens | |---|---|---|---|---| | 20% | 3,249 | $222.31 | 7,391 | $206.71 | | 30% | 4,873 | $148.21 | 11,087 | $137.81 | | 40% | 6,498 | $111.15 | 14,782 | $103.35 | | 50% | 8,122 | $88.92 | 18,478 | $82.68 | Prices checked December 5, 2026 on the Nodus pricing page https://www.nodus-compute.ai/pricing/ . Peaks from NVIDIA's H100 and HGX pages. Going from 20% to 40% MFU halves the bill on either card; changing cards at the same MFU moves it about 7%. Cost scales with 1 / MFU, so the move from 20% to 40% saves more than any GPU swap in the table. At equal MFU the B200 is about 7% cheaper per token, because $5.50 buys 2,250 dense teraFLOPS per hour against $2.60 for 989. Real MFU differs between generations, so measure both before you switch. To turn a cost per token into a whole-run budget and a spend cap, use our LLM training cost calculator https://www.nodus-compute.ai/blog/llm-training-cost-calculator/ . Published large runs land between about 20% and 46%. PaLM's Table 3 lists GPT-3 at 21.3%, Gopher at 32.5%, Megatron-Turing NLG 530B at 30.2% and PaLM 540B at 46.2%. The Llama 3 paper reports 38% to 43% BF16 MFU for the 405B model: 43% on 8,192 H100s, then 41% and 38% on 16,384, the lowest at 131,072-token context. The best published runs reach 38% to 46%; 30% is a realistic plan for a dense model. Our rule of thumb for a dense transformer of 1 billion parameters or more, trained in BF16, is set from those published figures rather than from a benchmark of ours: Smaller models and small batches score lower for structural reasons, so compare against your own baseline as well as these bands. MFU is the wrong yardstick for small-batch decoding. At batch size 1, each new token reads every weight once. An 8B model holds 16 GB of BF16 weights, and NVIDIA's H100 page lists 3.35 TB/s of memory bandwidth for the SXM card, so decode tops out near 209 tokens per second. That is 2 × 8 billion × 209 = 3.34 teraFLOPS, or 0.3% MFU. For inference, track tokens per second per dollar and latency instead. PaLM's definition does, through the 12LHQT term. Some codebases report the 6N version only, so state which one you used before comparing numbers. It usually lowers MFU and raises HFU, because recomputed forward passes take time but do not count as model FLOPs. It can still pay off: PaLM used rematerialization because the larger batch it allowed gave higher training throughput. Not if the inputs are right. A value above 100% usually means padded tokens were counted, tokens from all GPUs were divided by one GPU's peak, or N was overstated. MFU depends on your model and token count, so compute it in your training loop and print it. Nodus keeps that output in the job log, and nodus top shows GPU use and $/H for running jobs beside it. Originally published on the Nodus blog https://www.nodus-compute.ai/blog/what-is-mfu/ .