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

Specify compatible PyTorch version in Requires-Dist #200

Open
mikepii opened this issue Feb 15, 2023 · 2 comments
Open

Specify compatible PyTorch version in Requires-Dist #200

mikepii opened this issue Feb 15, 2023 · 2 comments

Comments

@mikepii
Copy link

mikepii commented Feb 15, 2023

🚀 The feature, motivation and pitch

Since each distribution wheel is built for a particular version of PyTorch, it would be helpful to specify that PyTorch version in Requires-Dist in the package metadata. E.g., in setup.py: setup(install_requires=['torch==1.13.1+cu116']).

This helps fail-fast if an incompatible version is being installed. For organizations storing these wheels in a private package repository, this also allows pip to automatically select the right version if a version range is specified.

Alternatives

Can otherwise specify a particular Torch version's subdirectory of the downloads site using pip --find-links ..., but that doesn't fail-fast if the version is incompatible

Additional context

No response

@mikepii mikepii changed the title Specify compatible pytorch version in Requires-Dist Specify compatible PyTorch version in Requires-Dist Feb 15, 2023
@alexandervaneck
Copy link

To add to this. Due to not including the Requires-Dist tag it is easy to accidentally installs versions that should be incompatible.

An example torch==1.13.1 and torch-scatter==2.1.0+pt112cu116

$ PIP_FIND_LINKS="https://download.pytorch.org/whl/cu116/torch_stable.html https://data.pyg.org/whl/torch-1.12.0+cu116.html" pip install torch==1.13.1 torch-scatter
Looking in links: https://download.pytorch.org/whl/cu116/torch_stable.html, https://data.pyg.org/whl/torch-1.12.0+cu116.html
Requirement already satisfied: torch==1.13.1 in /usr/local/lib/python3.10/dist-packages (1.13.1+cu116)
Collecting torch-scatter
  Downloading https://data.pyg.org/whl/torch-1.12.0%2Bcu116/torch_scatter-2.1.0%2Bpt112cu116-cp310-cp310-linux_x86_64.whl (9.0 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 9.0/9.0 MB 2.0 MB/s eta 0:00:00
Requirement already satisfied: typing-extensions in /usr/local/lib/python3.10/dist-packages (from torch==1.13.1) (4.5.0)
Installing collected packages: torch-scatter
Successfully installed torch-scatter-2.1.0+pt112cu116

@rusty1s
Copy link
Member

rusty1s commented Feb 17, 2023

I think this would be a more fitting issue in, e.g., pyg-lib (since PyG has no dependency on a particular PT/CUDA version). Other than that, I agree with you. Can we close this issue here and create a similar one for pyg-lib? I don't think we need to include other ones as we are in the process of deprecating them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants