pytorch-lightning
Organizes PyTorch training code with the lightning package (PyTorch Lightning): LightningModule, LightningDataModule, Trainer, callbacks such as ModelCheckpoint and EarlyStopping, loggers (TensorBoard, W&B, MLflow, Comet, CSV), and multi-GPU/TPU strategies (DDP, FSDP, DeepSpeed). Use when structuring a PyTorch model into training, validation and test steps. Use when configuring a Trainer for multi-GPU or TPU runs. Use when writing a LightningDataModule for data loading. Use when adding checkpointing, early stopping or experiment logging to a training run. Use when choosing between DDP, FSDP and DeepSpeed for a model size. Not for plain PyTorch loops without Lightning.
- Version
- 1.2
- License
- Apache-2.0 license
- Compatibility
- Requires Python 3.10+ and lightning 2.6+ (or pytorch-lightning 2.6+). GPU training needs CUDA-capable PyTorch. Optional loggers (wandb, mlflow, comet-ml) and DeepSpeed require separate installs.
Pinned to revision df088027ff23, so it is the text this page describes rather than whatever the author pushed since.
Pre-approved tools experimental
Experimental field. Support varies between clients, so this list is what the author declared, not what your client will enforce.
- Read
- Write
- Edit
- Bash
Files
- skills/pytorch-lightning/SKILL.md
- skills/pytorch-lightning/references/best_practices.md
- skills/pytorch-lightning/references/callbacks.md
- skills/pytorch-lightning/references/data_module.md
- skills/pytorch-lightning/references/distributed_training.md
- skills/pytorch-lightning/references/lightning_module.md
- skills/pytorch-lightning/references/logging.md
- skills/pytorch-lightning/references/trainer.md
- skills/pytorch-lightning/scripts/quick_trainer_setup.py
- skills/pytorch-lightning/scripts/template_datamodule.py
- skills/pytorch-lightning/scripts/template_lightning_module.py
Every link opens the file at its source, pinned to the revision this page describes.