# pytorch-lightning

> PyTorch Lightning is the lightweight PyTorch wrapper for ML researchers. Scale your models. Write less boilerplate.

- **URL**: https://www.freshcrate.ai/projects/pytorch-lightning
- **Author**: Lightning AI et al.
- **Category**: RAG & Memory
- **Latest version**: `2.6.5` (2026-05-27)
- **License**: Apache-2.0
- **Source**: https://github.com/Lightning-AI/pytorch-lightning/issues
- **Homepage**: https://github.com/Lightning-AI/lightning
- **Language**: Python
- **GitHub**: 31,066 stars, 3,708 forks
- **Registry**: pypi (`pytorch-lightning`)
- **Tags**: `ai`, `deep`, `learning`, `pypi`, `pytorch`

## Description

<div align="center">

<img src="https://pl-public-data.s3.amazonaws.com/assets_lightning/pytorch-lightning.png" width="400px">

**The lightweight PyTorch wrapper for high-performance AI research.
Scale your models, not the boilerplate.**

______________________________________________________________________

<p align="center">
  <a href="https://www.pytorchlightning.ai/">Website</a> •
  <a href="#how-to-use">How To Use</a> •
  <a href="https://lightning.ai/docs/pytorch/stable/">Docs</a> •
  <a href="#examples">Examples</a> •
  <a href="#community">Community</a> •
  <a href="https://lightning.ai/">Lightning AI</a> •
  <a href="https://github.com/Lightning-AI/pytorch-lightning/blob/master/LICENSE">License</a>
</p>

<!-- DO NOT ADD CONDA DOWNLOADS... README CHANGES MUST BE APPROVED BY EDEN OR WILL -->

[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/pytorch-lightning)](https://pypi.org/project/pytorch-lightning/)
[![PyPI Status](https://badge.fury.io/py/pytorch-lightning.svg)](https://badge.fury.io/py/pytorch-lightning)
[![PyPI - Downloads](https://img.shields.io/pypi/dm/pytorch-lightning)](https://pepy.tech/project/pytorch-lightning)
[![Conda](https://img.shields.io/conda/v/conda-forge/pytorch-lightning?label=conda&color=success)](https://anaconda.org/conda-forge/pytorch-lightning)
[![DockerHub](https://img.shields.io/docker/pulls/pytorchlightning/pytorch_lightning.svg)](https://hub.docker.com/r/pytorchlightning/pytorch_lightning)
[![codecov](https://codecov.io/gh/Lightning-AI/pytorch-lightning/graph/badge.svg?token=SmzX8mnKlA)](https://codecov.io/gh/Lightning-AI/pytorch-lightning)

[![ReadTheDocs](https://readthedocs.org/projects/pytorch-lightning/badge/?version=2.6.1)](https://lightning.ai/docs/pytorch/stable/)[![Discord](https://img.shields.io/discord/1077906959069626439?style=plastic)](https://discord.gg/VptPCZkGNa)
[![license](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/Lightning-AI/pytorch-lightning/blob/master/LICENSE)

<!--
[![CodeFactor](https://www.codefactor.io/repository/github/Lightning-AI/lightning/badge)](https://www.codefactor.io/repository/github/Lightning-AI/lightning)
-->

</div>

###### \*Codecov is > 90%+ but build delays may show less

______________________________________________________________________

## PyTorch Lightning is just organized PyTorch

Lightning disentangles PyTorch code to decouple the science from the engineering.
![PT to PL](https://lightning.ai/docs/pytorch/stable/_static/images/general/pl_quick_start_full_compressed.gif)

______________________________________________________________________

## Lightning Design Philosophy

Lightning structures PyTorch code with these principles:

<div align="center">
  <img src="https://pl-bolts-doc-images.s3.us-east-2.amazonaws.com/philosophies.jpg" max-height="250px">
</div>

Lightning forces the following structure to your code which makes it reusable and shareable:

- Research code (the LightningModule).
- Engineering code (you delete, and is handled by the Trainer).
- Non-essential research code (logging, etc... this goes in Callbacks).
- Data (use PyTorch DataLoaders or organize them into a LightningDataModule).

Once you do this, you can train on multiple-GPUs, TPUs, CPUs, HPUs and even in 16-bit precision without changing your code!

[Get started in just 15 minutes](https://lightning.ai/docs/pytorch/latest/starter/introduction.html)

______________________________________________________________________

## Continuous Integration

Lightning is rigorously tested across multiple CPUs, GPUs and TPUs and against major Python and PyTorch versions.

<details>
  <summary>Current build statuses</summary>

<center>

|       System / PyTorch ver.        |                                                    1.12                                                     | 1.13                                                                                                        | 2.0                                                                                                         | 2.1                                                                                                               |
| :--------------------------------: | :---------------------------------------------------------------------------------------------------------: | ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- |
|         Linux py3.9 [GPUs]         |                                                                                                             |                                                                                                             |

## Recent releases

| Version | Date | Urgency | Changes |
| --- | --- | --- | --- |
| `2.6.5` | 2026-05-27 | High | # Changes in `2.6.5`  <a name="changelog-pytorch"></a>    ## Lightning Fabric    <details open><summary>Changed</summary>    - Use fs.pipe() for S3/GCS checkpoint uploads in _atomic_save ([#21595](https://github.com/Lightning-AI/pytorch-lightning/pull/21595)    </details>    </br>    **Full commit list**: [2.6.4 -> 2.6.5](https://github.com/Lightning-AI/pytorch-lightning/compare/2.6.4...2.6.5)    <a name="contributors"></a>    # Contributors   **New Contributors**   * @c-pozz |
| `2.6.4` | 2026-05-20 | High | # Changes in `2.6.4`  <a name="changelog-pytorch"></a>    ## PyTorch Lightning    <details open><summary>Removed</summary>    - Removed support for Neptune logger ([#21572](https://github.com/Lightning-AI/pytorch-lightning/pull/21572)).    >*Note*: We usually don't remove features in a patch release, however in this case it's an exception since even without removing it the integration would be broken due to [Neptune being acquired and sunsetting public service](https://openai.com/index/ |
| `2.6.1` | 2026-04-21 | Low | Imported from PyPI (2.6.1) |
| `2.6.0` | 2025-11-28 | Low | # Changes in `2.6.0`  <a name="changelog-pytorch"></a>  ## PyTorch Lightning  <details open><summary>Added</summary>  - Added `WeightAveraging` callback that wraps the PyTorch `AveragedModel` class ([#20545](https://github.com/Lightning-AI/pytorch-lightning/pull/20545)) - Added Torch-Tensorrt integration with `LightningModule` ([#20808](https://github.com/Lightning-AI/pytorch-lightning/pull/20808)) - Added time-based validation support though `val_check_interval` ([#21071](https://gith |
| `2.5.6` | 2025-11-05 | Low | # Changes in `2.5.6`  <a name="changelog-pytorch"></a>  ## PyTorch Lightning  <details open><summary>Changed</summary>  - Add `name()` function to accelerator interface (([#21325](https://github.com/Lightning-AI/pytorch-lightning/pull/21325)))  </details>  <details open><summary>Removed</summary>  - Remove support for deprecated and archived lightning-habana package ([#21327](https://github.com/Lightning-AI/pytorch-lightning/pull/21327))  </details> |
| `2.5.5` | 2025-09-05 | Low | # Changes in `2.5.5`  <a name="changelog-pytorch"></a>  ## PyTorch Lightning  <details open><summary>Changed</summary>  - Include `exclude_frozen_parameters` to `DeepSpeedStrategy` ([#21060](https://github.com/Lightning-AI/pytorch-lightning/pull/21060)) - Include `PossibleUserWarning` that is raised if modules are in eval mode when training starts ([#21146](https://github.com/Lightning-AI/pytorch-lightning/pull/21146))  </details>  <details open><summary>Fixed</summary>  - Fixed ` |
| `2.5.4` | 2025-08-29 | Low | # Changes in `2.5.4`  <a name="changelog-pytorch"></a>  ## PyTorch Lightning  <details open><summary>Fixed</summary>  - Fixed `AsyncCheckpointIO` snapshots tensors to avoid race with parameter mutation ([#21079](https://github.com/Lightning-AI/pytorch-lightning/pull/21079)) - Fixed `AsyncCheckpointIO` threadpool exception if calling fit or validate more than one ([#20952](https://github.com/Lightning-AI/pytorch-lightning/pull/20952)) - Fixed learning rate not being correctly set after |
| `2.5.3` | 2025-08-13 | Low | # Notable changes in this release  <a name="changelog-pytorch"></a>  ## PyTorch Lightning  <details open><summary>Changed</summary>  - Added `save_on_exception` option to `ModelCheckpoint` Callback ([#20916](https://github.com/Lightning-AI/pytorch-lightning/pull/20916)) - Allow `dataloader_idx_` in log names when `add_dataloader_idx=False` ([#20987](https://github.com/Lightning-AI/pytorch-lightning/pull/20987)) - Allow returning `ONNXProgram` when calling `to_onnx(dynamo=True)` ([#2081 |
| `2.5.2` | 2025-06-20 | Low | # Notable changes in this release  <a name="changelog-pytorch"></a>  ## PyTorch Lightning  <details open><summary>Changed</summary>  - Add `toggled_optimizer(optimizer)` method to the LightningModule, which is a context manager version of `toggle_optimize` and `untoggle_optimizer` ([#20771](https://github.com/Lightning-AI/pytorch-lightning/pull/20771)) - For cross-device local checkpoints, instruct users to install `fsspec>=2025.5.0` if unavailable ([#20780](https://github.com/Lightning |
| `2.5.1.post0` | 2025-04-25 | Low | **Full Changelog**: https://github.com/Lightning-AI/pytorch-lightning/compare/2.5.1...2.5.1.post0 |

## Citation

- HTML: https://www.freshcrate.ai/projects/pytorch-lightning
- Markdown: https://www.freshcrate.ai/projects/pytorch-lightning.md
- Dependencies JSON: https://www.freshcrate.ai/api/projects/pytorch-lightning/deps

_Generated by freshcrate.ai. Indexes pypi releases for AI-agent ecosystem packages._
