`torch` resolves to 2.14.0 (PyPI) or 2.11.0+cu128 (download.pytorch.org/whl/cu128) depending on install path (pip install .)
Checks
- This template is only for bug reports, usage problems go with 'Help Wanted'.
- I have thoroughly reviewed the project documentation but couldn't find information to solve my problem.
- I have searched for existing issues, including closed ones, and couldn't find a solution.
- I am using English to submit this issue to facilitate community communication.
Environment Details
- pip 26.2.1, uv 0.12.10, CPython 3.11, Linux x86_64 (Ubuntu 24.04 on WSL2)
- repository at commit
08be0b4ccbac3e13e374e86fbfead4b4cac343e2 - index contents as observed on 2026-09-07; file URLs and sha256 in the table below make the result re-checkable
Steps to Reproduce
Dry-run resolutions (nothing is installed), Python 3.11, Linux x86_64, pip 26.2.1 / uv 0.12.10, index state of 2026-09-07:
# A: `pip install .` (pyproject/requirements only, PyPI)
pip install --dry-run --report a.json "torch"
# -> `torch 2.14.0` from PyPI
# B: `uv sync` / `uv pip install .` (pyproject with `[tool.uv.sources]`)
uv lock # in the repo checkout (honours [tool.uv.sources]); or: uv pip compile --emit-index-annotation -o b.txt req.txt # req.txt: "torch"
# -> `torch 2.11.0+cu128` from download.pytorch.org/whl/cu128✔️ Expected Behavior
Every documented install path selects the same file for the package(s) above (same version, same index, same hash), or the documentation states which build is intended.
❌ Actual Behavior
torch: 2.14.0 (PyPI) vs 2.11.0+cu128 (download.pytorch.org/whl/cu128).
Description
The repository documents more than one way to install it, and they do not produce the same environment: following pip install . installs torch 2.14.0 from PyPI, while following uv sync / uv pip install . installs torch 2.11.0+cu128 from download.pytorch.org/whl/cu128. A user who reads the README/Dockerfile expects the CUDA/ROCm build named there, but depending on the installer and index order gets a different variant or major version, which is confusing to debug (GPU silently unused, mismatched CUDA libraries) and means the two paths are not tested against the same dependencies. Because the selection is decided by index visibility and installer semantics rather than by the project, it is also an exposure: whichever index publishes a higher version of these names decides what gets installed.
torch:
pip install .(pyproject/requirements only, PyPI) →torch 2.14.0from PyPIuv sync/uv pip install .(pyproject with[tool.uv.sources]) →torch 2.11.0+cu128from download.pytorch.org/whl/cu128
Root cause and proposed fix
Consequences
- Users following one path get a different PyTorch build (CUDA/ROCm/CPU variant or major version) than users following the other; GPU code may run on CPU or fail to load CUDA libraries.
- The environment produced by one path is not the one exercised in CI, so bug reports are hard to reproduce.
- The two paths install files with different hashes from different indexes; which build (and whose build) ends up in the environment is decided by index order and installer behaviour rather than by the project's declaration, and the two files were not verified against each other here.
Root cause
pip applies version priority across all indexes it can see (PEP 766): when PyPI is visible next to a download.pytorch.org channel, the newer PyPI release wins over the +cuXXX build. uv's default first-index strategy does the opposite (first index that has the name). The selected build therefore depends on the installer and on whether the channel is passed as --index-url or --extra-index-url, not on the declaration. [tool.uv.sources] is honoured only by uv; every pip install command in the docs/Dockerfile ignores it and resolves from the indexes on its own command line.
Where the repo binds these packages to an index
pyproject.toml:81 —torch→ https://download.pytorch.org/whl/cu128README.md:74 —torch→ https://pytorch-extension.intel.com/release-whl/stable/xpu/us/ (pip install torch torchaudio --index-url https://pytorch-extension.intel.com/release-whl/stable/xpu/)uv.lock—torch→ https://download.pytorch.org/whl/cu128 (uv.lock: torch==2.8.0+cu128 from pytorch:cu128)README.md:49 —torch→ https://download.pytorch.org/whl/cu128 (pip install torch==2.8.0+cu128 torchaudio==2.8.0+cu128 --extra-index-url https://download.pytorch.or)pyproject.toml:82 —torch→ https://download.pytorch.org/whl/cu128 ({ index = "pytorch-cuda", marker = "sys_platform == 'linux' or sys_platform == 'win32'" },)
Proposed fix
- Commit a lock (
uv.lock, orpip-compile/pip lockoutput with hashes) and make the README/Dockerfile/CI install from it, so every documented path resolves identical files.
Selected files
| case | install path | package | version | index | file | sha256 |
|---|---|---|---|---|---|---|
| 1 | pip install . (pyproject/requirements only, PyPI) |
torch |
2.14.0 | PyPI | torch-2.14.0-cp311-cp311-manylinux_2_28_x86_64.whl | 8d9e232b6376c62f |
| 1 | uv sync / uv pip install . (pyproject with [tool.uv.sources]) |
torch |
2.11.0+cu128 | download.pytorch.org/whl/cu128 | torch-2.11.0+cu128-cp311-cp311-manylinux_2_28_x86_64.whl | c9a7ca4c74fae10a |
Found by an automated check that resolves the declared dependencies under each documented install path and diffs the selected files. File URLs and sha256 hashes are listed above so the result can be re-checked independently.
Source: k2-fsa/OmniVoice