What Is FP16? Understanding the 16-Bit Floating-Point Format on GPUs
FP16 is the binary16 format: it halves storage per element versus FP32, but has less range and precision. GPU speed and model accuracy depend on the hardware, runtime, and operations used. Learn the bit layout, trade-offs, and a practical validation workflow.
What Is FP16? Understanding the 16-Bit Floating-Point Format on GPUs
FP16 (half precision) stores each value as a 16-bit floating-point number. A contiguous array therefore uses half the storage per element of FP32, but FP16 also has a smaller range and fewer significant bits. Supported GPU paths may reduce data movement or speed up particular operations; neither faster execution nor unchanged model accuracy is guaranteed.
What values can FP16 represent?
The IEEE binary16 format documented by NVIDIA CUDA has 1 sign bit, 5 exponent bits, and 10 fraction bits. Normalized values have an implicit leading 1, giving 11 bits of significand precision. FP32 uses 1 sign, 8 exponent, and 23 fraction bits.
| Format | Bits | Sign / exponent / fraction | Largest finite | Smallest positive normal | Smallest positive subnormal |
|---|---|---|---|---|---|
| FP16 / binary16 | 16 | 1 / 5 / 10 | 65,504 | 2^-14 ≈ 6.10×10^-5 | 2^-24 ≈ 5.96×10^-8 |
| FP32 / binary32 | 32 | 1 / 8 / 23 | ≈ 3.40×10^38 | 2^-126 ≈ 1.18×10^-38 | 2^-149 ≈ 1.40×10^-45 |
Most real numbers cannot be represented exactly and are rounded to a representable value; for example, decimal 0.1 is not exact in FP16. Values above 65,504 are outside FP16's finite range. Very small values may use subnormal representation or round to zero. Exact conversion and operation behavior depends on the device, operation, and runtime.
BF16 is another 16-bit format, with 8 exponent bits and 7 fraction bits. It has a wider range than FP16 but lower precision. Equal storage width does not mean equal range or rounding error.
Storage savings do not guarantee speed
A contiguous array of one million values occupies 4,000,000 bytes in FP32 and 2,000,000 bytes in FP16. This arithmetic example covers only that array. Model memory also includes buffers, copies of weights, accumulators, and framework overhead, so total memory does not necessarily halve.
Speed depends on GPU support, whether the framework selects an FP16 path for the operation, and how its kernel handles conversions, data movement, and accumulation. Inputs or stored values can be FP16 while sensitive operations or accumulators use FP32. CUDA documents device-specific support and half-precision operation paths; TensorRT describes the accuracy trade-offs of lower precision.
What to check in training and inference
**Training:** Mixed precision and loss scaling can reduce the chance that small gradients round to zero. Dynamic loss scaling checks for overflow and adjusts the scale. Whether FP32 weight copies or higher precision for sensitive operations are needed depends on the framework and model.
**Inference:** Compare outputs against an FP32 baseline using representative deployment data and task-specific quality metrics. Check intermediate layers for Inf/NaN, large errors, and out-of-range values; consider mixed precision or FP32 for problematic operations.
A workflow for applying and validating FP16
**Record an FP32 baseline.** Save outputs and task metrics for a fixed model version and representative data.
**Check hardware and runtime support.** Record the GPU, driver, framework or engine version, and whether the exact operations support FP16. A support listing does not mean the entire model runs in FP16.
**Choose the execution path.** For training, review the framework's automatic mixed precision and gradient scaler. For inference, check whether sensitive layers can stay at higher precision. Distinguish storage, input, and accumulation dtypes.
**Inspect numerical behavior.** With the same inputs, compare output differences, task metrics, Inf/NaN, overflow, underflow, and layer-level errors. For training, also inspect loss and gradient statistics.
**Measure real benefit.** On the target GPU, hold batch size, inputs, warm-up, and measurement interval constant; compare throughput, latency, and memory. If quality leaves the acceptable range, locate the problematic operations and evaluate keeping them in FP32, adjusting scales, or using another format.
FP16 is an option for reducing storage or computation cost, not a promise that changing a model to 16-bit will make it faster. Use a path only after it passes both numerical validation and measurement on the target hardware.
Sources
[NVIDIA CUDA Programming Guide 13.2: Floating-Point Computation](https://docs.nvidia.com/cuda/cuda-programming-guide/pdf/cuda-programming-guide.pdf) — binary16 and binary32 fields, ranges, and subnormals.
[NVIDIA TensorRT: Data Format Descriptions](https://docs.nvidia.com/deeplearning/tensorrt/latest/inference-library/data-format-desc.html) — FP16, FP32, and BF16 field layouts.
[NVIDIA TensorRT: Accuracy Considerations](https://docs.nvidia.com/deeplearning/tensorrt/latest/inference-library/accuracy-considerations.html) — FP16 range, overflow, and mixed-precision guidance.
[NVIDIA CUDA C++ Best Practices Guide 13.5: Half Precision Arithmetic](https://docs.nvidia.com/cuda/cuda-c-best-practices-guide/) — device-specific half arithmetic paths and half2 guidance.
[NVIDIA: Train With Mixed Precision](https://docs.nvidia.com/deeplearning/performance/mixed-precision-training/index.html) — loss scaling to preserve small gradients during training.
[PyTorch 2.15: Automatic Mixed Precision examples](https://docs.pytorch.org/docs/2.15/notes/amp_examples.html) — autocast and gradient-scaling examples.