Skip to content

Commit ceb88fa

Browse files
committed
fix: align Torch wheels with LibTorch minor ABI
1 parent 89cbb7f commit ceb88fa

8 files changed

Lines changed: 36 additions & 12 deletions

File tree

‎.github/workflows/pypi.yml‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,7 @@ jobs:
496496
if-no-files-found: error
497497

498498
test-torch-full-wheel-compatibility:
499-
name: Full wheel / ${{ matrix.os }} / py${{ matrix.python-version }} / torch2.11
499+
name: Full wheel / ${{ matrix.os }} / py${{ matrix.python-version }} / torch2.10
500500
needs: [build-torch-linux, build-windows-wheels]
501501
runs-on: ${{ matrix.os }}
502502
strategy:
@@ -522,13 +522,13 @@ jobs:
522522
with:
523523
name: ${{ matrix.artifact }}
524524
path: ${{ runner.temp }}/wheel-artifact
525-
- name: Validate full wheel with Torch 2.11
525+
- name: Validate full wheel with Torch 2.10
526526
shell: pwsh
527527
working-directory: ${{ runner.temp }}
528528
run: |
529529
python -m pip install --upgrade pip
530530
$nativeExit=$LASTEXITCODE; if ($nativeExit -ne 0) { exit $nativeExit }
531-
python -m pip install --no-cache-dir torch==2.11.0 `
531+
python -m pip install --no-cache-dir torch==2.10.0 `
532532
--index-url https://download.pytorch.org/whl/cu128
533533
$nativeExit=$LASTEXITCODE; if ($nativeExit -ne 0) { exit $nativeExit }
534534
$artifactDir = Join-Path $env:RUNNER_TEMP "wheel-artifact"
@@ -539,6 +539,8 @@ jobs:
539539
$wheel = $wheels[0].FullName
540540
python -m pip install --no-deps --force-reinstall $wheel
541541
$nativeExit=$LASTEXITCODE; if ($nativeExit -ne 0) { exit $nativeExit }
542+
python -m pip check
543+
$nativeExit=$LASTEXITCODE; if ($nativeExit -ne 0) { exit $nativeExit }
542544
python -I "$env:GITHUB_WORKSPACE/tests/packaging/wheel_lifecycle_smoke.py" installed torch
543545
$nativeExit=$LASTEXITCODE; if ($nativeExit -ne 0) { exit $nativeExit }
544546
python -m pip uninstall -y rayd-torch

‎CHANGELOG.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ All notable changes to RayD are documented in this file.
2222
implemented.
2323
- Expanded single- and multi-GPU CUDA/OptiX CI, Stable ABI checks, wheel
2424
install/uninstall lifecycle validation, and release-artifact verification.
25+
- Bound the complete `rayd-torch` wheel to its PyTorch 2.10 build minor; the
26+
separately audited `_stable_ops` slice retains cross-version validation.
2527

2628
### Fixed
2729

‎README.md‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,10 @@ Release artifacts cover CPython 3.10 through 3.14 on Windows x86-64 and
4242
`manylinux_2_28_x86_64`. The native backend wheels are CPython-specific while
4343
the Torch backend still contains the transitional `_C` extension. The
4444
`_stable_ops` library inside `rayd-torch` is untagged and uses the LibTorch 2.10
45-
Stable ABI boundary. The `rayd` meta-distribution is a universal pure-Python
46-
wheel and is the only distribution that also publishes an sdist.
45+
Stable ABI boundary. The complete `rayd-torch` wheel requires PyTorch 2.10
46+
(`torch>=2.10,<2.11`) while that separately audited Stable ABI library is
47+
validated through PyTorch 2.13. The `rayd` meta-distribution is a universal
48+
pure-Python wheel and is the only distribution that also publishes an sdist.
4749

4850
> [!IMPORTANT]
4951
> Since 0.6.0, RayD uses explicit backend namespaces. The parent `rayd` namespace does

