Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pinning the lightning package doesn't pin the pytorch_lightning package #20000

Open
silasbrack opened this issue Jun 20, 2024 · 2 comments
Open
Labels
package question Further information is requested

Comments

@silasbrack
Copy link

Bug description

For reasons, I have to use torch<2.0; I can see that in lightning 2.3.0 the torch dependency was constrained to be >2.0, so I decided to pin it, but (after much debugging) I realised that lightning was installing a different version of pytorch-lightning, which was the actual package causing the issues.

What version are you seeing the problem on?

v2.2, master

How to reproduce the bug

pip install lightning==2.2.5

This will install `pytorch-lightning==2.3.0`.
I thought the name change was mostly for branding purposes, so I suppose that it would be nicer to pin the package here?

Error messages and logs

# Error messages and logs here please

Environment

Current environment
#- Lightning Component (e.g. Trainer, LightningModule, LightningApp, LightningWork, LightningFlow):
#- PyTorch Lightning Version (e.g., 1.5.0):
#- Lightning App Version (e.g., 0.5.2):
#- PyTorch Version (e.g., 2.0):
#- Python version (e.g., 3.9):
#- OS (e.g., Linux):
#- CUDA/cuDNN version:
#- GPU models and configuration:
#- How you installed Lightning(`conda`, `pip`, source):
#- Running environment of LightningApp (e.g. local, cloud):

More info

No response

@silasbrack silasbrack added bug Something isn't working needs triage Waiting to be triaged by maintainers labels Jun 20, 2024
@awaelchli
Copy link
Member

Unfortunately, the decision was made that when the package was renamed, the new lightning package would ship pytorch-lightning as a dependency so that users could still use both ways of importing the package. But that also means if you pin lightning, this won't automatically pin the other one, and that's simply not possible to achieve. In general terms, if you have a package x that depends on y, then it wouldn't make sense to pin y to the same version than x.

If you have project dependencies and want to fix the lightning version, please specify the version pins for both packages.

For example:

lightning<2.3
pytorch-lightning<2.3

@awaelchli awaelchli added question Further information is requested package and removed bug Something isn't working needs triage Waiting to be triaged by maintainers ver: 2.2.x labels Jun 22, 2024
@awaelchli
Copy link
Member

awaelchli commented Jun 22, 2024

I think the possibility of not including pytorch-lightning anymore is an option for the future, as more users have transitioned to the new import and package name.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants