-
Notifications
You must be signed in to change notification settings - Fork 49
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
stream in __dlpack__
should not be required to be integers
#183
Comments
I think this is reasonable. We can specify the object type allowed for each platform if
Is there a determined Python type for an in-order sycl queue? Another thing: are you happy (from the SYCL perspective) with the optional kw argument being named as "stream"? I don't remember what was your opinion (or if you were consulted when it's proposed) 😅 |
The Python type passed to In lieu of the SyclQueue, a "SyclQueueRef" capsule carrying a pointer to The name of the keyword does not align with SYCL (see page for Perhaps it would be a good idea to use a reasonably self-explanatory name for the keyword related to its intended use, e.g. |
This seems reasonable indeed, and consistent with the discussion in dmlc/dlpack#57 (comment). By the way @oleksandr-pavlyk, doesn't DLPack need SYCL added to |
@rgommers Yes, I intend to open a PR for dlpack requesting to add 3 new types |
I'm working on a doc update now. I'm not so sure about a Question on |
Otherwise, shouldn't it just be an opaque |
I do not insist on documenting |
Thanks for the explanation @oleksandr-pavlyk.
Then how about a type annotation |
Closes data-apisgh-183 The need to document the ownership of `stream` came up in pytorch/pytorch#57781.
Out of curiosity, what would the signature of a reasonable Perhaps I'm being too critical here, but this diversification with (potentially) highly library-specific parameter types sounds counterproductive to the standardization the Python array API standard is trying to achieve. |
@BvB93 This is why the standard should not unnecessarily restrict the type of the |
That's understandable. I'd just like to emphasize that, at the current rate, you're heading in a direction wherein no type safety can be guaranteed for the |
If I have a library supporting all these platforms (CUDA, HIP, SYCL, Metal, etc) then unfortunately this runtime check is a price I have to pay, since DLPack attempts to cover all these device types. |
I agree, not really a way around that. It's better than have separate methods like:
Because then you're back to "what do I do if my library supports multiple device types". |
Closes gh-183 (SYCL related, don't require an integer for `stream`) The need to document the ownership of `stream` came up in pytorch/pytorch#57781.
https://data-apis.org/array-api/latest/API_specification/array_object.html#dlpack-self-stream-none
says that
stream
keyword argument in__dlpack__(self, /, *, stream=None)
should be an integer or None.However, in dmlc/dlpack#57 discussion (see dmlc/dlpack#57 (comment)) in the case of working with SYCL, the
stream
may need to be a class representing an in-order sycl queue.Can we remove the requirements for
stream
to be an integer ?The text was updated successfully, but these errors were encountered: