[DLPack][TVM FFI] Rename C exchange API to __dlpack_c_exchange_api__#76828
Merged
SigureMo merged 2 commits intoPaddlePaddle:developfrom Dec 9, 2025
Conversation
|
你的PR提交成功,感谢你对开源项目的贡献! |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR renames the C DLPack exchange API from __c_dlpack_exchange_api__ to __dlpack_c_exchange_api__ to align with the TVM FFI 0.1.5 standard naming convention. The old name is maintained for backward compatibility with TVM FFI versions 0.1.0-0.1.4.
- Adds new standardized
__dlpack_c_exchange_api__attribute that always returns a PyCapsule - Updates TVM FFI dependency from version 0.1.4 to 0.1.5
- Maintains backward compatibility by keeping
__c_dlpack_exchange_api__with conditional logic for older TVM FFI versions
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| test/dygraph_to_static/test_tensor_attr_consistency.py | Adds __dlpack_c_exchange_api__ to the allowed tensor attributes list for consistency checks |
| python/unittest_py/requirements.txt | Updates apache-tvm-ffi dependency from 0.1.4 to 0.1.5 |
| python/paddle/base/dygraph/tensor_patch_methods.py | Implements new __dlpack_c_exchange_api__ attribute and adds clarifying comments about version compatibility |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
zrr1999
approved these changes
Dec 9, 2025
__dlpack_c_exchange_api____dlpack_c_exchange_api__
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.
PR Category
Execute Infrastructure
PR Types
New features
Description
For better compatibility, we expose APIs as below:
Tensor.__c_dlpack_exchange_api__: int | types.CapsuleType{(0.1.0), (0.1.1), (0.1.2), (0.1.3)}, returnsinttypes.CapsuleTypeTensor.__dlpack_c_exchange_api__: types.CapsuleTypeTODOs