Skip to content

Probe for matching torch version, not just live URL - #1185

Merged
willghatch merged 2 commits into
mainfrom
users/willghatch/gen-pytorch-requirements-probe-better
Mar 25, 2026
Merged

Probe for matching torch version, not just live URL#1185
willghatch merged 2 commits into
mainfrom
users/willghatch/gen-pytorch-requirements-probe-better

Conversation

@willghatch

Copy link
Copy Markdown
Contributor

The gen-pytorch-rocm-requirements.py script was selecting the first wheel source whose URL responded to an HTTP HEAD, without checking whether it actually contained a torch version matching the spec. When the PyTorch Foundation rocm7.2 index only carries torch>=2.11 but TORCH_SPEC requires <2.9, the install silently failed and fell back to a CUDA build from PyPI.

Replace the HTTP HEAD probe with one that fetches the package listing and verifies a matching torch wheel exists before selecting a source. This lets the script correctly fall through to the AMD --find-links repo when the PyTorch index lacks a compatible version.

The gen-pytorch-rocm-requirements.py script was selecting the first wheel source whose URL responded to an HTTP HEAD, without checking whether it actually contained a torch version matching the spec.
When the PyTorch Foundation rocm7.2 index only carries torch>=2.11 but TORCH_SPEC requires <2.9, the install silently failed and fell back to a CUDA build from PyPI.

Replace the HTTP HEAD probe with one that fetches the package listing and verifies a matching torch wheel exists before selecting a source.
This lets the script correctly fall through to the AMD --find-links repo when the PyTorch index lacks a compatible version.

Signed-off-by: William G Hatch <william@hatch.uno>
@willghatch
willghatch requested review from ftynse and tgymnich March 25, 2026 03:30
Comment thread gen-pytorch-rocm-requirements.py Outdated
Comment thread gen-pytorch-rocm-requirements.py Outdated
Signed-off-by: William G Hatch <william@hatch.uno>
@willghatch
willghatch force-pushed the users/willghatch/gen-pytorch-requirements-probe-better branch from 9bbb7ca to 91e0864 Compare March 25, 2026 15:10
@willghatch
willghatch merged commit 396ee77 into main Mar 25, 2026
29 of 30 checks passed
@willghatch
willghatch deleted the users/willghatch/gen-pytorch-requirements-probe-better branch March 25, 2026 15:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants