FP4 Explained: MXFP4 vs. NVFP4 and What to Validate
Learn why FP4 does not name one complete tensor format, how MXFP4 and NVFP4 scale E2M1 values differently, and how to evaluate support, accuracy, and memory.
FP4 Explained: MXFP4 vs. NVFP4 and What to Validate
FP4 is a family of floating-point element encodings that use four bits per value. The label alone does not specify the exponent/mantissa layout, shared scales, actual tensor memory, or hardware support. OCP MXFP4 and NVIDIA NVFP4 both use E2M1 elements, but they use different block sizes and scale formats. Before adopting FP4, identify the exact recipe and test its execution path and quality.
Four bits describe an element, not the whole tensor
E2M1 means one sign bit, two exponent bits, and one mantissa bit. In the OCP MXFP4 specification, E2M1 represents magnitudes up to 6; its positive values include 0, 0.5, 1, 1.5, 2, 3, 4, and 6. It has no dedicated infinity or NaN encodings. The smallest subnormal magnitude is 0.5. These are values of the element before a shared scale is applied. The OCP MicroXcaling specification 1.1 defines this encoding and its conversion rules.
| E2M1 example | Meaning |
|---|---|
| 0 | Zero |
| 0.5 | Smallest subnormal magnitude |
| 1, 1.5, 2, 3, 4, 6 | Examples of representable positive values |
An FP4 tensor may also store block scales and padding. So “four bits per element” does not mean that the entire tensor costs exactly four bits per value in allocated memory.
Scales extend the useful range
Quantization approximates higher-precision values with a smaller set of values. A scale first maps a block into the FP4 range; conversion rounds each normalized value to an FP4 value. Reconstruction multiplies the element by its scale. A local scale per block can adapt to local magnitudes, but scale storage and alignment add overhead.
NVIDIA NVFP4 uses a two-level reconstruction:
reconstructed value ≈ E2M1 element × block FP8 E4M3 scale × tensor FP32 scale
In its one-dimensional recipe, each group of 16 consecutive values shares one E4M3 scale, and one FP32 scale applies to the tensor. The current Transformer Engine 2.21 NVFP4 documentation describes this hierarchy and version-specific support.
MXFP4 and NVFP4 differ in scale structure
OCP MXFP4 is defined in the OCP MicroXcaling specification. Each block has 32 E2M1 elements and one shared 8-bit UE8M0 scale. Version 1.1, dated 2026-10-09, uses the name UE8M0; older material may say E8M0. The standard permits an implementation to support only a subset of its formats and does not prescribe their physical memory layout.
NVFP4 also uses E2M1 values, but uses one FP8 E4M3 scale per 16 values and one FP32 scale per tensor. NVIDIA’s current Transformer Engine page lists training support for SM 10.0 and SM 10.3, and inference support for SM 10.0 and later. This is the scope of that implementation documentation, not a guarantee that every FP4 format runs on those devices.
| Property | OCP MXFP4 | NVIDIA NVFP4 in Transformer Engine 2.21 |
|---|---|---|
| Element | FP4 E2M1 | FP4 E2M1 |
| Shared scale | One 8-bit UE8M0 scale per 32 elements | One FP8 E4M3 scale per 16 elements, plus one FP32 scale per tensor |
| Definition | OCP MX specification 1.1 | NVIDIA recipe documented in Transformer Engine 2.21 |
| Support | An implementation may support only some MX formats | Check the documented device, library, and training/inference path |
The scale fields alone give a useful logical payload calculation. MXFP4 uses 32×4 + 8 = 136 bits per block, or 4.25 bits per element for those fields. NVFP4 uses 16×4 + 8 = 72 bits per block, plus 32 bits once per tensor. This is arithmetic from the format definitions, not measured allocation: alignment, padding, scale layout, and other buffers change actual memory use. NVIDIA documents alignment padding for scale tensors.
A small rounding example shows the precision limit
Suppose a normalized value of 0.6 is about to be encoded in E2M1, with scale fixed at 1. The nearest representable value is 0.5. The absolute error is 0.1 and the relative error is about 16.7%. In a scaled tensor, both the original and reconstructed values are multiplied by the scale, so this relative example is unchanged. It is an illustrative calculation, not a GPU measurement.
Actual NVFP4 recipes compute block and tensor scales from the tensor’s magnitudes. NVIDIA’s documented training recipe may also use two-dimensional weight scaling, stochastic rounding on gradients, or a Random Hadamard Transform in selected paths. Those features change how quantization error is handled; they do not guarantee a particular model’s accuracy.
The OCP specification requires support for round-to-nearest, ties-to-even when converting FP4, while allowing other rounding modes. For out-of-range values, implementations must support clamping, and NaN conversion is implementation-defined. Do not assume NVFP4 uses every OCP conversion rule; follow the exact library implementation.
Decide whether FP4 fits the workload
FP4 can reduce model-data storage and memory traffic, but a four-bit element does not guarantee one-quarter the total memory of FP16 or a faster workload. Scales, padding, conversion, and unsupported kernels can consume memory or time. A narrow value set can also affect small differences or outliers in ways that matter to a model.
For NVFP4, the cited Transformer Engine 2.21 page lists training on SM 10.0 and 10.3 and inference on SM 10.0+. Treat that as a versioned library scope. Check the GPU, framework version, operation, tensor shape, and selected kernel. Training and inference support can differ.
Check five things before deploying
**Name the exact recipe.** Record E2M1 and the full format name, such as MXFP4 or NVFP4, plus the standard/library version.
**Record the scale scheme.** Check scale datatype, elements per block, tensor-level scaling, differences between weights and activations, and alignment requirements.
**Confirm the supported path.** Match the GPU and compute capability, CUDA/framework version, training or inference mode, operation, and shape against current documentation.
**Validate representative data.** Compare with a higher-precision reference using application-specific tolerances. Include outliers, small values, model-quality metrics, and training stability where applicable.
**Measure actual memory and runtime.** Include scales, padding, temporary buffers, and conversion. Profile whether the FP4 kernel actually runs, then compare end-to-end latency or throughput.
Troubleshoot quality or speed problems
If quality falls, inspect the scale calculation, block size, outlier distribution, rounding/saturation, and sensitive layers. Compare intermediate values and layer-level metrics to find where the difference first grows. A higher precision for selected layers may help, but validate that configuration on the target model.
If memory or speed does not improve, compare actual allocated buffers rather than the element width alone. Check whether the recipe quantizes weights only or also activations, and whether alignment, padding, or temporary buffers dominate. Then profile the selected kernel. Quantization and memory movement can outweigh faster low-bit math.
Sources
[Open Compute Project, OCP MicroXcaling Specification 1.1](https://www.opencompute.org/documents/ocp-microxcaling-mx-specification-v1-1-0/)
[NVIDIA Transformer Engine 2.21, NVFP4](https://docs.nvidia.com/deeplearning/transformer-engine/features/low_precision_training/nvfp4/nvfp4.html)
[NVIDIA cuDNN, Block Scaling](https://docs.nvidia.com/deeplearning/cudnn/latest/operations/BlockScaling.html)
[NVIDIA CUDA C++ Best Practices Guide, Verification and Numerical Accuracy](https://docs.nvidia.com/cuda/cuda-c-best-practices-guide/)