Skip to content

fix(core): respect DLPack byte offsets - #2595

Closed
aryanputta wants to merge 1 commit into
NVIDIA:mainfrom
aryanputta:agent/fix-dlpack-byte-offset
Closed

fix(core): respect DLPack byte offsets#2595
aryanputta wants to merge 1 commit into
NVIDIA:mainfrom
aryanputta:agent/fix-dlpack-byte-offset

Conversation

@aryanputta

@aryanputta aryanputta commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes #2592 by including DLTensor.byte_offset when initializing StridedMemoryView.ptr from a DLPack capsule.

Root cause

The capsule import path used DLTensor.data directly, while the DLPack byte offset was ignored. The internal capsule helper already accounts for this offset.

Test

Added a regression test that constructs a versioned CPU DLPack capsule with a nonzero byte offset and verifies both the pointer and NumPy round trip.

Validation

  • Python syntax compilation passed.
  • git diff --check passed.
  • Runtime pytest is environment-blocked locally because the repository test helper hardcodes Linux libc.so.6; the test remains included for CI validation.

@copy-pr-bot

copy-pr-bot Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@github-actions github-actions Bot added the cuda.core Everything related to the cuda.core module label Aug 10, 2026
@aryanputta
aryanputta force-pushed the agent/fix-dlpack-byte-offset branch from ccb7e90 to e0d3c4e Compare August 10, 2026 18:49
@aryanputta aryanputta closed this Aug 10, 2026

Copy link
Copy Markdown
Contributor Author

Closing this as a duplicate of #2594, which already contains the same production fix plus versioned and unversioned regression coverage.

@aryanputta
aryanputta deleted the agent/fix-dlpack-byte-offset branch August 10, 2026 18:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cuda.core Everything related to the cuda.core module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG]: StridedMemoryView.from_dlpack ignores DLTensor.byte_offset

1 participant