Skip to content

Conversation

@senokay
Copy link

@senokay senokay commented Jul 10, 2025

Torch is frequently installed with a local version identifier (e.g. +cu126), but that identifier causes an issue with pip because there is no public package with that identifier unless an explicit alternative index is used. The issue also happens to come with a quite cryptic ResolutionImpossible error (pypa/pip#13422) which completely obscures the actual issue.

Stripping the local version identifier should be safe, as we are only using constraints to ensure that per-model dependencies are aligned with existing installations.

Fun anecdote: Gemini was extensively used to discover the underlying issue. Full transcript here.

Torch is frequently installed with a local version identifier (e.g.
`+cu126`), but that identifier causes an issue with pip because there is
no public package with that identifier unless an explicit alternative
index is used. Stripping the local version identifier should be safe, as
we are only using constraints to ensure that per-model dependencies are
aligned with existing installations.
@senokay senokay force-pushed the ignore-local-version-in-constraints branch from 0a2f22d to c819823 Compare September 2, 2025 06:53
@senokay senokay temporarily deployed to docker-s3-upload September 5, 2025 20:30 — with GitHub Actions Inactive
@senokay senokay temporarily deployed to docker-s3-upload September 5, 2025 20:30 — with GitHub Actions Inactive
@xuzhao9
Copy link
Contributor

xuzhao9 commented Sep 5, 2025

This is a bit weird because we test on pytorch nightly, where the version is like 2.8.0.dev20250606+cu128, so I thought pip can correctly handle version suffix like +cu128...

@AmdSampsa
Copy link

AmdSampsa commented Dec 4, 2025

There seems to be another PR in this here: #2614
(since May!)
Please fix. When I ran

python3 install.py bacis_gnn_gcn

I got this beatifully formatted error dump:

checking packages numpy, torch, torchvision, torchaudio are installed, generating constaints...OK
Failed to install torchbenchmark requirements:
b"Collecting accelerate (from -r requirements.txt (line 1))\n  Using cached accelerate-1.12.0-py3-none-any.whl.metadata (19 kB)\nRequirement already satisfied: boto3 in /opt/venv/lib/python3.12/site-packages (from -r requirements.txt (line 2)) (1.35.42)\nCollecting bs4 (from -r requirements.txt (line 3))\n  Using cached bs4-0.0.2-py2.py3-none-any.whl.metadata (411 bytes)\nCollecting patch (from -r requirements.txt (line 4))\n  Using cached patch-1.16.zip (12 kB)\n  Installing build dependencies: started\n  Installing build dependencies: finished with status 'done'\n  Getting requirements to build wheel: started\n  Getting requirements to build wheel: finished with status 'done'\n  Preparing metadata (pyproject.toml): started\n  Preparing metadata (pyproject.toml): finished with status 'done'\nCollecting py-cpuinfo (from -r requirements.txt (line 5))\n  Using cached py_cpuinfo-9.0.0-py3-none-any.whl.metadata (794 bytes)\nRequirement already satisfied: distro in /opt/venv/lib/python3.12/site-packages (from -r requirements.txt (line 6)) (1.9.0)\nCollecting iopath (from -r requirements.txt (line 7))\n  Using cached iopath-0.1.10.tar.gz (42 kB)\n  Installing build dependencies: started\n  Installing build dependencies: finished with status 'done'\n  Getting requirements to build wheel: started\n  Getting requirements to build wheel: finished with status 'done'\n  Preparing metadata (pyproject.toml): started\n  Preparing metadata (pyproject.toml): finished with status 'done'\nRequirement already satisfied: pytest in /opt/venv/lib/python3.12/site-packages (from -r requirements.txt (line 8)) (7.3.2)\nCollecting pytest-benchmark (from -r requirements.txt (line 9))\n  Using cached pytest_benchmark-5.2.3-py3-none-any.whl.metadata (29 kB)\nRequirement already satisfied: requests in /opt/venv/lib/python3.12/site-packages (from -r requirements.txt (line 10)) (2.32.5)\nRequirement already satisfied: tabulate in /opt/venv/lib/python3.12/site-packages (from -r requirements.txt (line 11)) (0.9.0)\nCollecting timm==1.0.19 (from -r requirements.txt (line 12))\n  Using cached timm-1.0.19-py3-none-any.whl.metadata (60 kB)\nCollecting transformers==4.57.3 (from -r requirements.txt (line 13))\n  Using cached transformers-4.57.3-py3-none-any.whl.metadata (43 kB)\nCollecting MonkeyType (from -r requirements.txt (line 14))\n  Using cached MonkeyType-23.3.0-py3-none-any.whl.metadata (12 kB)\nRequirement already satisfied: psutil in /opt/venv/lib/python3.12/site-packages (from -r requirements.txt (line 15)) (7.1.0)\nRequirement already satisfied: pyyaml in /opt/venv/lib/python3.12/site-packages (from -r requirements.txt (line 16)) (6.0.3)\nRequirement already satisfied: numpy in /opt/venv/lib/python3.12/site-packages (from -r requirements.txt (line 17)) (2.1.2)\nCollecting opencv-python (from -r requirements.txt (line 18))\n  Using cached opencv_python-4.12.0.88-cp37-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.metadata (19 kB)\nCollecting submitit (from -r requirements.txt (line 19))\n  Using cached submitit-1.5.3-py3-none-any.whl.metadata (7.9 kB)\nCollecting nvidia-ml-py>=13.0.0 (from -r requirements.txt (line 20))\n  Using cached nvidia_ml_py-13.580.82-py3-none-any.whl.metadata (9.6 kB)\nRequirement already satisfied: pandas in /opt/venv/lib/python3.12/site-packages (from -r requirements.txt (line 21)) (2.2.3)\nRequirement already satisfied: scipy in /opt/venv/lib/python3.12/site-packages (from -r requirements.txt (line 22)) (1.14.1)\nRequirement already satisfied: numba>=0.57.0 in /opt/venv/lib/python3.12/site-packages (from -r requirements.txt (line 23)) (0.61.2)\nINFO: pip is looking at multiple versions of timm to determine which version is compatible with other requirements. This could take a while.\nERROR: Cannot install -r requirements.txt (line 12) because these package versions have conflicting dependencies.\n\nThe conflict is caused by:\n    timm 1.0.19 depends on torch\n    The user requested (constraint) torch==2.9.1+rocm7.1.1.git351ff442\n\nAdditionally, some packages in these conflicts have no matching distributions available for your environment:\n    torch\n\nTo fix this you could try to:\n1. loosen the range of package versions you've specified\n2. remove package versions to allow pip to attempt to solve the dependency conflict\n\nERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/topics/dependency-resolution/#dealing-with-dependency-conflicts\n"

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants