2.0 is the newest version of PyTorch Lightning. It offers the same best-in-class capabilities for scaling and structuring your PyTorch code, but with less complexity, easier debugging, and a tighter core package. This update also introducesLightning Fabric, a complementary library that can be used for more complex tasks that require finer control over your training loop, like reinforcement learning.
2.0 introduces a simpler reading and debugging experience with fewer abstractions and a tighter core package that removes outdated integrations.
We decided to call the 1.x series mature at this point because the goals of this latest release aligned closely with some key feedback from the community. In this release, we’re committing to making a concerted effort to keep the PyTorch Lightning 2.0 API stable and where it is today. We’re also introduced a simplified Trainer codebase with fewer abstractions, making it more readable and easier to debug.
You can use: pip install Lightning
For most users upgrading from 1.9 to 2.0, we don’t anticipate many breaking changes. Users upgrading from older versions may run into breaking changes. For a detailed overview of migrating 1.x code to 2.0, take a look at ourmigration guide.
If you’re using PyTorch Lightning 1.4 or later, you can use ourmigration guideto determine how best to proceed to migrating your code to 2.0.
While we strongly recommend upgrading to PyTorch Lightning 2.0, we will continue offering long-term support for PyTorch Lightning 1.9.x. We won’t be adding new features to this previous version, but we will apply fixes to it. If you’re relying on features that have been removed in 2.0, you can still use them in the 1.9.x line.
You can join Lightning’sDiscord serverand chat directly with our developers.
Yes, you can train a compiled model with PyTorch Lightning 2.0. Learn morehere.