-
Notifications
You must be signed in to change notification settings - Fork 29
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
Handling of PyTorch CPU versions #402
Comments
Changing the torch line to |
Thanks for the thorough explanation. This issue seems pretty complex. And I'm not sure I completely understand it. |
Not completely. Mostly as I don't understand what kind of thing the I'm guessing that The fuller solution here is probably to support different versions (modulo some checking that they're just different flavours of the same version) on different platforms, though that feels like it's much bigger change. |
PyTorch has versions like
2.0.0
but also2.0.0+cpu
. I'm not sure what the term for the+cpu
part is, though they don't seem to be impacted by using--forbid-post
so I'm guessing that they're not seen as post releases.PyTorch uses the
+cpu
tag on Linux to provide CPU-only packages which are considerably smaller than the equivalent GPU package. These are available with--extra-index-url https://download.pytorch.org/whl/cpu
.Unfortunately those packages don't exist for MacOS, so including
torch==2.0.0+cpu
in a requirements file breaks things for developers on macs.However you can include just
--extra-index-url https://download.pytorch.org/whl/cpu
andtorch == 2.0.0
in requirements files and they'll work fine for Linux users and for Mac users. Notably in this case Linux users will get the CPU-optimised package from the custom index, which will install as2.0.0+cpu
.Clearly the way that this is working is a bit funky already. I'm not completely sure I like it, however I suspect PyTorch is big enough that getting them to change it is unlikely.
pip-compile
seems quite happy to leavetorch==2.0.0
in requirements files where that is pinned (in the input), howeverpip-compile-multi
does not do so if there is a sibling package which also pulls intorch
.Thus:
With
pip-compile
With
pip-compile-multi
I would ideally like to be able to specify that I always want the non-
+cpu
variant of the package to be listed in the requirements file.The text was updated successfully, but these errors were encountered: