EnzymeAD / Reactant.jl

MIT License
26 stars 2 forks source link

What is a device to the RArray? #16

Open avik-pal opened 1 month ago

avik-pal commented 1 month ago

alternatively construct RArrays with a device

I don't see a device argument to ConcreteRArray. Is this currently not implemented?

Also, can we directly pass a Ptr to the data for ConcreteRArray, for example, if we have a CuArray input to a Lux model, I want to wrap it as a ConcreteRArray without paying the cost to copy it.

avik-pal commented 1 month ago

I see that there is a client kwarg. Maybe we can support constructing it via KernelAbstractions backend?

But more importantly, we should document how to pass in the client

wsmoses commented 1 month ago

alternatively construct RArrays with a device

I don't see a device argument to ConcreteRArray. Is this currently not implemented?

Also, can we directly pass a Ptr to the data for ConcreteRArray, for example, if we have a CuArray input to a Lux model, I want to wrap it as a ConcreteRArray without paying the cost to copy it.

Reactant/XLA needs to fully own its memory so the latter won’t be possible (or at least easy)