Rate this Page

torchao.float8#

Created On: Jan 29, 2026 | Last Updated On: Jan 29, 2026

Main float8 training APIs#

convert_to_float8_training

Swaps torch.nn.Linear in module with Float8Linear.

Other float8 training types#

Float8LinearConfig

Configuration for converting a torch.nn.Linear module to float8 for training.

Float8LinearRecipeName

Pre-made recipes for common float8 training configurations.

CastConfig

Configuration for casting a single tensor to float8.

ScalingType

Defines the type of scaling to use for casting to float8.

ScalingGranularity

Defines the granularity of scaling strategies for casting to float8.

precompute_float8_dynamic_scale_for_fsdp

Calculate scale dynamically for all float8 parameters.