Lightning AI Studios: Never set up a local environment again →

← Back to blog

PyTorch Lightning 2.0 FAQ

1. What is PyTorch Lightning 2.0?

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 introduces Lightning Fabric, a complementary library that can be used for more complex tasks that require finer control over your training loop, like reinforcement learning.

 

2. How is PyTorch Lightning 2.0 different from 1.x?

2.0 introduces a simpler reading and debugging experience with fewer abstractions and a tighter core package that removes outdated integrations.

 

3. Why have you decided to move to 2.0 now?

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.

 

4. How do I install PyTorch Lightning 2.0?

You can use: pip install Lightning

 

5. Is PyTorch Lightning 2.0 backwards-compatible with 1.x?

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 our migration guide.

 

6. How can I migrate my PyTorch Lightning 1.x code to 2.0?

If you’re using PyTorch Lightning 1.4 or later, you can use our migration guide to determine how best to proceed to migrating your code to 2.0.

 

7. Can I continue using PyTorch Lightning 1.x?

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.

 

8. Where can I ask questions about PyTorch Lightning 2.0?

You can join Lightning’s Discord server and chat directly with our developers.

 

9. Can I use torch.compile with PyTorch Lightning 2.0?

Yes, you can train a compiled model with PyTorch Lightning 2.0. Learn more here.