TF32 - TensorFloat-32

NVIDIA's 19-bit hybrid: FP32 range meets FP16 precision for accelerated tensor math

Bit Layout

A TF32 number uses 19 bits divided into three fields:

Sign
S
1 bit
Exponent
E
E
E
E
E
E
E
E
8 bits
Mantissa
M
M
M
M
M
M
M
M
M
M
10 bits

TF32 combines the 8-bit exponent of FP32/BF16 with the 10-bit mantissa of FP16, giving it FP32's range with FP16's precision.

Overview

TF32 (TensorFloat-32) was introduced by NVIDIA with the Ampere architecture (A100 GPU) in 2020. Despite the "32" in its name, TF32 is actually a 19-bit format. The name reflects that it is used as a drop-in replacement for FP32 in tensor operations.

TF32 is unique because it's not a storage format: data is stored in FP32 memory layout, and TF32 is only used internally by Tensor Cores during matrix multiply-accumulate operations. The GPU automatically truncates FP32 inputs to TF32 precision (10 mantissa bits) before computation, then accumulates results in FP32.

This gives up to 8× speedup over FP32 matrix math on A100, with negligible accuracy loss for most deep learning workloads. On NVIDIA GPUs, TF32 is enabled by default for torch.matmul and torch.nn.Linear.

Not a storage format You'll never see TF32 tensors in memory. TF32 is a compute mode: the GPU truncates FP32 inputs on-the-fly during Tensor Core operations. Inputs and outputs remain in FP32 format.

Encoding Rules

Normal Numbers

value = (-1)sign × 2(exponent - 127) × (1 + mantissa / 210)

TF32 follows FP32's rules with the exponent, but with only 10 mantissa bits (like FP16). The bias of 127 is calculated as 2(e-1) - 1, where e is the number of exponent bits (8), identical to FP32 and BF16.

Subnormal Numbers

value = (-1)sign × 2-126 × (0 + mantissa / 210)

Special Values

Interactive Value Visualizer

Click any bit to flip it, drag the slider, or enter a decimal or hex value. The graphs show how values are distributed across the encoding space.

Dynamic Range & Precision

PropertyValue
Max Positive (Normal)3.401162134e+38
Min Positive (Normal)1.175494351e-38
Max Subnormal1.174346407e-38
Min Positive (Subnormal)1.147943702e-41
Machine Epsilon (at 1.0)0.0009765625
Approx. Decimal Digits~3.0
Exponent Bias127
Exponent Range2^-126 to 2^127
Total Bit Patterns524,288
Supports InfinityYes
Supports NaNYes

Special Values & Bit Patterns

ValueBit PatternDecimal
+00 00000000 00000000000
-01 00000000 0000000000-0
Min Subnormal0 00000000 00000000011.147943702e-41
Max Subnormal0 00000000 11111111111.174346407e-38
Min Normal0 00000001 00000000001.175494351e-38
Max Normal0 11111110 11111111113.401162134e+38
+Infinity0 11111111 0000000000+Infinity
-Infinity1 11111111 0000000000-Infinity
NaN0 11111111 1000000000NaN

Format Comparison

PropertyTF32FP32BF16FP16
Total Bits19321616
Sign Bits1111
Exponent Bits8885
Mantissa Bits1023710
Bias12712712715
Max Value3.401162134e+383.402823466e+383.389531389e+3865504
Min Normal1.175494351e-381.175494351e-381.175494351e-380.00006103515625
Epsilon0.00097656251.192092896e-70.00781250.0009765625
~Decimal Digits~3.0~6.9~2.1~3.0
Has InfinityYesYesYesYes
Has NaNYesYesYesYes
Has SubnormalsYesYesYesYes

Where TF32 Is Used

Not a general-purpose format TF32 is only used internally by NVIDIA Tensor Cores during specific operations (matmul, convolutions). You cannot store tensors in TF32 or select it as a dtype in frameworks. If you need a 16-bit storage format with similar precision, use FP16 (same 10-bit mantissa) instead.