PyTorch Lightning is a deep learning framework (Python) that automates engineering code such as backpropagation, mixed precision, multi-GPU, and distributed training, so the same model code scales from 1 to 10,000+ GPUs with zero changes.
- 2.6.6
- Published at
- Sep 10, 2026
- 31,418
- Stars
- 50,289
- Download
- Synced at
- 8d ago
Latest release
2.6.6Sep 10, 2026, 09:39 AMREADME
Project Overview
PyTorch Lightning is a deep learning framework for pretraining and finetuning AI models. Training in plain PyTorch means writing repetitive, error-prone engineering code for backpropagation, mixed precision, multi-GPU, and distributed training. Lightning automates that infrastructure so you focus on model and data logic. The core code scales from CPU to multi-node GPU clusters without changes, and Lightning Fabric offers finer-grained expert control.
You write the science, Lightning handles the engineering, and training scales linearly with hardware.
| Item | Value |
|---|---|
| Platform | Linux, macOS, Windows |
| Language | Python |
| License | Apache-2.0 |
| Core packages | PyTorch Lightning (high level) / Lightning Fabric (expert control) |
Key Features
- Automated training loop: backpropagation, optimizer scheduling, validation, and logging are handled for you
- Hardware-agnostic scaling: switch the same code across CPUs, single GPUs, multi-GPU, and multi-node clusters
- Mixed precision: enable 16-bit training with one flag
- LightningModule: organize model, training step, and optimizers into a standard structure
- Fabric expert mode: insert fine-grained control where needed without rewriting your code
- Callbacks and checkpoints: resume from checkpoints, early stopping, and metric monitoring as pluggable callbacks
Target Audience
- Researchers tired of rewriting training loops
- Engineers running multi-GPU distributed training
- Teams maintaining many deep learning projects
- Students reproducing paper experiments
Quick Start
- Install:
pip install lightning- Write your model as a LightningModule implementing
training_stepandconfigure_optimizers - Start training with the
Trainerclass, switching GPU count and precision via flags - Switch to Lightning Fabric when you need finer control; code changes are minimal
Core Advantages
- Scale without changes: from 1 GPU to 10,000+ with the same core model code
- Clean structure: training code organized by module, reproducible and easy to hand over
- Optional abstraction: from fully automatic Trainer to semi-automatic Fabric, you pick the level
System Requirements
| Item | Requirement |
|---|---|
| OS | Linux, macOS, Windows |
| Runtime | Python (depends on PyTorch) |
| Hardware | Trains on CPU; GPU and multi-node clusters supported |
Notes
- Prerequisite: PyTorch must be installed first; GPU training needs a matching CUDA build
- Two interfaces: PyTorch Lightning and Fabric differ in usage; pick one per project