Skip to content

Conversation

@SigureMo
Copy link
Member

@SigureMo SigureMo commented Dec 9, 2025

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
    • When tvm ffi is available and its version in {(0.1.0), (0.1.1), (0.1.2), (0.1.3)}, returns int
    • Otherwise, returns types.CapsuleType
  • Tensor.__dlpack_c_exchange_api__: types.CapsuleType

TODOs

Copilot AI review requested due to automatic review settings December 9, 2025 02:28
@paddle-bot
Copy link

paddle-bot bot commented Dec 9, 2025

你的PR提交成功,感谢你对开源项目的贡献!
请关注后续CI自动化测试结果,详情请参考Paddle-CI手册
Your PR has been submitted. Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.

@SigureMo SigureMo changed the title [DLPack][TVM FFI] Rename C exchange API name to __dlpack_c_exchange_api__ [DLPack][TVM FFI] Rename C exchange API to __dlpack_c_exchange_api__ Dec 9, 2025
@SigureMo SigureMo merged commit 64d3bbe into PaddlePaddle:develop Dec 9, 2025
93 of 100 checks passed
@SigureMo SigureMo deleted the dlpack/rename-c-exchange-api-name-to-dlpack-c-exchange-api branch December 9, 2025 08:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants