-
Notifications
You must be signed in to change notification settings - Fork 30
Feature/dlpack #682
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Feature/dlpack #682
Conversation
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
This PR is dependent on the merge of #646 , since some test use |
View rendered docs @ https://intelpython.github.io/dpctl/pulls/682/index.html |
d4c16ce
to
fb968c1
Compare
Added dlpack's license file in include/dlpack/ Added note in README.md about the location of the origin LICENSE file from which the copy was made Add _dlpack.pyx to flake exception file Implemented to_dlpack_capsule/from_dlpack_capsule functions
1. The pycapsule destructor only calls DLManagedTensor.deleter is the name is "dltensor" 2. Code consuming the DLPack capsule renamed the capsule (to avoid destructor calling the deleter) and instead creates an internal object to do that and uses that internal object as the base of _Memory object `from_dlpack_capsule` function should handle NULL data field For zero-elements arrays in DLPack, allocate 1 element Proper support for strides added. Expanded docstring of `dpctl.tensor.from_dlpack`
Test should anticipate that dlpack roundtripping changes bool dtype to uint8 Adding test for `from_dlpack` input validation
fb968c1
to
ea71e66
Compare
diptorupd
reviewed
Nov 24, 2021
diptorupd
reviewed
Nov 24, 2021
diptorupd
reviewed
Nov 24, 2021
diptorupd
reviewed
Nov 24, 2021
1. Added docstrings 2. Exported DLPackCreationError in `_dlpack.pxd` 3. Added validation in `__dlpack_device__` to raise an error if device_id came back -1 (not-found) 4. `to_dlpack_capsule(usm_ary)` raises DLPackCreationError if the array context is not the default context (the one created in dpctl.SyclQueue(dev) call)
diptorupd
reviewed
Nov 30, 2021
diptorupd
reviewed
Nov 30, 2021
diptorupd
reviewed
Nov 30, 2021
diptorupd
reviewed
Nov 30, 2021
diptorupd
reviewed
Nov 30, 2021
diptorupd
reviewed
Nov 30, 2021
diptorupd
reviewed
Nov 30, 2021
diptorupd
reviewed
Nov 30, 2021
diptorupd
reviewed
Nov 30, 2021
diptorupd
reviewed
Nov 30, 2021
Internal CI failure are unrelated to the functionality proposed in this PR. |
Deleted rendered PR docs from intelpython.github.com/dpctl, latest should be updated shortly. 🤞 |
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.
This PR is split from #646, and contains added support of
dpctl.tensor.usm_ndarray
of__dlpack__
protocol.It implements
usm_ndarray.__dlpack__
andusm_ndarray.__dlpack_device__
methods. It also implementsfunction to convert an
array
Python object that supports__dlpack__
protocol intousm_ndarray
instance without a copy (or raise an error).