Navigation
🏋️ Training Systems· 10 min read

Cluster Efficiency Metrics

MFU, GPU utilization, bubble ratio, communication overhead — measuring and diagnosing what's limiting your training throughput.

mfugpu-utilizationefficiencymetricsthroughputbottleneck

You can’t optimize what you can’t measure. This chapter defines the key efficiency metrics for large-scale training and shows how to diagnose which bottleneck is limiting your throughput.


1. Model FLOPS Utilization (MFU)

MFU is the gold standard metric — it measures what fraction of the GPU’s peak compute you’re actually using for useful model computation:

MFU=Model FLOPs per step×steps per secondGPU peak FLOPS×num GPUs\text{MFU} = \frac{\text{Model FLOPs per step} \times \text{steps per second}}{\text{GPU peak FLOPS} \times \text{num GPUs}}

Calculating Model FLOPs

For a Transformer with Ψ\Psi parameters, batch size BB, sequence length SS:

FLOPs per step≈6×Ψ×B×S\text{FLOPs per step} \approx 6 \times \Psi \times B \times S

The factor of 6 comes from: 2× (multiply-add) × 3× (forward + backward = 3× forward).

Worked Example: 70B on 64× H100

Llama-2 70B, global batch = 1024 sequences × 4096 tokens = 4.2M tokens:

FLOPs per step=6×70×109×4.2×106=1.76×1018\text{FLOPs per step} = 6 \times 70 \times 10^9 \times 4.2 \times 10^6 = 1.76 \times 10^{18}

Step time (measured): 2.8 seconds.

MFU=1.76×1018989×1012×64×2.8=1.76×10181.77×1017≈39.5%\text{MFU} = \frac{1.76 \times 10^{18}}{989 \times 10^{12} \times 64 \times 2.8} = \frac{1.76 \times 10^{18}}{1.77 \times 10^{17}} \approx \textbf{39.5\%}

This matches reported values for well-optimized 70B training on H100 clusters.

Note on batch size: MFU depends heavily on batch size. Larger batches amortize communication overhead and pipeline bubbles over more compute. Most large-scale training uses millions of tokens per step.

Typical MFU values:

ConfigurationMFUNotes
Single GPU, no parallelism50-60%Best possible (no comm overhead)
8 GPUs, TP=840-50%TP AllReduce overhead
64 GPUs, TP=8, DP=835-45%TP + DP overhead
256 GPUs, TP=8, PP=4, DP=830-40%All overheads + pipeline bubble
10K GPUs25-35%Failure overhead, larger bubbles

Meta reported 38-43% MFU for Llama-3.1 405B training on 16K H100 GPUs.


2. GPU Utilization

nvidia-smi reports “GPU utilization” — but this is not MFU. It measures the fraction of time at least one kernel is running, which is nearly always ~100% during training (even idle waiting counts as “utilized” if a kernel is queued).

More useful GPU metrics:

MetricWhat it measuresHow to get it
SM occupancyFraction of SMs with active warpsNsight Compute
Tensor Core utilizationFraction of time Tensor Cores are busyNsight Systems
Memory bandwidth utilizationFraction of peak HBM bandwidth usedNsight Compute
MFUUseful compute / peak computeCalculate from step time

3. Diagnosing Bottlenecks

The Efficiency Waterfall

Efficiency Waterfall

Theoretical peak (100%)
  │
  ├── -5%  Precision overhead (BF16 vs FP32 peak) → 95%
  ├── -10% TP communication → 85%
  ├── -5%  DP communication → 80%
  ├── -8%  Pipeline bubble → 72%
  ├── -5%  Memory-bound layers (LayerNorm, etc.) → 67%
  ├── -5%  Framework overhead (Python, scheduling) → 62%
  ├── -3%  CUDA graph overhead → 59%
  ├── -2%  Checkpointing → 57%
  ├── -2%  Failure recovery → 55%
  └── Actual MFU: ~55% (good single-node), ~35% (multi-node)

Identifying the Bottleneck

SymptomLikely bottleneckDiagnostic tool
Low MFU but high GPU utilCommunication overlap insufficientNsight Systems trace
Step time increases with more GPUsCommunication scaling poorlynccl-tests bandwidth
Step time varies between stepsLoad imbalance or garbage collectionPyTorch profiler
GPU temp throttlingCooling insufficientnvidia-smi -q -d TEMPERATURE
Periodic slowdownsCheckpointing or loggingProfiler + checkpoint timing

4. Throughput Metrics

MetricFormulaTarget
Tokens/secondB×S/step_timeB \times S / \text{step\_time}Maximize
Tokens/GPU/secondTokens/second / num_GPUsLinear scaling ideal
Scaling efficiency(N GPU throughput) / (N × 1 GPU throughput)>80%
Time to trainTotal tokens / tokens per secondMinimize
Cost to trainGPU-hours × price per GPU-hourMinimize

Goodput: The Ultimate Metric

Goodput = useful training compute / total compute time. It accounts for:

  • Pipeline bubbles
  • Communication overhead
  • Failure recovery (lost work + restart time)
  • Checkpointing overhead
Goodput=MFU×(1−failure_overhead)×(1−checkpoint_overhead)\text{Goodput} = \text{MFU} \times (1 - \text{failure\_overhead}) \times (1 - \text{checkpoint\_overhead})

For profiling tools to measure these metrics, see PyTorch Profiler and Nsight Systems.


Self-Check

  • Calculate MFU for a given model, batch size, and cluster configuration
  • Explain why nvidia-smi GPU utilization is misleading for training efficiency
  • Walk through the efficiency waterfall for a multi-node training setup
  • Identify the bottleneck from profiler symptoms
  • Calculate goodput accounting for failures and checkpointing

References