Route torch 2.11.x to the torch2110 extra family in auto-install selector

unsloth/_auto_install.py fell through to RuntimeError("Torch = {v} too
new!") for any installed torch >= 2.10.1, so an environment running torch
2.11.x could not resolve the new cu{cuda}-torch2110 extras. Add a 2.11.x
branch right after the 2.10.1 case. The existing CUDA guard already permits
12.6/12.8/13.0 for torch >= 2.10, matching the cu126/cu128/cu130 torch2110
extras.
This commit is contained in:
Daniel Han 2026-07-08 06:31:18 +00:00
commit bf9bca08e0

View file

@ -36,6 +36,7 @@ elif v < V('2.8.9'): x = 'cu{}{}-torch280'
elif v < V('2.9.1'): x = 'cu{}{}-torch290'
elif v < V('2.9.2'): x = 'cu{}{}-torch291'
elif v < V('2.10.1'): x = 'cu{}{}-torch2100'
elif v < V('2.11.1'): x = 'cu{}{}-torch2110'
else: raise RuntimeError(f"Torch = {v} too new!")
if v > V('2.6.9') and cuda not in ("11.8", "12.6", "12.8", "13.0"): raise RuntimeError(f"CUDA = {cuda} not supported!")
if v >= V('2.10.0') and cuda not in ("12.6", "12.8", "13.0"): raise RuntimeError(f"Torch 2.10 requires CUDA 12.6, 12.8, or 13.0! Got CUDA = {cuda}")