Hardware
FP8 vs FP16: AI Number Formats Explained
FP8 vs FP16 explained: bits, range and precision, speed and memory, FP8 vs BF16, FP16 vs FP32, which GPUs support FP8, and when to use each for AI models.
In FP8 vs FP16, both are floating-point number formats used to store and compute AI model weights and activations. FP16 uses 16 bits per number and FP8 uses 8, so FP8 halves memory use and, on GPUs with FP8 hardware, roughly doubles peak math throughput. The price is precision: FP8 keeps far fewer significant digits and a narrower range, so it needs careful scaling and works best for inference and for the bulk of training math, with sensitive parts kept in higher precision. FP16, or more often its cousin BF16, remains the safe default.
This guide explains how these formats are built, compares FP8 vs FP16 with real numbers, covers FP8 vs BF16 and FP16 vs BF16, the difference between FP16 and FP32, which hardware supports FP8, what the choice means in practice for LLMs and for image models (including FP8 vs FP16 in ComfyUI), and how to decide.
FP8 vs FP16 at a Glance
| FP32 | FP16 | BF16 | FP8 E4M3 | FP8 E5M2 | FP4 (E2M1) | |
|---|---|---|---|---|---|---|
| Total bits | 32 | 16 | 16 | 8 | 8 | 4 |
| Sign / exponent / mantissa bits | 1 / 8 / 23 | 1 / 5 / 10 | 1 / 8 / 7 | 1 / 4 / 3 | 1 / 5 / 2 | 1 / 2 / 1 |
| Largest normal value | about 3.4 × 10³⁸ | 65,504 | about 3.4 × 10³⁸ | 448 | 57,344 | 6 |
| Precision (rough decimal digits) | about 7 | about 3 | about 2 to 3 | about 1 | under 1 | very low |
| Bytes per value | 4 | 2 | 2 | 1 | 1 | 0.5 |
| Memory for a 70B-parameter model's weights | about 280 GB | about 140 GB | about 140 GB | about 70 GB | about 70 GB | about 35 GB |
| Typical AI use | Master weights, optimizer state, sensitive ops | Inference, older mixed-precision training | Training and inference default | FP8 inference and forward pass in FP8 training | Gradients in FP8 training | Block-scaled inference on newest GPUs |
The largest values follow from the bit layouts: FP16's 5 exponent bits top out at 65,504; E4M3 gives up infinity to reach 448; E5M2 keeps IEEE-style special values and reaches 57,344. The NVIDIA, Arm and Intel paper "FP8 Formats for Deep Learning" (Micikevicius et al.) defined the two FP8 encodings and reported that FP8 training matched 16-bit result quality across image and language models up to 175 billion parameters.
How Floating-Point Formats Work
Every floating-point number has three parts:
- Sign bit: positive or negative.
- Exponent bits: set the scale, how big or small the number can be. More exponent bits mean more range.
- Mantissa bits: set the precision, how many significant digits you keep. More mantissa bits mean finer steps between representable numbers.
Shrinking from 16 to 8 bits forces a trade between range and precision. E4M3 keeps more precision with less range; E5M2 keeps the range of FP16 with very little precision. That's why FP8 training typically uses E4M3 for weights and activations in the forward pass and E5M2 for gradients, which vary over a wider range.
FP8 vs FP16: Speed, Memory and Accuracy
Memory: FP8 uses half the memory of FP16 for whatever you store in it: weights, activations or the KV cache. A model that needs two GPUs in FP16 may fit on one in FP8, and an FP8 KV cache holds twice as many tokens of context in the same memory.
Compute: on GPUs with native FP8 Tensor Cores, FP8 matrix math runs at about twice the peak rate of FP16. Real speedups are usually smaller. For LLM inference at small batch sizes, the bottleneck is reading weights from memory, so halving the bytes helps a lot, but other parts of the pipeline don't speed up, and attention, normalization and sampling often stay in higher precision.
Accuracy: 16-bit to 8-bit is a big drop in precision, but neural networks tolerate it well when values are scaled into FP8's narrow range. With per-tensor or finer-grained scaling factors, FP8 inference on large language models typically loses little measurable quality; smaller models and some tasks are more sensitive, so test on your own workload. Without scaling, values outside FP8's range overflow or vanish.
Scaling is what makes FP8 work
Because E4M3 only reaches 448, values have to be multiplied by a scaling factor before conversion and divided back afterwards. Approaches have grown finer over time:
| Scaling approach | Where the scale applies | Notes |
|---|---|---|
| Per-tensor (delayed or current) | One scale for a whole tensor | The original FP8 recipe on Hopper GPUs |
| Fine-grained blocks | Small tiles of a tensor | Used in DeepSeek-V3's FP8 training to handle outliers |
| MXFP8 | 32-element blocks, power-of-two (E8M0) scale | Hardware-supported on Nvidia Blackwell |
| NVFP4 | 16-element blocks with an FP8 E4M3 scale, plus a per-tensor FP32 scale | 4-bit format on Blackwell; scaling is what keeps it usable |
Sources: NVIDIA Transformer Engine documentation; DeepSeek-V3 technical report.
FP8 vs BF16
BF16 (brain floating point) keeps FP32's 8-bit exponent and so its huge range, with only 7 mantissa bits. That combination made BF16 the standard for training: no overflow worries, no loss scaling, and half the memory of FP32.
FP8 vs BF16 is the comparison that matters for most modern AI work:
- BF16 is the safe, simple default for training and serving. Nearly every model is released in BF16.
- FP8 halves memory and raises throughput again but needs scaling, calibration and supported hardware.
- In training, the common pattern is to run the large matrix multiplications in FP8 while keeping master weights, gradient accumulation and optimizer states in BF16 or FP32. DeepSeek-V3's technical report describes an FP8 mixed-precision framework of this kind and called it the first validation of FP8 training on an extremely large-scale model.
- In serving, many providers deploy FP8 versions of BF16 models to cut cost per token, after checking quality on benchmarks.
FP16 vs BF16
Both use 16 bits, but they split them differently. FP16 has 5 exponent bits and 10 mantissa bits; BF16 has 8 and 7.
| FP16 | BF16 | |
|---|---|---|
| Range | Up to 65,504; small values underflow easily | Same range as FP32 |
| Precision | Higher (10 mantissa bits) | Lower (7 mantissa bits) |
| Training | Needs loss scaling to avoid underflow of small gradients | Usually trains without loss scaling |
| Hardware | Supported almost everywhere | Supported on recent Nvidia (Ampere and later), AMD, TPUs and Apple chips |
| Best for | Inference on older GPUs; image models released in FP16 | Training and modern LLM inference |
For image generation, FP16 and BF16 usually give visually similar results; differences tend to show up as occasional overflow artifacts in FP16 or slightly different fine detail. Use whichever the model was released in, unless your GPU lacks BF16 support.
The Difference Between FP16 and FP32
FP32 (single precision) uses 32 bits: 8 for the exponent and 23 for the mantissa, about 7 significant decimal digits. FP16 halves memory and bandwidth but keeps only about 3 digits and a much smaller range.
The difference between FP16 and FP32 matters most in training. Summing millions of tiny gradient updates in FP16 loses information, which is why mixed-precision training keeps a master copy of weights in FP32 and accumulates in FP32 while doing the heavy math in 16-bit. For inference, FP32 is rarely needed: 16-bit or lower gives the same answers far faster. FP64 (double precision) belongs to scientific computing and is almost never used in AI.
Which GPUs Support FP8?
FP8 only speeds things up on hardware that can compute in it natively.
| Hardware | Native FP8 math | Notes |
|---|---|---|
| Nvidia Hopper (H100, H200) | Yes | First data-center generation with FP8 Tensor Cores |
| Nvidia Ada Lovelace (RTX 40 series, L4, L40S) | Yes | Consumer and workstation cards with FP8 |
| Nvidia Blackwell (B200, B300, RTX 50 series) | Yes | Adds MXFP8, FP6 and FP4 (NVFP4) |
| Nvidia Ampere (A100, RTX 30 series) and older | No | FP8 files can be stored, but math runs in 16-bit after conversion |
| AMD Instinct MI300 series (CDNA 3) | Yes | Uses the FNUZ variant of FP8 per AMD's ROCm docs |
| Apple silicon, most CPUs | No native FP8 matrix math | Use 16-bit or integer quantization |
On GPUs without FP8 math, FP8 model files still help: they halve the VRAM needed to hold weights, and the GPU converts them to 16-bit on the fly. You save memory, not compute.
FP8 vs FP16 in ComfyUI and Image Models
Image and video models are often shared in both FP16 and FP8 versions. In ComfyUI, the core "Load Diffusion Model" node has a weight_dtype setting with four options in its source code: default, fp8_e4m3fn, fp8_e4m3fn_fast and fp8_e5m2. default loads weights in the precision the file was saved in; the FP8 options store weights in FP8 to save VRAM.
People who search for fp8 vs fp16 comfyui settings usually want to know three things: memory, speed and quality. What to expect:
- VRAM: FP8 weights use about half the memory, which can make large image or video models fit on 12 to 16 GB cards.
- Speed: on RTX 40 and 50 series cards, FP8 can also be faster; on RTX 30 series and older, it saves memory but computes in 16-bit, so it can be no faster or slightly slower.
- Quality: FP8 versions usually look very close to FP16, with occasional loss of fine detail or small color shifts. Compare the same seed and prompt before committing.
- Text encoders are often more sensitive than the diffusion model itself; keep them in FP16 or BF16 if you have the memory.
Our guide to the best GPU for Stable Diffusion covers how much VRAM image and video workflows need.
Worked Example: Memory for a Local LLM
Weight memory is parameters × bytes per value. Here's what common formats need for the weights alone, before the KV cache and runtime overhead:
| Model size | FP16 or BF16 (2 bytes) | FP8 (1 byte) | 4-bit (about 0.5 bytes) |
|---|---|---|---|
| 8B parameters | 16 GB | 8 GB | about 4 to 5 GB |
| 32B parameters | 64 GB | 32 GB | about 16 to 18 GB |
| 70B parameters | 140 GB | 70 GB | about 35 to 40 GB |
A 70B model in FP16 needs two 80 GB data-center GPUs just for weights; in FP8 it fits on one, with room left for the KV cache. That one change can halve serving cost. Integer 4-bit formats like those in GGUF files go further for local use; our explainer on LLM quantization compares those options.
When to Use FP8 and When to Use FP16
Use FP8 when:
- You serve LLMs on Hopper, Ada or Blackwell GPUs and want lower cost per token.
- A model doesn't fit in VRAM at 16-bit and an FP8 version is available.
- You train very large models with a framework that supports FP8 recipes, such as Transformer Engine, and can validate quality.
- You want a larger KV cache for longer contexts or more concurrent users.
Use FP16 or BF16 when:
- You're fine-tuning or training without an established FP8 recipe.
- Accuracy is critical and you haven't measured FP8's impact on your task.
- Your hardware has no FP8 support and memory isn't the constraint.
- You're working with small models, which tend to lose more from aggressive precision cuts.
Common Mistakes
- Expecting a 2x speedup everywhere. Gains depend on hardware support and on whether your workload is limited by compute or memory.
- Converting without scaling or calibration. Naive casting to FP8 clips large values and destroys small ones.
- Using FP16 for training without loss scaling. Small gradients underflow; use BF16 or loss scaling.
- Comparing FLOPS across precisions. An FP8 or FP4 TFLOPS figure isn't comparable to an FP16 one.
- Assuming FP8 files make old GPUs faster. They save memory; math still runs in 16-bit.
- Skipping evaluation. Always compare outputs on your own prompts, images or benchmark before switching formats in production.
FAQ
Is FP8 better than FP16?
It's smaller and faster on supported hardware, but less precise. FP8 is better when memory and throughput matter and quality holds on your task; FP16 or BF16 is better when you need maximum accuracy or lack FP8 hardware.
What is the difference between FP8 E4M3 and E5M2?
E4M3 has 4 exponent and 3 mantissa bits: more precision, maximum value 448, no infinity. E5M2 has 5 exponent and 2 mantissa bits: more range, maximum 57,344, less precision. Training recipes usually use E4M3 for weights and activations and E5M2 for gradients.
Does FP8 reduce quality?
Usually a little. With proper scaling, large language models typically show small differences on benchmarks, while small models and some image details can be more sensitive. Test on your own workload.
Can I use FP8 models on an RTX 3090?
Yes, for memory savings: FP8 weights load and are converted to 16-bit for computation, because Ampere GPUs lack FP8 Tensor Cores. You won't get FP8 compute speedups.
Is BF16 better than FP16?
For training, usually yes, because BF16 has FP32's range and rarely overflows or underflows. FP16 has more precision and wider hardware support, which can matter for inference on older GPUs.