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.

By OmniAI Editorial · Nov 22, 2026 · 12 min read

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

FP32FP16BF16FP8 E4M3FP8 E5M2FP4 (E2M1)
Total bits321616884
Sign / exponent / mantissa bits1 / 8 / 231 / 5 / 101 / 8 / 71 / 4 / 31 / 5 / 21 / 2 / 1
Largest normal valueabout 3.4 × 10³⁸65,504about 3.4 × 10³⁸44857,3446
Precision (rough decimal digits)about 7about 3about 2 to 3about 1under 1very low
Bytes per value422110.5
Memory for a 70B-parameter model's weightsabout 280 GBabout 140 GBabout 140 GBabout 70 GBabout 70 GBabout 35 GB
Typical AI useMaster weights, optimizer state, sensitive opsInference, older mixed-precision trainingTraining and inference defaultFP8 inference and forward pass in FP8 trainingGradients in FP8 trainingBlock-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.

Three rows of small cells of decreasing length, sixteen, eight and four, each starting with a dark ink cell followed by grey cells and then light cells, with the second cell of the eight-cell row orange.
Fewer bits per number: the exponent sets range, the mantissa sets precision.

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 approachWhere the scale appliesNotes
Per-tensor (delayed or current)One scale for a whole tensorThe original FP8 recipe on Hopper GPUs
Fine-grained blocksSmall tiles of a tensorUsed in DeepSeek-V3's FP8 training to handle outliers
MXFP832-element blocks, power-of-two (E8M0) scaleHardware-supported on Nvidia Blackwell
NVFP416-element blocks with an FP8 E4M3 scale, plus a per-tensor FP32 scale4-bit format on Blackwell; scaling is what keeps it usable

Sources: NVIDIA Transformer Engine documentation; DeepSeek-V3 technical report.

Two stacks of blocks on an ink baseline: a tall stack of eight grey blocks on the left and a stack of four light blocks on the right with the top block orange.
Halving bytes per value halves the memory a model needs.

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.

FP16BF16
RangeUp to 65,504; small values underflow easilySame range as FP32
PrecisionHigher (10 mantissa bits)Lower (7 mantissa bits)
TrainingNeeds loss scaling to avoid underflow of small gradientsUsually trains without loss scaling
HardwareSupported almost everywhereSupported on recent Nvidia (Ampere and later), AMD, TPUs and Apple chips
Best forInference on older GPUs; image models released in FP16Training 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.

HardwareNative FP8 mathNotes
Nvidia Hopper (H100, H200)YesFirst data-center generation with FP8 Tensor Cores
Nvidia Ada Lovelace (RTX 40 series, L4, L40S)YesConsumer and workstation cards with FP8
Nvidia Blackwell (B200, B300, RTX 50 series)YesAdds MXFP8, FP6 and FP4 (NVFP4)
Nvidia Ampere (A100, RTX 30 series) and olderNoFP8 files can be stored, but math runs in 16-bit after conversion
AMD Instinct MI300 series (CDNA 3)YesUses the FNUZ variant of FP8 per AMD's ROCm docs
Apple silicon, most CPUsNo native FP8 matrix mathUse 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 sizeFP16 or BF16 (2 bytes)FP8 (1 byte)4-bit (about 0.5 bytes)
8B parameters16 GB8 GBabout 4 to 5 GB
32B parameters64 GB32 GBabout 16 to 18 GB
70B parameters140 GB70 GBabout 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.

All articles

Read next

Language

EnglishEnglish · en TürkçeTurkish · tr DeutschGerman · de العربيةArabic · ar

Account

Enter your email. We’ll send you a sign-in link and a 6-digit code. No password needed.

Sign in

Theme

Language

Show our email address

To keep spam out of our inbox, please confirm your own email first. We will send you a 6-digit code.

We send codes only to these providers: gmail.com, googlemail.com, outlook.com, hotmail.com, live.com, msn.com, proton.me, protonmail.com, pm.me, icloud.com, me.com, mac.com, yahoo.com, aol.com, gmx.de, gmx.net, web.de, t-online.de, yandex.com, omniai.blog