vyasr commented on issue #38325: URL: https://github.com/apache/arrow/issues/38325#issuecomment-2013069201
> Do we want to say something about expectations that no cross-device copies happen? My preference would be that at the outset the interface recommends that no implicit copies occur, but that there is no normative language prohibiting it. I agree with @paleolimbot that in a vacuum a copy would be surprising, but for objects that support data resident on either host or device (e.g. a pytorch array) it could be reasonable for this to happen. If a library already supports implicit back-and-forth copying via its public APIs then it should be acceptable for the same to happen via the capsule interface (in either direction, i.e. you could access the device interface and trigger H2D or vice versa), whereas if a library requires some explicit transfer mechanism (e.g. APIs like `pytorch.tensor.to(torch.device(...))`) then the library would probably require the same before accessing the associated capsule interface. > Perhaps we need to pass some options to __arrow_c_device_array__. I would recommend that we wait on this and see how the implementations look in practice. We could always add a `allow_copy=False` parameter with a default later without breaking implementers of the interface. To properly support libraries that implement both the device and host interfaces we would presumably need to add the same parameter to both since implicit H2D and D2H copies are equally undesirable. -- 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]
