What is model floating-point operations utilisation (MFU)?
Model FLOPS utilisation (MFU) is the ratio of the tokens per second a training system actually processes to the theoretical maximum at peak Floating-Point Operations Per Second. That maximum counts only the model's forward and backward pass operations, so the metric is implementation independent and allows fair comparisons across systems.
Unlike hardware FLOPS utilisation (HFU), MFU ignores the extra work of recomputing activations to save memory, so in runs that recompute HFU comes out higher.
- Topic
- Infrastructure and runtime
- Also known as
- MFU, model FLOP utilisation
- Origin
- 2022 large language model scaling study
How model floating-point operations utilisation (MFU) works
- Count operations per token: excluding self-attention, an N parameter decoder-only model needs 6N, 2N forward and 4N backward.
- Divide the accelerators' combined peak matrix multiplication rate by that figure to get the theoretical maximum tokens per second.
- Divide the measured tokens per second by that maximum; the result is MFU.
In more detail
Why recomputation is not counted
The backward pass needs intermediate activations kept in memory; if they do not all fit, some forward pass operations are recomputed. This saves memory but costs extra hardware operations. The real goal of a training system is not to run as many hardware operations as possible but to process many tokens per second and finish training quickly, so MFU counts only the operations the model itself needs.
Commonly confused terms
| Term | How it differs |
|---|---|
| GPU utilisation | GPU utilisation shows how much of a time window the GPU was busy. MFU measures how close the operations the model needs came to the hardware's peak capacity in that time; a GPU that looks busy can still be running at low MFU. |
Why model floating-point operations utilisation (MFU) matters for on-premises AI
The 2022 study that proposed MFU noted that hardware operation counts depend on the system, implementation and even compiler choices; it reported 46.2% MFU when training its 540 billion parameter model. Another study that year, training a 530 billion parameter model on 2240 GPUs, raised MFU from 42.1% with recomputation to 54.2%. In on-premise AI infrastructure, MFU shows how much purchased compute becomes model training.
A telecoms company running continued pre-training of a language model in its own data centre logs tokens per second and computes MFU. When MFU falls short, the team reviews data loading and parallelism settings and compares each change with the same metric.
Common questions
How is MFU calculated?
Observed tokens per second are divided by the theoretical tokens per second the hardware could reach at peak FLOPS. The theoretical figure comes from the number of operations the model needs per token.
Why is MFU suited to comparing different systems?
Its numerator is simply observed tokens per second, while its denominator depends only on the model architecture and the published peak FLOPS of the hardware. Compiler or recomputation choices therefore do not distort it.
Why do MFU and hardware FLOPS utilisation differ?
Hardware FLOPS utilisation also counts the operations of activations recomputed to save memory. MFU does not, so in the same run it comes out lower. The study that proposed MFU, for example, reported 46.2% MFU against 57.8% hardware FLOPS utilisation.
Related terms
- AI floating-point operations per second (FLOPS)
- AI graphics processing unit (GPU) utilisation
- AI throughput
- Distributed training
- Gradient checkpointing
Sources
- PaLM: Scaling Language Modeling with Pathways, arXiv, 2022
- Reducing Activation Recomputation in Large Transformer Models, arXiv, 2022
In the glossary: Glossary, M to Q