-
Notifications
You must be signed in to change notification settings - Fork 53
Add Python API, semantics and implementation details for DLPack #106
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
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
30276e6
Update data interchange section with Python API and semantics
rgommers 79bb689
temporary commit to enable MyST feature
rgommers 4e2c49d
Add DLPack synchronization semantics; add from_dlpack/__dlpack__ to API
rgommers 0b701c4
Update stream numbering for `__dlpack__`
rgommers a4549af
Add __dlpack__ device and update description of stream=None
rgommers a719b18
Add more device-specific notes for CUDA/ROCm stream handling
rgommers 693b15a
Fix issue where producer/consumer were reversed
rgommers 897ca2e
Improve the description of the stream keyword for `__dlpack__`
rgommers d3b9a79
Update __dlpack_device__ to use IntEnum for device type
rgommers 75261cc
Add -1 as a sentinel value for DLPack stream handling
rgommers 5cde9aa
Add supported DLPack version range.
rgommers 603ad2e
Add details on strides null and size 0 arrays.
rgommers File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps it would be useful to remove 1 and 2, because they are CUDA specific for now(ROCm does not support 1 and 2.
Just say stream number represented as a python integer(per platform convention) would work
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we still need to say that 0 is explicitly disallowed for CUDA since it's ambiguous though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree, it would be great to point out that that fact. thanks @kkraus14
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe rather than remove things, add something? E.g. make the description:
Stream number, as Python integer, for all device types that supports streams.
Per-device notes:
CUDA: 1, 2, 3...
ROCm: 3....
and then refer to the DLPack docs (to be written/extended) for more details?
Specs that are too terse are correct, but not all that useful. Given how complex it was to make this converge, I feel like we need to give implementers as much guidance as possible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks @rgommers a per device guidance sounds good. i think it is safe to start with CUDA and ROCm and then expand later
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kkraus14 This is what I kept saying above 🙂
@rgommers For ROCm, I think it's ok to keep 0, since this is the only way to use the legacy default stream (if so desired).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.