‎docs/dev/ci_build_matrix.md‎

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,20 @@ the two backend projects use the unique `pypi-rayd-drjit` and
5050
| `build-drjit-linux` | Five parallel CPython 3.10-3.14 cibuildwheel jobs | Build and repair five `rayd-drjit` `manylinux_2_28_x86_64` wheels inside CUDA-enabled manylinux images |
5151
| `build-torch-linux` | Five parallel CPython 3.10-3.14 cibuildwheel jobs | Build and repair five full `rayd-torch` wheels; audit `_legacy_ops`, `_stable_ops`, external framework dependencies, and CUDA images |
5252
| `build-windows-wheels` | 2 backends x Python 3.10-3.14 on `windows-2022` | Build and audit ten `win_amd64` wheels |
53-
| `test-torch-full-wheel-compatibility` | Ubuntu and Windows x Python 3.10-3.14 | Install every matching `rayd-torch` wheel with PyTorch 2.11/cu128 and run the complete installed/uninstalled native lifecycle |
53+
| `test-torch-full-wheel-compatibility` | Ubuntu and Windows x Python 3.10-3.14 | Install every matching `rayd-torch` wheel with its PyTorch 2.10/cu128 build baseline and run the complete installed/uninstalled native lifecycle |
54+
| `test-stable-torch-abi` | Ubuntu and Windows across Torch 2.10-2.13 | Extract and load the same `_stable_ops` library under every supported Stable ABI runtime |
5455
| `build-meta` | Python 3.12 on Ubuntu | Build and check the pure Python `rayd` wheel and sdist |
5556
| `validate-wheel-set` | Ubuntu, after all build and compatibility jobs | Validate the complete release artifact set via `tests.packaging.test_release_artifact_matrix`; gates every publish job |
5657
| `publish-*` | published GitHub Releases only, on `ubuntu-latest` | Publish backend wheels first, then the meta distribution, using PyPI trusted publishing |
5758

5859
Both native backends keep `manylinux_2_28` rather than changing to the witwin `manylinux_2_35` tag. This is a stricter backward-compatibility target and matches the Dr.Jit and PyTorch 2.10/cu128 Linux wheels used by the builds.
5960

61+
The complete `rayd-torch` wheel uses non-Stable-ABI `at::` and `c10::` APIs in
62+
`_legacy_ops`, so its runtime dependency is restricted to the PyTorch 2.10
63+
minor used to build it. PyTorch requires separate wheels per version for such
64+
extensions; only the audited `_stable_ops` slice is cross-version, and its
65+
matrix continues to load the same binary under PyTorch 2.10 through 2.13.
66+
6067
Every Linux matrix entry uses cibuildwheel's isolated test environment to
6168
load the installed public backend and native extension, then uninstalls the
6269
distribution and confirms that the backend import is absent. Every Windows
@@ -82,7 +89,7 @@ Torch native source builds require CUDA Toolkit 11.3 or newer. The legacy
8289
library resolves `cuCtxGetCurrent` through the CUDA runtime only when an OptiX
8390
context is requested, so installed-wheel imports have no direct
8491
`libcuda.so`/`nvcuda.dll` dependency. The hosted full-wheel lifecycle injects
85-
no driver stub on either OS, then loads every wheel with PyTorch 2.11 before
92+
no driver stub on either OS, then loads every wheel with PyTorch 2.10 before
8693
uninstalling it. Actual CUDA and OptiX execution remains owned by the
8794
self-hosted GPU acceptance workflows.
8895

‎tests/governance/test_gpu_ci_contract.py‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ def test_release_torch_build_and_lifecycle_use_one_pinned_version(self) -> None:
131131
self.assertIn("python torch/scripts/verify_driver_independence.py $wheel", windows)
132132
self.assertEqual(self.release.count("torch/scripts/verify_driver_independence.py"), 2)
133133

134-
def test_torch_211_full_wheel_lifecycle_covers_every_published_wheel(self) -> None:
134+
def test_torch_baseline_full_wheel_lifecycle_covers_every_published_wheel(self) -> None:
135135
lifecycle = self.release.split(" test-torch-full-wheel-compatibility:", 1)[1].split(
136136
" test-stable-torch-abi:", 1
137137
)[0]
@@ -149,16 +149,18 @@ def test_torch_211_full_wheel_lifecycle_covers_every_published_wheel(self) -> No
149149
"name: ${{ matrix.artifact }}",
150150
"path: ${{ runner.temp }}/wheel-artifact",
151151
"working-directory: ${{ runner.temp }}",
152-
"torch==2.11.0",
152+
"torch==2.10.0",
153153
"https://download.pytorch.org/whl/cu128",
154154
"pip install --no-deps --force-reinstall $wheel",
155+
"python -m pip check",
155156
'wheel_lifecycle_smoke.py" installed torch',
156157
"pip uninstall -y rayd-torch",
157158
'wheel_lifecycle_smoke.py" absent torch',
158159
):
159160
with self.subTest(marker=marker):
160161
self.assertIn(marker, lifecycle)
161162

163+
self.assertNotIn("torch==2.11.0", lifecycle)
162164
validation = self.release.split(" validate-wheel-set:", 1)[1].split(" publish-drjit:", 1)[0]
163165
self.assertIn("- test-torch-full-wheel-compatibility", validation)
164166

@@ -172,7 +174,7 @@ def test_windows_native_release_commands_fail_immediately(self) -> None:
172174
)[0]
173175

174176
self.assertEqual(windows.count(fail_fast), 13)
175-
self.assertEqual(compatibility.count(fail_fast), 6)
177+
self.assertEqual(compatibility.count(fail_fast), 7)
176178

177179
windows_command_tails = (
178180
'python -m pip install --upgrade pip build twine "scikit-build-core>=0.10" "cmake>=3.22" ninja',
@@ -196,6 +198,7 @@ def test_windows_native_release_commands_fail_immediately(self) -> None:
196198
"python -m pip install --upgrade pip",
197199
"--index-url https://download.pytorch.org/whl/cu128",
198200
"python -m pip install --no-deps --force-reinstall $wheel",
201+
"python -m pip check",
199202
'python -I "$env:GITHUB_WORKSPACE/tests/packaging/wheel_lifecycle_smoke.py" installed torch',
200203
"python -m pip uninstall -y rayd-torch",
201204
'python -I "$env:GITHUB_WORKSPACE/tests/packaging/wheel_lifecycle_smoke.py" absent torch',

‎tests/packaging/test_torch_project_metadata.py‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,11 @@ def test_default_dependencies_require_torch_not_dr_jit(self):
2828
def test_transitional_wheels_cover_supported_python_and_torch_baseline(self):
2929
data = tomllib.loads((TORCH_ROOT / "pyproject.toml").read_text())
3030
self.assertEqual(data["project"]["requires-python"], ">=3.10,<3.15")
31-
self.assertIn("torch>=2.10,<2.12", data["project"]["dependencies"])
31+
self.assertEqual(data["project"]["dependencies"], ["torch>=2.10,<2.11"])
3232
self.assertIn("torch==2.10.0", data["build-system"]["requires"])
33+
readme = (TORCH_ROOT / "README.md").read_text(encoding="utf-8")
34+
self.assertIn("require PyTorch 2.10", readme)
35+
self.assertIn("validated across PyTorch 2.10 through 2.13", readme)
3336

3437
def test_public_python_source_has_no_obsolete_product_name(self):
3538
source_roots = (TORCH_ROOT / "python" / "rayd" / "torch", WORKSPACE_ROOT / "python" / "rayd" / "_impl")

‎torch/README.md‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ import rayd.torch as rt
1010
Install the `rayd-torch` distribution. It owns only `rayd/torch/**` and can
1111
coexist with the independently installed `rayd-drjit` backend.
1212

13+
Published complete wheels are built for and require PyTorch 2.10
14+
(`torch>=2.10,<2.11`) because `_legacy_ops` uses the non-Stable-ABI
15+
LibTorch C++ surface. The separately audited `_stable_ops` library remains
16+
validated across PyTorch 2.10 through 2.13.
17+
1318
Published wheels contain both native backends and do not require an OptiX SDK
1419
at runtime. Building this dual-backend distribution from source does require
1520
the OptiX SDK headers, even when the target machine will select CUDA at

‎torch/pyproject.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ readme = "README.md"
1010
authors = [{ name = "Xingyu Chen", email = "xic063@ucsd.edu" }]
1111
license = "BSD-3-Clause"
1212
requires-python = ">=3.10,<3.15"
13-
dependencies = ["torch>=2.10,<2.12"]
13+
dependencies = ["torch>=2.10,<2.11"]
1414

1515
[tool.scikit-build]
1616
build-dir = "build/{wheel_tag}"

0 commit comments

Comments
 (0)