talira

PyTorch Lightning

Organises PyTorch code and handles the training engineering, from one CPU to thousands of GPUs

open sourceApache-2.0free

PyTorch Lightning is a Python framework that organises PyTorch code so the training loop's engineering is handled for you: backpropagation, mixed precision, multi-GPU and multi-node distributed training, checkpointing and logging. You write the model logic in a LightningModule and the Trainer runs it, scaling from a CPU to many GPU nodes without changing the core code. Lightning Fabric, in the same package, gives expert-level control for people who want to keep their own training loop while still scaling it. It's used to pretrain and finetune models of any size, and is maintained by Lightning AI, whose cloud platform runs it without managing infrastructure.

Problems it solves

  • stop rewriting the same PyTorch training loop boilerplate for every project
  • train my PyTorch model on multiple GPUs without rewriting it
  • add mixed precision and checkpointing to PyTorch training
  • scale PyTorch training from my laptop to a GPU cluster

Features

  • Trainer that automates the PyTorch training loop
  • mixed precision
  • multi-GPU and multi-node distributed training
  • scale without changing model code
  • Lightning Fabric for expert control of your own loop
  • checkpointing and logging

Alternatives

The same job

These do what PyTorch Lightning does.

  1. PyTorch Tensors and dynamic neural networks in Python with strong GPU acceleration

Compare PyTorch Lightning with the top 3