Skip to content

[DLPACK] Support the new python array api with DLPack - #7993

Merged
junrushao merged 2 commits into
apache:mainfrom
YuchenJin:support-new-dlpack-array-api
May 7, 2021
Merged

[DLPACK] Support the new python array api with DLPack#7993
junrushao merged 2 commits into
apache:mainfrom
YuchenJin:support-new-dlpack-array-api

Conversation

@YuchenJin

Copy link
Copy Markdown
Contributor

Adopt the new Python array API standard with DLPack:

  • Add __dlpack__(self, stream=None) and __dlpack_device__(self) methods on tvm.nd.NDArray. Note that tvm operates on the legacy default stream by default, so no explicit synchronization is needed.
  • tvm.nd.from_dlpack can take a tensor-like object with __dlpack__ method, or a DLPack capsule.

More contexts:

@YuchenJin

Copy link
Copy Markdown
Contributor Author

cc @tqchen @junrushao1994

@junrushao junrushao left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks Yuchen for the contribution! Overall it looks good to me. Please fix the lint issues

@YuchenJin

YuchenJin commented May 6, 2021

Copy link
Copy Markdown
Contributor Author

Thanks, @junrushao1994! :)

@YuchenJin YuchenJin closed this May 6, 2021
@YuchenJin YuchenJin reopened this May 6, 2021
@junrushao
junrushao merged commit 8d9a1df into apache:main May 7, 2021
@junrushao

Copy link
Copy Markdown
Member

Thanks @YuchenJin! It is now merged!

@YuchenJin
YuchenJin deleted the support-new-dlpack-array-api branch May 7, 2021 22:27
mehrdadh pushed a commit to mehrdadh/tvm that referenced this pull request May 19, 2021
* [DLPACK] Support the new python array api with dlpack

* Fix lint
trevor-m pushed a commit to trevor-m/tvm that referenced this pull request Jun 17, 2021
* [DLPACK] Support the new python array api with dlpack

* Fix lint
trevor-m pushed a commit to neo-ai/tvm that referenced this pull request Jun 17, 2021
* [DLPACK] Support the new python array api with dlpack

* Fix lint
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