cuda.core: bump tensor bridge PyTorch upper-bound to 2.12#2099
Open
aryanputta wants to merge 1 commit into
Open
cuda.core: bump tensor bridge PyTorch upper-bound to 2.12#2099aryanputta wants to merge 1 commit into
aryanputta wants to merge 1 commit into
Conversation
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 NVIDIA#2089
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #2089.
Problem
PyTorch 2.12 was released on ~May 14 2026. The version guard in
_torch_version_check()(cuda_core/cuda/core/_memoryview.pyx) capped the AOTI tensor bridge at(2, 11), so_is_torch_tensor()returnedFalsefor any torch tensor under 2.12.As a result, torch tensors fell through to the generic CAI/DLPack paths and raised:
Fix
Extend the upper bound from
(2, 11)to(2, 12). TheTHPVariablestruct layout (PyObject_HEADfollowed byat::Tensor cdata) and theAtenTensorHandle == at::Tensor*identity are stable across PyTorch 2.x minor releases, as they have been across 2.3–2.11.Testing
This change cannot be exercised without a PyTorch 2.12 build in CI. The existing tensor bridge tests (
cuda_core/tests/) cover the code path; they will validate correctness once a 2.12 runner is available. The nightly CI matrix already references alatestPyTorch entry (seenightly.yml) which should pick up 2.12.