liveBook · Manning

Bfloat16

As explained in Domain-Specific Small Language Models

A 16-bit floating-point format with a wider exponent range and reduced mantissa precision than FP16, used in machine learning.

bfloat16 (BF16) is a 16-bit floating-point format that uses 1 sign bit, 8 exponent bits, and 7 mantissa bits. It extends FP16’s dynamic range while reducing precision. section 6.1

BF16 reduces memory use and generally preserves deep-learning performance, although lower precision can affect some calculations. Models trained in BF16 typically match FP16 mixed precision for inference performance and memory use. section 6.1 section 6.5

Practical considerations:

  • Use BF16 on supported Google TPUs or NVIDIA Ampere GPUs; check NVIDIA support with torch.cuda.is_bf16_supported(). section 6.1
  • Prefer BF16 when wider dynamic range matters more than FP16’s additional mantissa precision. section 6.1

How Domain-Specific Small Language Models covers it

How deep it goes
Defines the bit layout, compares BF16 with FP16, and notes hardware checks without detailing numerical algorithms.
Examples
Compares BF16 with FP16 and demonstrates GPU support through torch.cuda.is_bf16_supported().
What you can do after
Evaluate whether supported hardware can use BF16 while balancing dynamic range, precision, memory, and inference performance.
How it connects
Connects BF16 with FP16, FP32, mixed-precision training, inference, TPUs, NVIDIA Ampere GPUs, and PyTorch.

Also explained in

Compare how 3 books explain bfloat16 →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Domain-Specific Small Language Models. The section links point to the parts of the book it draws on.