kkraus14 commented on issue #38325:
URL: https://github.com/apache/arrow/issues/38325#issuecomment-1981240323

   > * My understanding is that in the Python API for the dunder methods, we 
don't need to expose anything to deal with the `sync_event`, as that is 
entirely handled by the consumer through the struct itself (so in contrast with 
the DLPack [`__dlpack__` 
method](https://data-apis.org/array-api/2022.12/API_specification/generated/array_api.array.__dlpack__.html)
 which does have a `stream` keyword. But they way how the even works, this is 
not needed). This is correct?
   
   Yes, this is correct.
   
   > * Do we want to add an `__arrow_c_device__` method that returns the device 
of the array or stream?
   >   This would be similar as the [`__dlpack_device__` from 
DLPack](https://data-apis.org/array-api/2022.12/API_specification/generated/array_api.array.__dlpack_device__.html),
 and I suppose essentially just an easier way to quickly check the device of 
the object.
   >   For DLPack, one reason to have this is to check the device before you 
can pass the correct stream to `__dlpack__` (according to 
https://dmlc.github.io/dlpack/latest/python_spec.html#syntax-for-data-interchange-with-dlpack),
 and that's of course not a relevant reason for us (based on the previous 
bullet point)
   
   This can always be added later if there proves to be a need for it. I would 
push to keep things minimal for now to avoid needing to make breaking changes.
   
   > * Similarly as with the PyCapsule protocol we already added, I would for 
now not specify anything about how the consumer side should look like (in 
contrast to DLPack which has a 
[`from_dlpack`](https://data-apis.org/array-api/2022.12/API_specification/generated/array_api.from_dlpack.html)
 specified through the Array API). That also means it is up to the consumer 
library how to deal with device copies etc (although I assume typically a copy 
will be avoided unless explicitly asked?)
   >   EDIT: I see that the Array API standard recently added `copy` and 
`device` keywords to `from_dlpack` to be more explicit or ask to copy to a 
different device ([Support `copy` and `device` keywords in `from_dlpack` 
data-apis/array-api#741](https://github.com/data-apis/array-api/pull/741))
   
   +1 to not defining `from_*` methods yet. I suspect we'll eventually want 
something similar with `copy` and `device` keywords to pass to the producer, 
but I think we can wait for feedback before building things out on that front.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to