DeepSpeedPrecision
- class lightning.fabric.plugins.precision.DeepSpeedPrecision(precision)
Bases:
PrecisionPrecision plugin for DeepSpeed integration.
- Parameters:
precision (
Literal['32-true','16-true','bf16-true','16-mixed','bf16-mixed']) – Full precision (32-true), half precision (16-true, bf16-true) or mixed precision (16-mixed, bf16-mixed).- Raises:
ValueError – If unsupported
precisionis provided.
- backward(tensor, model, *args, **kwargs)
Performs back-propagation using DeepSpeed’s engine.
- Return type:
- convert_input(data)
Convert model inputs (forward) to the floating point precision type of this plugin.
This is a no-op in the base precision plugin, since we assume the data already has the desired type (default is torch.float32).
- Return type:
- convert_module(module)
Convert the module parameters to the precision type this plugin handles.
This is optional and depends on the precision limitations during optimization.
- Return type:
- convert_output(data)
Convert outputs to the floating point precision type expected after model’s forward.
This is a no-op in the base precision plugin, since we assume the data already has the desired type (default is torch.float32).
- Return type:
- module_init_context()
Instantiate module parameters or tensors in the precision type this plugin handles.
This is optional and depends on the precision limitations during optimization.
- Return type:
- optimizer_step(optimizer, **kwargs)
Hook to run the optimizer step.
- Return type:
- tensor_init_context()
Controls how tensors get created (device, dtype).
- Return type:
Was this page helpful?
Thanks for the feedback.