ColossalAIPrecisionPlugin¶
- class pytorch_lightning.plugins.precision.ColossalAIPrecisionPlugin(precision=16)[source]¶
Bases:
pytorch_lightning.plugins.precision.precision_plugin.PrecisionPlugin
Precision plugin for ColossalAI integration.
- Parameters
- Raises
ValueError – If precison is not 16.
- backward(tensor, model, optimizer, optimizer_idx, *args, **kwargs)[source]¶
Performs the actual backpropagation.
- Parameters
model¶ (
LightningModule
) – the model to be optimizedoptimizer¶ (
Optional
[Steppable
]) – current optimizer being used.None
if using manual optimizationoptimizer_idx¶ (
Optional
[int
]) – the index of the current optimizer.None
if using manual optimization*args¶ – Positional arguments intended for the actual function that performs the backward, like
backward()
.**kwargs¶ – Keyword arguments for the same purpose as
*args
.
- Return type