Skip to content

Please offer <version>+cpu-versioned packages for MacOS and linux ARM CPU-only buildsΒ #136275

Open

Description

@cfeenstra67

πŸš€ 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

Activity

  1. malfet commented on Sep 19, 2024

    @malfet
    Collaborator

    IMO as find-links file has been abandoned a while back, we should get rid of +XYZ suffixes for package names
    cc: @atalman @seemethere

  2. zanieb commented on Sep 19, 2024

    @zanieb

    Can you describe what you mean by abandoned? We have relatively first class support for it in uv.

  3. malfet commented on Sep 19, 2024

    @malfet
    Collaborator

    Can you describe what you mean by abandoned? We have relatively first class support for it in uv.

    I don't think there are any CI tests that validate torch_xyz.html lists 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?

  4. zanieb commented on Sep 20, 2024

    @zanieb

    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.

  5. added
    triagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate module
    on Sep 23, 2024
  6. charliermarsh commented on Sep 24, 2024

    @charliermarsh

    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!

  7. self-assigned this
    on Sep 24, 2024
  8. jantrienes commented on Nov 12, 2024

    @jantrienes

    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>+cpu were available.

  9. tmarback commented on Jun 25, 2026

    @tmarback

    This seems to have been fixed for Linux ARM at some point, but the MacOS wheels still use just <version> instead of <version>+cpu like 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)

  10. panfengli-work commented on Jun 25, 2026

    @panfengli-work

    @atalman any idea on offering <version>+cpu-versioned packages for MacOS? As @tmarback mentioned that linux ARM CPU-only builds are supported now.

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

Metadata

Metadata

Assignees

Labels

oncall: relengIn support of CI and Release EngineeringtriagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate module

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions