From ab35b387e38ec880087435e782e0fe972b7e374e Mon Sep 17 00:00:00 2001 From: Aryan Date: Sat, 16 May 2026 16:50:13 -0400 Subject: [PATCH] cuda.core: bump tensor bridge PyTorch upper-bound to 2.12 PyTorch 2.12 was released on ~May 14 2026. The version guard in _torch_version_check() capped the AOTI tensor bridge at (2, 11), causing _is_torch_tensor() to return False for torch tensors under 2.12. As a result, torch tensors fell through to the generic CAI/DLPack paths and raised: BufferError: only CUDA Array Interface v3 or above is supported The THPVariable struct layout and AtenTensorHandle aliasing are stable across PyTorch 2.x minor releases. Extend the upper bound to (2, 12). Closes #2089 --- cuda_core/cuda/core/_memoryview.pyx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cuda_core/cuda/core/_memoryview.pyx b/cuda_core/cuda/core/_memoryview.pyx index 3ebde8dcff1..20253a9c2b1 100644 --- a/cuda_core/cuda/core/_memoryview.pyx +++ b/cuda_core/cuda/core/_memoryview.pyx @@ -43,7 +43,7 @@ cdef dict _torch_type_cache = {} cdef object _torch_version_ok = None cdef inline bint _torch_version_check(): - """Return True if 2.3 <= torch <= 2.11 (known AOTI ABI range). Memoized. + """Return True if 2.3 <= torch <= 2.12 (known AOTI ABI range). Memoized. Lower bound: AOTI functions we use were introduced in PyTorch 2.3. Upper bound: the ``pyobj_to_aten_handle`` trick relies on the @@ -64,7 +64,7 @@ cdef inline bint _torch_version_check(): try: major, minor = int(torch.__version__.split(".")[0]), \ int(torch.__version__.split(".")[1]) - _torch_version_ok = (2, 3) <= (major, minor) <= (2, 11) + _torch_version_ok = (2, 3) <= (major, minor) <= (2, 12) except (ValueError, IndexError): _torch_version_ok = False return _torch_version_ok