Shortcuts

API References

Accelerator API

Accelerator

The Accelerator Base Class.

CPUAccelerator

Accelerator for CPU devices.

GPUAccelerator

Accelerator for GPU devices.

IPUAccelerator

Accelerator for IPUs.

TPUAccelerator

Accelerator for TPU devices.

Core API

datamodule

LightningDataModule for loading DataLoaders with ease.

decorators

hooks

Various hooks to be used in the Lightning code.

lightning

The LightningModule - an nn.Module with many additional features.

Strategy API

DDP2Strategy

DDP2 behaves like DP in one node, but synchronization across nodes behaves like in DDP.

DDPFullyShardedStrategy

Plugin for Fully Sharded Data Parallel provided by FairScale.

DDPShardedStrategy

Optimizer and gradient sharded training provided by FairScale.

DDPSpawnShardedStrategy

Optimizer sharded training provided by FairScale.

DDPSpawnStrategy

Spawns processes using the torch.multiprocessing.spawn() method and joins processes after training finishes.

DDPStrategy

Plugin for multi-process single-device training on one or multiple nodes.

DataParallelStrategy

Implements data-parallel training in a single process, i.e., the model gets replicated to each device and each gets a split of the data.

DeepSpeedStrategy

Provides capabilities to run training using the DeepSpeed library, with training optimizations for large billion parameter models.

HorovodStrategy

Plugin for Horovod distributed training integration.

IPUStrategy

Plugin for training on IPU devices.

ParallelStrategy

Plugin for training with multiple processes in parallel.

SingleDeviceStrategy

Strategy that handles communication on a single device.

SingleTPUStrategy

Strategy for training on a single TPU device.

Strategy

Base class for all training type plugins that change the behaviour of the training, validation and test- loop.

TPUSpawnStrategy

Strategy for training multiple TPU devices using the torch.multiprocessing.spawn() method.

Callbacks API

base

Base class used to build new callbacks.

early_stopping

Early Stopping

gpu_stats_monitor

GPU Stats Monitor

gradient_accumulation_scheduler

Gradient Accumulator

lr_monitor

Learning Rate Monitor

model_checkpoint

Model Checkpointing

progress

Progress Bars

Loggers API

base

Abstract base class used to build new loggers.

comet

Comet Logger

csv_logs

CSV logger

mlflow

MLflow Logger

neptune

Neptune Logger

tensorboard

TensorBoard Logger

test_tube

Test Tube Logger

wandb

Weights and Biases Logger

Loop API

Base Classes

DataLoaderLoop

Base class to loop over all dataloaders.

Loop

Basic Loops interface.

Default Loop Implementations

Training

TrainingBatchLoop

Runs over a single batch of data.

TrainingEpochLoop

Runs over all batches in a dataloader (one epoch).

FitLoop

This Loop iterates over the epochs to run the training.

ManualOptimization

A special loop implementing what is known in Lightning as Manual Optimization where the optimization happens entirely in the training_step() and therefore the user is responsible for back-propagating gradients and making calls to the optimizers.

OptimizerLoop

Runs over a sequence of optimizers.

Validation and Testing

EvaluationEpochLoop

This is the loop performing the evaluation.

EvaluationLoop

Loops over all dataloaders for evaluation.

Prediction

PredictionEpochLoop

Loop performing prediction on arbitrary sequentially used dataloaders.

PredictionLoop

Loop to run over dataloaders for prediction.

Plugins API

Precision Plugins

ApexMixedPrecisionPlugin

