install: make torch 2.11 the default supported line on wheel-backed platforms

Fresh installs now resolve the torch 2.11 trio (torch 2.11.0,
torchvision 0.26.0, torchaudio 2.11.0) everywhere the wheels exist,
verified by live index resolution for py3.11-3.13: Linux x86_64
(cpu, cu126, cu128, cu130, rocm7.1, rocm7.2), Linux aarch64 (cpu,
cu130), Windows x86_64 (cpu, cu126, cu128, cu130; triton-windows<3.7
resolves 3.6.0.post26, the 2.11 pairing) and macOS arm64. Existing
installs are unaffected: the release preservation on both installers
keeps the installed torch on re-runs (verified end to end against the
live cpu index: a seeded 2.10.0 venv stays 2.10.0 with paired 0.25/2.10
companions while a fresh venv resolves the 2.11 trio).

- install.sh: the supported range is centralized in _TORCH_CEILING /
  _TORCHVISION_CEILING / _TORCHAUDIO_CEILING and composed into the
  default constraints, so the next bump (torch 2.12) is a three-line
  change. The now-redundant cu* widen arm and custom-pin companion
  block collapse into the default; the curated ROCm >=2.11 floors stay
  literal.
- install.ps1: the hoisted default trio, the CUDA flavor repair and the
  ROCm CPU fallback all use the <2.12 trio (the leaf gate collapsed
  since cu and non-cu now share the range).
- setup.ps1: the unknown-leaf pinned CUDA trio widens to <2.12,
  matching the pinned cpu path.

Deliberately NOT widened: rocm6.4 (tops at torch 2.9.1) and rocm7.0
(2.10.0) by index content; macOS x86_64 (no >=2.4 wheels, stays
no-torch); the AMD per-arch repo.amd.com curated bounds for arches
outside the 2.11 allowlist.

Constraint suites updated to the ceiling scheme; parity suites updated
to the widened trio. All sh, ps1 and pytest installer suites pass (the
host-defaults suite and the tokenizers negative-control are known
pre-existing failures).
This commit is contained in:
Daniel Han 2026-07-20 10:44:42 +00:00
commit 3f79b5e53d
6 changed files with 100 additions and 132 deletions

View file

@ -405,30 +405,25 @@ class TestKnown211SetParity:
), f"{label} floor gate must not use the unanchored ^rocm(\\d+)\\.(\\d+) prefix"
def test_install_ps1_bounds_unknown_leaf_pinned_torch(self):
"""install.ps1's pinned-torch install must bound BOTH companions on EVERY
index, cu<digits> families included: torchaudio 2.11 dropped its exact torch
pin from the wheel metadata, so a bare companion beside torch<2.11 can
resolve a mismatched 2.11.0 build (Codex P2, then unconditional per the
torchaudio 2.11 unpinning)."""
"""install.ps1's pinned-torch install must bound the whole trio on EVERY
index with the default torch 2.11 line (<2.12 trio, matching install.sh's
ceiling-composed default and _CUDA_TORCH_PKG_SPEC): torchaudio 2.11
dropped its exact torch pin from the wheel metadata, so a bare companion
beside a capped torch can resolve a mismatched build."""
text = INSTALL_PS1.read_text(encoding = "utf-8")
assert (
'$_pinVisionSpec = "torchvision>=0.19,<0.26.0"' in text
), "install.ps1 custom-pin install must bound torchvision (>=0.19,<0.26.0)"
assert (
'$_pinAudioSpec = "torchaudio>=2.4,<2.11.0"' in text
), "install.ps1 custom-pin install must bound torchaudio (>=2.4,<2.11.0)"
# cu<digits> leaves widen the whole trio to the torch 2.11 line (<2.12),
# matching install.sh's cu[0-9]* widen and _CUDA_TORCH_PKG_SPEC; other
# leaves keep the 2.10 line. The trio stays bounded on every index.
assert '$_pinTorchSpec = "torch>=2.4,<2.12.0"' in text, (
"install.ps1 must widen torch to <2.12.0 on cu<digits> index leaves"
"install.ps1 default install must use the torch 2.11 line (<2.12.0)"
)
assert (
'$_pinVisionSpec = "torchvision>=0.19,<0.27.0"' in text
), "install.ps1 cu-leaf install must pair torchvision <0.27.0 with torch <2.12"
), "install.ps1 must pair torchvision <0.27.0 with torch <2.12"
assert (
'$_pinAudioSpec = "torchaudio>=2.4,<2.12.0"' in text
), "install.ps1 cu-leaf install must pair torchaudio <2.12.0 with torch <2.12"
), "install.ps1 must pair torchaudio <2.12.0 with torch <2.12"
# No stale 2.10-line default remains anywhere in the Windows installer.
assert '"torch>=2.4,<2.11.0"' not in text, (
"install.ps1 must not retain a <2.11.0 default torch range"
)
# The bounded trio must actually be passed to the install command.
assert re.search(
r'\$_pinTorchSpec \$_pinVisionSpec \$_pinAudioSpec --default-index \$TorchIndexUrl',
@ -672,9 +667,9 @@ class TestPinnedIndexClearsUvEnvParity:
# The custom-leaf branch bounds torch AND both companions (parity with the
# other installers' custom-pin trio bounds), gated on a non-cu-family leaf.
for spec in (
'$cudaTorchSpec = "torch>=2.4,<2.11.0"',
'$cudaVisionSpec = "torchvision>=0.19,<0.26.0"',
'$cudaAudioSpec = "torchaudio>=2.4,<2.11.0"',
'$cudaTorchSpec = "torch>=2.4,<2.12.0"',
'$cudaVisionSpec = "torchvision>=0.19,<0.27.0"',
'$cudaAudioSpec = "torchaudio>=2.4,<2.12.0"',
):
assert spec in text, f"setup.ps1 must bound the custom-leaf trio: {spec}"
assert (