-
Notifications
You must be signed in to change notification settings - Fork 46
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
Support for DLPack exchange of hot buffers #829
Comments
Sorry for late reply @oleksandr-pavlyk. Thinking about this more I am not sure it makes sense to add a |
No, I am not advocating for adding I am pointing out though that Array API standard currently leaves those who need to use I was saying that adding |
I think the problem is now clearer to me (thanks @oleksandr-pavlyk and @leofang). The basic problem for the SYCL-based The device enum was supposed to have mutually exclusive values: data lives either on CPU, or on CUDA, or on ROCm, etc. - but never on two device types at once. Hence I think having A potential way to handle this would be to return two device values ("this is a SYCL OneAPI array backed by a CUDA device"), and then let the consumer ask for either OneAPI or CUDA (e.g., CuPy would ask for CUDA, while a user of I think the |
Indeed. Here's the way I understand it, using
|
Based on discussion in dmlc/dlpack#57,
array.__dlpack__
method supportsstream
keyword, implementing @tqchen's suggestion for synchronization semantics.The
from_dlpack
command in array API does not support it at present though, requiring users to explicitly synchronize at the exporter's side.The
from_dlpack
function has acquireddevice
keyword (see #626) to permit porting device data to host, e.g.from_dlpack(gpu_arr, device=(kDLCPU, 0))
and, potentially, to allow exchanges between different APIs targeting the same device (e.g., betweenkDLOneAPI
andkDLCUDA
for oneAPI devices targeting NVidia GPUs) down the road.It is tempting to want to add support for
stream
keyword tofrom_dlpack
, but this keyword value must make sense for importing library, whilestream
value passed to__dlpack__
must make sense for exporting library. So it seems thatfrom_dlpack
should only allow specifying non-default valuestream
keyword when it can make sense for both. Maybe when device type of requested device is the same as the type indicated inarr.__dlpack_device__
.@kkraus14 @fcharras @leofang @ogrisel
The text was updated successfully, but these errors were encountered: