Skip to content

[DLPack] Update to include DLPack C Exchange API#984

Open
tqchen wants to merge 5 commits intodata-apis:mainfrom
tqchen:dlpack-c-exchange
Open

[DLPack] Update to include DLPack C Exchange API#984
tqchen wants to merge 5 commits intodata-apis:mainfrom
tqchen:dlpack-c-exchange

Conversation

@tqchen
Copy link

@tqchen tqchen commented Dec 12, 2025

This PR updates to include dlpack C exchange api for fast exchange at c-extension level without going through python.

This PR updates to include dlpack C exchange api for fast exchange
at c-extension level without going through python.
@tqchen
Copy link
Author

tqchen commented Dec 12, 2025

Respective dlpack PR on python spec dmlc/dlpack#180

@tqchen
Copy link
Author

tqchen commented Dec 12, 2025

cc @rgommers @leofang

@tqchen
Copy link
Author

tqchen commented Dec 12, 2025

Implements #973

@tqchen
Copy link
Author

tqchen commented Feb 20, 2026

cc @rgommers @leofang i think this should be ready to merge

@rgommers rgommers self-requested a review March 2, 2026 08:50
@kgryte kgryte added this to the v2026 milestone Mar 2, 2026
@rgommers rgommers added the topic: DLPack DLPack. label Mar 5, 2026
Copy link
Member

@rgommers rgommers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @tqchen! I refreshed my memory here, I think this PR largely looks good and we're probably ready to put this in. My main question right now is: given it's been in use in PyTorch for a couple of months now, do you have any real-world experience to share so far? No issues, did it help a lot performance-wise, etc.

@tqchen
Copy link
Author

tqchen commented Mar 5, 2026

thanks @rgommers , updated to address your reviews. In terms of the current state, it has been merged into PyTorch and used through some of the tvm-ffi integrations through paddle and other env. So far no issues identified and it does help reducing host overhead in the specific case of tvm-ffi

@rgommers
Copy link
Member

rgommers commented Mar 6, 2026

We touched on this PR in the community meeting yesterday. The general feeling was that it's time to merge this. @seberg and @leofang may want to have another look. I plan to merge this at the end of next week unless there are more concerns.

The feeling in the meeting is that it would be better if this new C API in DLPack would be a complete replacement for the __dlpack__ Python API. Right now it's a partial replacement; e.g., one thing that is missing is the "copy to CPU" functionality. That said, the C struct can be extended in future DLPack releases to add more functionality. And this can be done in a backwards-compatible fashion, and has no impact on what the array API standard says about __dlpack_c_exchange_api__. So while not completely optimal, no one objected to merging this PR in its current state.

Copy link
Member

@rgommers rgommers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @tqchen. LGTM now, and CI is happy. I've put a reminder in my calendar to merge this by the end of next week unless there are new unresolved comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants