Changelog

Version 2.4.0 (2024-10-02)

New Features

  • Added strategy="fsdp_native" for PyTorch 2.0+ native FSDP with activation checkpointing.

  • New StochasticWeightAveraging callback.

  • Added Trainer(barebones=True) mode — disables all non-essential features for maximum throughput.

  • LightningModule.log_dict() now supports nested dict keys (e.g., "metrics/train/loss").

  • New NeptuneLogger for Neptune.ai integration.

  • Trainer(compile=True) shorthand to compile the model with torch.compile().

  • Async checkpointing: checkpoints are now saved in a background thread by default.

Breaking Changes

  • Dropped Python 3.8 support. Minimum is now Python 3.9.

  • Trainer(gpus=...) and Trainer(tpu_cores=...) removed (deprecated since 2.0). Use devices= instead.

  • LightningModule.on_post_move_to_device() removed.

Deprecations

  • Trainer(auto_lr_find=True) deprecated; use from lightning.pytorch.tuner import Tuner instead.

Version 2.3.0 (2024-07-15)

New Features

  • Full PyTorch 2.3 compatibility including torch.compile() integration.

  • New Lightning CLI — train models from YAML config files without writing Python:

    lightning fit --config config.yaml
    lightning validate --config config.yaml --ckpt_path best
    lightning predict --config config.yaml --ckpt_path last
    

Bug Fixes

  • Fixed gradient accumulation with accumulate_grad_batches > 1 and strategy="fsdp".

  • Fixed ModelCheckpoint.best_model_path returning None after trainer.test().

  • Fixed memory leak in RichProgressBar when leave=False.

Version 2.2.0 (2024-04-11)

New Features

  • LightningModule now supports configure_model() hook for model parallel setups.

  • Added Trainer(reload_dataloaders_every_n_epochs=N) parameter.

  • New lightning.pytorch.utilities.grad_norm utility function.

Version 2.0.0 (2023-09-01)

Major Release

  • Complete rewrite of the Trainer internals.

  • Minimum PyTorch bumped to 2.0.

  • Introduced lightning.fabric.Fabric — a lightweight alternative to Trainer for fine-grained control.

  • New plugin system for custom accelerators and strategies.

  • DeepSpeed strategy updated to DeepSpeed 0.12.

  • Unified lightning package combining pytorch-lightning and lightning-fabric.