Repository navigation
Description
π The feature, motivation and pitch
This is a duplicate of this issue: #110004 , which was closed as implemented w/ a note that it should be reopened if we continue to see issues.
Apologies if there is already an open issue for this, I searched around but wasn't able to find one.
Currently the behavior when trying to use the CPU-only builds hosted at https://download.pytorch.org/whl/cpu with Poetry is as follows:
If I declare a torch dependency in my pyproject.toml as follows:
[tool.poetry.dependencies]
torch = { version = "2.4.1", source = "torch-cpu" }
[[tool.poetry.source]]
name = "torch-cpu"
url = "https://download.pytorch.org/whl/cpu"
priority = "explicit"Running poetry install will fail on MacOS and Linux machines using an ARM processor saying it cannot find an installation candidate. What happens is that when poetry resolves dependencies with poetry lock, it will only resolve one version. When it looks at the pytorch CPU builds index, it finds 2.4.1+cpu and treats it as the highest version, and does not consider 2.4.1 as the same version. However, when I look at the actual files in the index, they look like:
torch-2.4.1+cpu-cp310-cp310-linux_x86_64.whl
torch-2.4.1+cpu-cp310-cp310-win_amd64.whl
...
torch-2.4.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
torch-2.4.1-cp310-none-macosx_11_0_arm64.whl
...
So the wheels are available for these two platforms, they just don't have the +cpu portion appended to the version number and so poetry treats them as different, and in fact cannot resolve the mac and arm linux ones because it always finds *+cpu to be the highest version number and doesn't consider the other files to be part of that version.
Obviously part of this is a few pieces of less than ideal behavior from poetry, but there have been a bunch of discussions in their repo related to this and it doesn't sound like any behavior change is forthcoming that will help.
It's also possible that I'm not totally understanding the initial resolution in the issue I linked to above. That indicates that this should work after torch 2.1, but looking back at the CPU wheels I don't see any time when the macos and arm linux wheels were published with +cpu so it's possible that I'm missing some existing way of making this work (though it's definitely not for lack of trying)
Alternatives
The alternative is to use direct URLs to the wheels for each platform needed. This isn't too bad, but it would be really nice to be able to upgrade without needing to go copy and paste several URLs (especially when using multiple packages e.g. torch and torchvision)
Additional context
No response
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsCold Storage
- StatusShow more project fieldsNo status
Activity
malfet commentedon Sep 19, 2024
IMO as find-links file has been abandoned a while back, we should get rid of
+XYZsuffixes for package namescc: @atalman @seemethere
zanieb commentedon Sep 19, 2024
Can you describe what you mean by abandoned? We have relatively first class support for it in uv.
malfet commentedon Sep 19, 2024
I don't think there are any CI tests that validate
torch_xyz.htmllists validity. But glad to hear that they still work. Just curious, why are you using those instead of index-urls, which are more compact and structured?zanieb commentedon Sep 20, 2024
Sorry, I thought you meant the find-links format in general β I'm not actually a torch consumer I just receive issues from people struggling to install it and am hoping to gain more context as we extend uv's index interface. Generally, we recommend people use index-urls. We do have problems handling torch's use of the local version segment though.
charliermarsh commentedon Sep 24, 2024
Sorry to hijack the issue but I'm very interested in creating a better torch experience for uv users. If anyone from the torch team is interested in talking through that, let me know!
jantrienes commentedon Nov 12, 2024
We are also running into these resolution troubles with PDM. There are similar discussions in the PDM repository (pdm-project/pdm#2430, pdm-project/pdm#2696, pdm-project/pdm#694) which could probably be solved or simplified if the
<version>+cpuwere available.tmarback commentedon Jun 25, 2026
This seems to have been fixed for Linux ARM at some point, but the MacOS wheels still use just
<version>instead of<version>+cpulike the rest. It would be really nice if this could get fixed for MacOS too, as this inconsistency requires more complex setups to work around in most tools and tends to run in all sorts of jagged edges (which feels a little silly for what should be arguably the simplest version of Pytorch to use)panfengli-work commentedon Jun 25, 2026
@atalman any idea on offering
<version>+cpu-versionedpackages for MacOS? As @tmarback mentioned that linux ARM CPU-only builds are supported now.Publish linux/arm64 adapter images (fixes ARM install failure)
feat(clip): the embed task β frames and QUERIES in one space