-
Notifications
You must be signed in to change notification settings - Fork 30
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. |
If assume the terminology comes from semantic version str, 0![v]2.0.0a1.post7.dev5+g1234567-d20241212 0! is epoch only needed if the versioning scheme was changed and don't want the two versioning schemes to be mixed up.
2.0.0 is x.y.z major micro patch a1 is pre-release. Which is a confusing term cuz pre-release also includes dev version. Other options is b and rc, beta and release candidate respectively. post7 is post-release. Meaning there were bugs in a tagged and released. Which needed to be later fixed. dev5 is a development commit. Lets not even call it a release +g1234567-d20241212 is the locals. First letter is the scm system, in this case,
The context is a tagged release, not a development commit, sha and date are not helpful in a tagged release. The locals are being used here for other purpose. But it's still a valid semantic version str |
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: