Shortcuts

IPUPrecisionPlugin

class pytorch_lightning.plugins.precision.IPUPrecisionPlugin(precision)[source]

Bases: pytorch_lightning.plugins.precision.precision_plugin.PrecisionPlugin

Precision plugin for IPU integration.

Raises:

ValueError – If the precision is neither 16 nor 32.

backward(tensor, model, *args, **kwargs)[source]

Performs the actual backpropagation.

Parameters:
  • tensor (Tensor) – the loss value obtained from the closure

  • model (LightningModule) – the model to be optimized

  • optimizer – current optimizer being used. None if using manual optimization

  • optimizer_idx – the index of the current optimizer. None if using manual optimization

  • *args (Any) – Positional arguments intended for the actual function that performs the backward, like backward().

  • **kwargs (Any) – Keyword arguments for the same purpose as *args.

Return type:

None

clip_gradients(optimizer, clip_val=0.0, gradient_clip_algorithm=GradClipAlgorithmType.NORM)[source]

Clips the gradients.

Return type:

None

optimizer_step(optimizer, model, optimizer_idx, closure, **kwargs)[source]

IPUs handle the optimizer step internally.

Return type:

Any