Mixed Precision Plugin based on Nvidia/Apex (https://github.com/NVIDIA/apex)

DeepSpeedPrecisionPlugin

Precision plugin for DeepSpeed integration.

DoublePrecisionPlugin

Plugin for training with double (torch.float64) precision.

FullyShardedNativeMixedPrecisionPlugin

Native AMP for Fully Sharded Training.

IPUPrecisionPlugin

Precision plugin for IPU integration.

MixedPrecisionPlugin

Base Class for mixed precision.

NativeMixedPrecisionPlugin

Plugin for Native Mixed Precision (AMP) training with torch.autocast.

PrecisionPlugin

Base class for all plugins handling the precision-specific parts of the training.

ShardedNativeMixedPrecisionPlugin

Native AMP for Sharded Training.

TPUBf16PrecisionPlugin

Plugin that enables bfloats on TPUs.

TPUPrecisionPlugin

Precision plugin for TPU integration.

Cluster Environments

ClusterEnvironment

Specification of a cluster environment.

KubeflowEnvironment

Environment for distributed training using the PyTorchJob operator from Kubeflow

LightningEnvironment

The default environment used by Lightning for a single node or free cluster (not managed).

LSFEnvironment

An environment for running on clusters managed by the LSF resource manager.

SLURMEnvironment

Cluster environment for training on a cluster managed by SLURM.

TorchElasticEnvironment

Environment for fault-tolerant and elastic training with torchelastic

Checkpoint IO Plugins

CheckpointIO

Interface to save/load checkpoints as they are saved through the Strategy.

TorchCheckpointIO

CheckpointIO that utilizes torch.save() and torch.load() to save and load checkpoints respectively, common for most use cases.

XLACheckpointIO

CheckpointIO that utilizes xm.save() to save checkpoints for TPU training strategies.

Profiler API

AbstractProfiler

Specification of a profiler.

AdvancedProfiler

This profiler uses Python's cProfiler to record more detailed information about time spent in each function call recorded during a given action.

BaseProfiler

If you wish to write a custom profiler, you should inherit from this class.

PassThroughProfiler

This class should be used when you don't want the (small) overhead of profiling.

PyTorchProfiler

This profiler uses PyTorch's Autograd Profiler and lets you inspect the cost of.

SimpleProfiler

This profiler simply records the duration of actions (in seconds) and reports the mean duration of each action and the total time spent over the entire training run.

XLAProfiler

This Profiler will help you debug and optimize training workload performance for your models using Cloud TPU performance tools.

Trainer API

Trainer

Customize every aspect of training via flags.

LightningLite API

LightningLite

Lite accelerates your PyTorch training or inference code with minimal changes required.

Tuner API

Tuner

Tuner class to tune your model.

Utilities API

apply_func

Utilities used for collections.

argparse

Utilities for Argument Parsing within Lightning Components.

cli

Utilities for LightningCLI.

cloud_io

Utilities related to data saving/loading.

deepspeed

Utilities that can be used with Deepspeed.

distributed

Utilities that can be used with distributed training.

finite_checks

Helper functions to detect NaN/Inf values.

memory

Utilities related to memory.

model_summary

Utilities related to model weights summary.

parsing

Utilities used for parameter parsing.

seed

Utilities to help with reproducibility of models.

warnings

Warning-related utilities.

Read the Docs v: latest
Versions
latest
stable
1.5.9
1.5.8
1.5.7
1.5.6
1.5.5
1.5.4
1.5.3
1.5.2
1.5.1
1.5.0
1.4.9
1.4.8
1.4.7
1.4.6
1.4.5
1.4.4
1.4.3
1.4.2
1.4.1
1.4.0
1.3.8
1.3.7
1.3.6
1.3.5
1.3.4
1.3.3
1.3.2
1.3.1
1.3.0
1.2.10
1.2.8
1.2.7
1.2.6
1.2.5
1.2.4
1.2.3
1.2.2
1.2.1
1.2.0
1.1.8
1.1.7
1.1.6
1.1.5
1.1.4
1.1.3
1.1.2
1.1.1
1.1.0
1.0.8
1.0.7
1.0.6
1.0.5
1.0.4
1.0.3
1.0.2
1.0.1
1.0.0
0.10.0
0.9.0
0.8.5
0.8.4
0.8.3
0.8.2
0.8.1
0.8.0
0.7.6
0.7.5
0.7.4
0.7.3
0.7.2
0.7.1
0.7.0
0.6.0
0.5.3
0.4.9
ipynb-update
docs-search
Downloads
html
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.