Dagger.jl icon indicating copy to clipboard operation
Dagger.jl copied to clipboard

Wrap inputs in Chunk only once, or not at all

Open jpsamaroo opened this issue 4 years ago • 1 comments

In #199 I've fixed a "bug" where non-thunk inputs are serialized during the thunk RPC call, which is silly for large inputs. That fix assumes that inputs are large enough to wrap in a Chunk, which is not always true. It also re-wraps inputs in Chunks multiple times, which can incur extra overhead. We should make a dynamic decision whether to wrap in a Chunk, and if we wrap, wrap just once.

jpsamaroo avatar Jan 28 '21 20:01 jpsamaroo

Changing my mind about this after getting multi-GPU with DaggerGPU to work properly: we should always wrap inputs in a Chunk, potentially with the option to opt-out, because we don't know if the value can be serialized.

jpsamaroo avatar Mar 01 '21 20:03 jpsamaroo