astral-sh / uv

An extremely fast Python package and project manager, written in Rust.
https://docs.astral.sh/uv
Apache License 2.0
20.81k stars 614 forks source link

different behavior of uv pip install for x86 and aarch64 archs #7657

Closed senysenyseny16 closed 2 hours ago

senysenyseny16 commented 2 hours ago

Hello, I encountered the following problem:

x86     | pip install torch==2.1.0+cpu --extra-index-url https://download.pytorch.org/whl/cpu       | ✅
x86     | pip install torch==2.1.0 --extra-index-url https://download.pytorch.org/whl/cpu           | ✅ --+
x86     | uv pip install torch==2.1.0+cpu --extra-index-url https://download.pytorch.org/whl/cpu    | ✅   |
x86     | uv pip install torch==2.1.0 --extra-index-url https://download.pytorch.org/whl/cpu        | ❌   |
                                                                                                     [intersection]
aarch64 | pip install torch==2.1.0+cpu --extra-index-url https://download.pytorch.org/whl/cpu       | ❌   |
aarch64 | pip install torch==2.1.0 --extra-index-url https://download.pytorch.org/whl/cpu           | ✅ --+
aarch64 | uv pip install torch==2.1.0+cpu --extra-index-url https://download.pytorch.org/whl/cpu    | ❌
aarch64 | uv pip install torch==2.1.0 --extra-index-url https://download.pytorch.org/whl/cpu        | ✅

With pip, you can use pip install torch==2.1.0 --extra-index-url https://download.pytorch.org/whl/cpu command and it will work on both architectures, but for uv, you'll have to add a condition based on the architecture, which is very inconvenient, especially in the case of automation.

charliermarsh commented 2 hours ago

It's because the PyTorch index itself is inconsistent. Some of the wheels on that index use +cpu, and others don't, but they're all CPU wheels. I don't see this as something we can solve without redoing local variant supports and I don't anticipate doing that in the near future.

Screenshot 2024-09-23 at 3 26 14 PM

senysenyseny16 commented 2 hours ago

ok, thanks for the answer, I think I need to ask the Torch team why they did it that way.

charliermarsh commented 2 hours ago

I'm also interested, I really want to improve the Torch experience. I've seen https://github.com/pytorch/pytorch/issues/136275.