Skip to content

Commit ffac267

Browse files
aryanputtarwgk
andauthored
cuda.core: bump tensor bridge PyTorch upper-bound to 2.12 (#2099)
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 Co-authored-by: Ralf W. Grosse-Kunstleve <[email protected]>
1 parent 92994e4 commit ffac267

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎cuda_core/cuda/core/_memoryview.pyx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ cdef dict _torch_type_cache = {}
4343
cdef object _torch_version_ok = None
4444

4545
cdef inline bint _torch_version_check():
46-
"""Return True if 2.3 <= torch <= 2.11 (known AOTI ABI range). Memoized.
46+
"""Return True if 2.3 <= torch <= 2.12 (known AOTI ABI range). Memoized.
4747
4848
Lower bound: AOTI functions we use were introduced in PyTorch 2.3.
4949
Upper bound: the ``pyobj_to_aten_handle`` trick relies on the
@@ -64,7 +64,7 @@ cdef inline bint _torch_version_check():
6464
try:
6565
major, minor = int(torch.__version__.split(".")[0]), \
6666
int(torch.__version__.split(".")[1])
67-
_torch_version_ok = (2, 3) <= (major, minor) <= (2, 11)
67+
_torch_version_ok = (2, 3) <= (major, minor) <= (2, 12)
6868
except (ValueError, IndexError):
6969
_torch_version_ok = False
7070
return <bint>_torch_version_ok

0 commit comments

Comments
 (0)