Shortcuts

Float8LinearConfig

class torchao.float8.Float8LinearConfig(cast_config_input: ~torchao.float8.config.CastConfig = CastConfig(scaling_type=<ScalingType.DYNAMIC: 'dynamic'>, scaling_granularity=<ScalingGranularity.TENSORWISE: 'tensorwise'>, target_dtype=None), cast_config_input_for_grad_weight: ~typing.Optional[~torchao.float8.config.CastConfig] = None, cast_config_weight: ~torchao.float8.config.CastConfig = CastConfig(scaling_type=<ScalingType.DYNAMIC: 'dynamic'>, scaling_granularity=<ScalingGranularity.TENSORWISE: 'tensorwise'>, target_dtype=None), cast_config_weight_for_grad_input: ~typing.Optional[~torchao.float8.config.CastConfig] = None, cast_config_grad_output: ~torchao.float8.config.CastConfig = CastConfig(scaling_type=<ScalingType.DYNAMIC: 'dynamic'>, scaling_granularity=<ScalingGranularity.TENSORWISE: 'tensorwise'>, target_dtype=None), cast_config_grad_output_for_grad_weight: ~typing.Optional[~torchao.float8.config.CastConfig] = None, gemm_config_output: ~torchao.float8.config.Float8GemmConfig = Float8GemmConfig(use_fast_accum=True), gemm_config_grad_input: ~torchao.float8.config.Float8GemmConfig = Float8GemmConfig(use_fast_accum=False), gemm_config_grad_weight: ~torchao.float8.config.Float8GemmConfig = Float8GemmConfig(use_fast_accum=False), enable_fsdp_float8_all_gather: bool = False, pad_inner_dim: bool = False, emulate: bool = False, force_recompute_fp8_weight_in_bwd: bool = False, round_scales_to_power_of_2: bool = False)[source]

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

static from_recipe_name(recipe_name: Union[Float8LinearRecipeName, str]) Float8LinearConfig[source]

Input: Float8LinearRecipeName value, or a string representing a Float8LinearRecipeName value Output: a Float8LinearConfig configured to implement the specified recipe

Docs

Access comprehensive developer documentation for PyTorch

View Docs

Tutorials

Get in-depth tutorials for beginners and advanced developers

View Tutorials

Resources

Find development resources and get your questions answered

View Resources