Install any skill in seconds. Free to start, no credit card required.
Get Started Free →brycewang-stanford/pytorch-lightning-guide
PyTorch Lightning framework for scalable model training and research
Passed 21 of 23 test cases with the skill, and 17 of 23 without it.
and 3 more in the full report
4 fixed17 passed either way2 still failing0 broke
Tokens, turns and time describe resource use, not a dollar price.
One of 4 test cases the skill fixed. Same model, same prompt, with and without the skill.
After completing model training with a Trainer, I want to evaluate performance on the test dataloader using the best model checkpoint generated during training rather than the final epoch state. How do I invoke this in Python?
| Checked | Without skill | With skill |
|---|---|---|
| Calls trainer.test(). | Missed | Passed |
| Passes ckpt_path="best" to trainer.test(). | Missed | Passed |
The instructions your model reads when the skill loads.
PyTorch Lightning is a deep learning framework with over 31,000 GitHub stars that provides a high-level interface for PyTorch, enabling researchers to focus on model design rather than engineering boilerplate. Developed by Lightning AI, it decouples the science (model architecture, loss functions, data processing) from the engineering (distributed training, mixed precision, gradient accumulation, checkpointing) through a structured LightningModule abstraction.
For academic researchers, Lightning eliminates the need to write repetitive training loops, device management code, and distributed training logic. You define your model, training step, and data loaders, and Lightning handles everything else -- from single GPU to multi-node distributed training, from FP32 to mixed precision, from local development to cloud deployment. This means faster iteration on research ideas with production-quality training infrastructure.
Lightning is used extensively in AI research labs and has become a standard tool for reproducible deep learning experiments. It integrates seamlessly with experiment tracking tools like Weights & Biases, MLflow, and TensorBoard, and supports all PyTorch-compatible model architectures.
# Install PyTorch Lightning
pip install lightning
# Or install with specific extras
pip install lightning[extra]
# For development/research with all features
pip install lightning[all]
Lightning requires Python 3.9+ and PyTorch 2.1+. For GPU training, ensure your PyTorch installation includes CUDA support:
# Check GPU availability
python -c "import torch; print(torch.cuda.is_available())"
Verify your installation:
import lightning as L
print(L.__version__)
test cases passed, vs 17 / 23 without
Published skills whose descriptions closely match this one, with their headline benchmark lift.
More skills from the same source and nearby in the registry, with their headline benchmark lift.