Skip to content

Local UI to run and train LLMs and diffusion models. Supports GGUF, MLX, Qwen3.8, DeepSeek-V4.1, MiniMax-H3, Gemma 4, FLUX and more.

Prebuilt CUDA wheels: torch 2.11 for Windows x64 (#13563)

Daniel Han8e039a66ac15
diff --git a/.github/scripts/prebuilt_wheels.py b/.github/scripts/prebuilt_wheels.py
index de4cf515b57..89e33640a52 100644
--- a/.github/scripts/prebuilt_wheels.py
+++ b/.github/scripts/prebuilt_wheels.py
@@ -80,6 +80,9 @@ PLATFORMS = {
"abi": "TRUE",
"label": " / win_amd64",
"pytorch_nvcc": "C:/ccache/ccache.exe C:/cuda/bin/nvcc.exe",
+ # On top of TORCH_VERSIONS: Linux reuses upstream's torch2.10 wheels for 2.11, which have
+ # no Windows build.
+ "extra_torches": ("2.11.0",),
},
# Upstream's aarch64 wheels stop at torch 2.10. ubuntu-22.04-arm keeps the glibc 2.35 floor
# the x86_64 build has, and the build asserts it.
@@ -127,9 +130,9 @@ def _platform(platform: str, key: str):
return PLATFORMS[platform].get(key, _PLATFORM_DEFAULTS.get(key))
-# torch 2.13 pins triton==3.7.1 and 2.14 triton~=3.8.0 (Linux-only markers); exact pins keep
-# the Windows smoke test reproducible.
-TRITON_WINDOWS = {"2.13": "3.7.1.post27", "2.14": "3.8.0.post29"}
+# torch 2.11 pins triton==3.6.0, 2.13 triton==3.7.1 and 2.14 triton~=3.8.0 (Linux-only
+# markers); exact pins keep the Windows smoke test reproducible.
+TRITON_WINDOWS = {"2.11": "3.6.0.post26", "2.13": "3.7.1.post27", "2.14": "3.8.0.post29"}
WINDOWS_SMOKE_EXCLUDE = ("triton", "tilelang", "apache-tvm-ffi", "quack-kernels")
# Source revisions, pinned to a commit rather than a branch or a tag.
@@ -210,6 +213,23 @@ SPECS = {
# version to pip install, so the table is keyed by the full version and the minor is derived.
TORCH_VERSIONS = ("2.13.0", "2.14.0")
+
+def _platform_torches(platform: str) -> tuple[str, ...]:
+ """What a platform builds: its own `torches`, else TORCH_VERSIONS plus its `extra_torches`."""
+ return _platform(platform, "torches") or (
+ *(_platform(platform, "extra_torches") or ()),
+ *TORCH_VERSIONS,
+ )
+
+
+# Accepted from a dispatch; each platform builds only its own subset (2.11.0 is win_amd64 only).
+ALLOWED_TORCH = tuple(
+ sorted(
+ {torch for platform in PLATFORMS for torch in _platform_torches(platform)},
+ key = lambda v: tuple(map(int, v.split("."))),
+ )
+)
+
# cp313 is the default and the only one the dispatch defaults to, because each extra
# interpreter is a whole extra flash-attn build. 3.11 and 3.12 are here so a run can add them
# as separate cells when the queue can afford it. 3.14 is deliberately absent: torch publishes
@@ -315,14 +335,14 @@ def build_matrix(
platforms: str = "",
) -> list[dict]:
chosen_packages = _resolve(packages, DEFAULT_PACKAGES, DEFAULT_PACKAGES, "package")
- chosen_torch = _resolve(torches, TORCH_VERSIONS, DEFAULT_TORCH, "torch version")
+ chosen_torch = _resolve(torches, ALLOWED_TORCH, DEFAULT_TORCH, "torch version")
chosen_python = _resolve(pythons, PYTHON_VERSIONS, DEFAULT_PYTHON, "python version")
chosen_platforms = _resolve(platforms, tuple(PLATFORMS), DEFAULT_PLATFORMS, "platform")
include = []
for platform in chosen_platforms:
target = PLATFORMS[platform]
- torches = _platform(platform, "torches") or TORCH_VERSIONS
+ torches = _platform_torches(platform)
packages_here = _platform(platform, "packages") or tuple(SPECS)
local = _platform(platform, "torch_local")
for torch_version in chosen_torch:
@@ -376,7 +396,8 @@ def build_matrix(
if not include:
raise SystemExit(
"no cells: none of the chosen platforms builds that package / torch combination "
- "(win_arm64 builds causal-conv1d and mamba-ssm for torch 2.14.0 only)."
+ "(torch 2.11.0 is win_amd64 only; win_arm64 builds causal-conv1d and mamba-ssm for "
+ "torch 2.14.0 only)."
)
return include
@@ -453,14 +474,25 @@ PLATFORM_NAMES = {
def _coverage(rows: list[dict]) -> str:
- """`PyTorch 2.13 and 2.14 on Python 3.13` for a set of parsed rows."""
- torches = sorted({row["torch"] for row in rows}, key = lambda v: tuple(map(int, v.split("."))))
- # cp313 -> 3.13
- pythons = [
- f"{cp[2]}.{cp[3:]}"
- for cp in sorted({row["python"] for row in rows}, key = lambda cp: int(cp[3:]))
+ """`PyTorch 2.13 and 2.14 on Python 3.13` for a set of parsed rows.
+
+ Torch minors with different interpreter sets are listed separately, so 2.11 on 3.11-3.13
+ beside 2.13 on 3.13 alone never reads as 2.13 on 3.11.
+ """
+ by_torch: dict[str, set[str]] = {}
+ for row in rows:
+ by_torch.setdefault(row["torch"], set()).add(row["python"])
+ groups: dict[tuple[str, ...], list[str]] = {}
+ for torch in sorted(by_torch, key = lambda v: tuple(map(int, v.split(".")))):
+ # cp313 -> 3.13
+ pythons = tuple(
+ f"{cp[2]}.{cp[3:]}" for cp in sorted(by_torch[torch], key = lambda cp: int(cp[3:]))
+ )
+ groups.setdefault(pythons, []).append(torch)
+ parts = [
+ f"{_join(torches)} on Python {_join(list(pythons))}" for pythons, torches in groups.items()
]
- return f"PyTorch {_join(torches)} on Python {_join(pythons)}"
+ return f"PyTorch {'; '.join(parts)}"
def _packages(rows: list[dict]) -> str:
@@ -555,12 +587,15 @@ def _cmd_matrix(args: argparse.Namespace) -> int:
def _cmd_wheel_name(args: argparse.Namespace) -> int:
if args.package not in SPECS:
raise SystemExit(f"unknown package: {args.package}")
- if args.torch not in TORCH_VERSIONS:
+ if args.torch not in ALLOWED_TORCH:
raise SystemExit(f"unknown torch version: {args.torch}")
if args.python not in PYTHON_VERSIONS:
raise SystemExit(f"unknown python version: {args.python}")
if args.platform not in PLATFORMS:
raise SystemExit(f"unknown platform: {args.platform}")
+ # The same cells build_matrix accepts: no name for a wheel nothing builds.
+ if args.torch not in _platform_torches(args.platform):
+ raise SystemExit(f"torch {args.torch} is not built for {args.platform}")
print(wheel_name(args.package, args.torch, args.python, args.platform))
return 0
diff --git a/.github/workflows/prebuilt-cuda-wheels.yml b/.github/workflows/prebuilt-cuda-wheels.yml
index 3d5327b2cd1..d4c6f1cf0a5 100644
--- a/.github/workflows/prebuilt-cuda-wheels.yml
+++ b/.github/workflows/prebuilt-cuda-wheels.yml
@@ -29,7 +29,7 @@ on:
workflow_dispatch:
inputs:
torch_versions:
- description: 'torch versions to build for, comma separated (2.13.0, 2.14.0)'
+ description: 'torch versions to build for, comma separated (2.13.0, 2.14.0; 2.11.0 builds on win_amd64 only)'
type: string
default: '2.13.0,2.14.0'
python_versions:
diff --git a/tests/python/test_prebuilt_cuda_wheels_windows.py b/tests/python/test_prebuilt_cuda_wheels_windows.py
index 1d92dc76b1a..7712e807b92 100644
--- a/tests/python/test_prebuilt_cuda_wheels_windows.py
+++ b/tests/python/test_prebuilt_cuda_wheels_windows.py
@@ -142,12 +142,51 @@ class TestMatrix:
assert cell["smoke_extra"] == cell["smoke_exclude"] == ""
def test_every_torch_minor_has_a_triton_windows_pin(self):
- """torch 2.13 pins triton 3.7.1 and 2.14 pins triton 3.8.x; triton-windows mirrors those."""
- minors = {prebuilt_wheels.torch_minor(v) for v in prebuilt_wheels.TORCH_VERSIONS}
+ """torch 2.11 pins triton 3.6.0, 2.13 3.7.1 and 2.14 3.8.x; triton-windows mirrors those."""
+ minors = {
+ prebuilt_wheels.torch_minor(v)
+ for platform, target in prebuilt_wheels.PLATFORMS.items()
+ if target["os"] == "windows"
+ for v in prebuilt_wheels._platform_torches(platform)
+ }
assert set(prebuilt_wheels.TRITON_WINDOWS) == minors
+ assert prebuilt_wheels.TRITON_WINDOWS["2.11"].startswith("3.6.0.post")
assert prebuilt_wheels.TRITON_WINDOWS["2.13"].startswith("3.7.1.post")
assert prebuilt_wheels.TRITON_WINDOWS["2.14"].startswith("3.8.0.post")
+ def test_torch_211_is_win_amd64_only_and_opt_in(self):
+ cells = prebuilt_wheels.build_matrix(
+ torches = "2.11.0", platforms = "win_amd64", pythons = "3.11,3.12,3.13"
+ )
+ assert len(cells) == 9
+ assert {cell["python_tag"] for cell in cells} == {"cp311", "cp312", "cp313"}
+ assert {cell["torch_spec"] for cell in cells} == {"torch==2.11.0"}
+ for cell in cells:
+ assert "+cu13torch2.11cxx11abiTRUE-" in cell["wheel_name"]
+ if cell["package"] == "mamba-ssm":
+ assert cell["smoke_extra"] == "triton-windows==3.6.0.post26"
+ for platform in ("linux_x86_64", "linux_aarch64", "win_arm64"):
+ with pytest.raises(SystemExit):
+ prebuilt_wheels.build_matrix(torches = "2.11.0", platforms = platform)
+ # A default dispatch builds what it did before.
+ assert "2.11.0" not in {cell["torch"] for cell in prebuilt_wheels.build_matrix()}
+ both = prebuilt_wheels.build_matrix(torches = "2.11.0,2.13.0")
+ assert {(c["platform"], c["torch"]) for c in both} == {
+ ("win_amd64", "2.11.0"),
+ ("win_amd64", "2.13.0"),
+ ("linux_x86_64", "2.13.0"),
+ }
+
+ def test_win_amd64_inherits_a_new_global_torch(self, monkeypatch):
+ monkeypatch.setattr(prebuilt_wheels, "TORCH_VERSIONS", ("2.13.0", "2.14.0", "2.15.0"))
+ assert prebuilt_wheels._platform_torches("win_amd64") == (
+ "2.11.0",
+ "2.13.0",
+ "2.14.0",
+ "2.15.0",
+ )
+ assert prebuilt_wheels._platform_torches("linux_x86_64")[-1] == "2.15.0"
+
def test_pytorch_nvcc_paths_have_no_spaces(self):
"""torch writes PYTORCH_NVCC into build.ninja verbatim; a space would split a path."""
for target in prebuilt_wheels.PLATFORMS.values():
@@ -227,6 +266,33 @@ class TestNames:
).stdout.strip()
assert out == "causal_conv1d-1.7.0+cu13torch2.13cxx11abiTRUE-cp313-cp313-win_amd64.whl"
+ def test_wheel_name_cli_refuses_a_cell_nothing_builds(self):
+ def name(*platform):
+ return subprocess.run(
+ [
+ sys.executable,
+ str(SCRIPTS / "prebuilt_wheels.py"),
+ "wheel-name",
+ "--package",
+ "mamba-ssm",
+ "--torch",
+ "2.11.0",
+ "--python",
+ "3.12",
+ *platform,
+ ],
+ capture_output = True,
+ text = True,
+ )
+
+ for platform in ([], ["--platform", "linux_x86_64"], ["--platform", "win_arm64"]):
+ result = name(*platform)
+ assert result.returncode != 0
+ assert "not built for" in result.stderr
+ result = name("--platform", "win_amd64")
+ assert result.returncode == 0
+ assert result.stdout.strip().endswith("torch2.11cxx11abiTRUE-cp312-cp312-win_amd64.whl")
+
def test_round_trip_on_both_platforms(self):
for platform in prebuilt_wheels.PLATFORMS:
for package in prebuilt_wheels.SPECS:
@@ -279,6 +345,24 @@ class TestNotes:
"built for PyTorch 2.13 and 2.14 on Python 3.13.\n"
)
+ def test_torch_minors_with_different_interpreters_are_not_merged(self):
+ entries = [
+ (f"{index:064x}", prebuilt_wheels.wheel_name(package, torch, python, "win_amd64"))
+ for index, (package, torch, python) in enumerate(
+ [
+ (pkg, "2.11.0", py)
+ for py in ("3.11", "3.12", "3.13")
+ for pkg in prebuilt_wheels.SPECS
+ ]
+ + [(pkg, t, "3.13") for t in ("2.13.0", "2.14.0") for pkg in prebuilt_wheels.SPECS]
+ )
+ ]
+ notes = prebuilt_wheels.render_notes(entries, tag = "t", repo = "r")
+ assert (
+ "built for PyTorch 2.11 on Python 3.11, 3.12 and 3.13; 2.13 and 2.14 on Python 3.13."
+ in notes
+ )
+
def test_platforms_with_different_coverage_are_not_merged(self):
entries = _entries(["linux_x86_64"]) + _entries(["win_amd64"], torches = ("2.14.0",))
notes = prebuilt_wheels.render_notes(entries, tag = "t", repo = "o/r")