You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This looks like a great way to share data across processes for dask.array (and dask.dataframe, possibly). Array.persist() should possibly use this by default if the scheduler is using multiple processes (either via the multi-processing scheduler or distributed).
Reacted by Dave Hirschfeld, Thomas Moerman, Gary Feng and Kyle Barron
How generic does Plasma go? If the answer isn't "entirely generic" then this might have to be attached to a collection rather than the scheduler itself. Something like array = array.cache_in_plasma(). Was this what you were thinking @shoyer ?
It seems like plasma may just be designed for single-node parallelism? In that case a distributedcache_in_plasma function may have to take care to push to a plasma cache on each node.
How generic does Plasma go? If the answer isn't "entirely generic" then this might have to be attached to a collection rather than the scheduler itself. Something like array = array.cache_in_plasma(). Was this what you were thinking @shoyer ?
It looks like plasma provides a way to share data in the form of Python memoryview objects. It can't work for arbitrary Python objects, for which there is no equivalent to memoryview.
So by necessity it does appear it would be limited to particular collections. It would work well for dask array, but perhaps not for dask dataframe (string columns are stored with dtype=object, and custom dtypes would require special work).
I can imagine a modification of the dask.multiprocessing scheduler that put numpy intermediates into Plasma, or some other posix-shared memory store and sent everything else back as normal. Joblib may also provide enough infrastructure here for using posix shared memory if we want to rely on something slightly more stable.
Having a scheduler that automatically uses shared-memory if possible, drops to direct network communication and finally spilling to disk would be a dream!
There's already a discussion about using UNIX domain sockets, which would add shared memory ( dask/distributed#3630 ). Seems better to do that before worrying about adding more dependencies.
That said, do you actually have a use case for this? If so, do you mind sharing that in a new issue?
Activity
mrocklin commentedon Aug 9, 2017
How generic does Plasma go? If the answer isn't "entirely generic" then this might have to be attached to a collection rather than the scheduler itself. Something like
array = array.cache_in_plasma(). Was this what you were thinking @shoyer ?dhirschfeld commentedon Aug 9, 2017
It seems like plasma may just be designed for single-node parallelism? In that case a
distributedcache_in_plasmafunction may have to take care to push to a plasma cache on each node.shoyer commentedon Aug 9, 2017
It looks like plasma provides a way to share data in the form of Python
memoryviewobjects. It can't work for arbitrary Python objects, for which there is no equivalent to memoryview.So by necessity it does appear it would be limited to particular collections. It would work well for dask array, but perhaps not for dask dataframe (string columns are stored with
dtype=object, and custom dtypes would require special work).mrocklin commentedon Aug 9, 2017
I can imagine a modification of the dask.multiprocessing scheduler that put numpy intermediates into Plasma, or some other posix-shared memory store and sent everything else back as normal. Joblib may also provide enough infrastructure here for using posix shared memory if we want to rely on something slightly more stable.
mrocklin commentedon Oct 23, 2018
This seems to have gone stale. Closing. If folks want to discuss this further then please reopen.
Hoeze commentedon May 28, 2020
Maybe this would be a good time point to re-open the discussion here?
Plasma and the Arrow ecosystem has grown a lot in its possibilities, e.g. sparse tensors and data frames:
https://arrow.apache.org/docs/python/plasma.html
Having a scheduler that automatically uses shared-memory if possible, drops to direct network communication and finally spilling to disk would be a dream!
jakirkham commentedon May 28, 2020
There's already a discussion about using UNIX domain sockets, which would add shared memory ( dask/distributed#3630 ). Seems better to do that before worrying about adding more dependencies.
That said, do you actually have a use case for this? If so, do you mind sharing that in a new issue?
Hoeze commentedon May 30, 2020
Thanks for your answer @jakirkham.
I opened an issue at dask/distributed#3630
jakirkham commentedon May 31, 2020
xref: #6267