Saving and loading checkpoints (basic) — PyTorch Lightning 2.4.0 documentation
When a model is training, the performance changes as it continues to see more data. It is a best practice to save the state of a model throughout the training process. This gives you a version of the model, a checkpoint, at each key point during the development of the model. Once training has completed, use the checkpoint that corresponds to the best performance you found during the training process. Checkpoints also enable your training to resume from where it was in case the training process is interrupted. PyTorch Lightning checkpoints are fully usable in plain PyTorch. A Lightning checkpoint contains a dump of the model’s entire internal state. Unlike plain PyTorch, Lightning saves everything you need to restore a model even in the most complex distributed training environments. Inside a Lightning checkpoint you’ll find: 16-bit scaling factor (if using 16-bit precision training) Current epoch Global step LightningModule’s state_dict State of all optimizers State of all learning rat
Saving and loading checkpoints (basic) ¶ Audience: All users What is a checkpoint? ¶ When a model is training, the performance changes as it continues to see more data. It is a best practice to save the state of a model throughout the training process. This gives you a version of the model, a checkpoint , at each key point during the development of the model. Once training has completed, use the checkpoint that corresponds to the best performance you found during the training process. Checkpoints also enable your training to resume from where it was in case the training process is interrupted.
Explore this link on the map →related reading
- Customize checkpointing behavior (intermediate) - PyTorch Lightning 2.6.1 documentationlightning.ai
- ModelCheckpoint - PyTorch Lightning 2.6.1 documentationlightning.ai
- Trainer - PyTorch Lightning 2.6.1 documentationlightning.ai
- LightningModule - PyTorch Lightning 2.6.1 documentationlightning.ai
- ⚡ Migrating from PTL - Composerdocs.mosaicml.com
- ⏯️ Autoresume Training - Composerdocs.mosaicml.com
- Get Started with Distributed Training using PyTorch Lightning — Ray 2.56.0docs.ray.io
- Composer2.pdfcursor.com
- Current and New Activation Checkpointing Techniques in PyTorch – PyTorchpytorch.org
- frontier model training methodologies | Alex Wa's Blogdjdumpling.github.io
- API Reference — TensorRT LLMnvidia.github.io
- 👨👩👧👦 Distributed Training - Composerdocs.mosaicml.com