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
{{ message }}
Repository navigation
dask.Bag slow and very large memory consumption with join #3252
First, have you considered using dask.dataframe? The join operations there will be much faster. It may be that your data doesn't fit nicely into dask.dataframe, but I thought I'd check.
Thank you so much @mrocklin . Yes I did try DataFrame and it is much better.
I've been introducing dask to my colleagues (the "industry case" you were mentioning in one of your talk), and I'm finding that almost all of the issues they're having are related to large object or large partials/closures (say, when you're trying to parallelize some pure-python workflow, written by non-scientists and you need to pass these objects around). So I thought I'd report these kind of issues anyway to help the project get adopted faster in the industry.
I was actually thinking that this kind of optimizations could be implemented as an optimizer pass. But let me know if you think this is a good idea.
given the dask graph:
recursively (up to a certain depth maybe) visit the "task tuples"
for each object measure its size
also keep a counter of how many time an object was encountered (keep track using the id function)
store the object in another node and replace the original argument with a key
Do you think this is a feasible approach? I'm afraid the recursive calculation of sizes may be really slow. If you think this make sense I can stub a PR.
Yes, I think that that would be a feasible approach. An optional optimization would be the right place to add that.
As you suggest, there might be costs associated with determining the size of objects. This cost might be reduced somewhat by only considering those objects that are included in the graph several times, and are not base types (ints, floats, strings, ...) (so swap steps 2 and 3?)
A PR exploring this topic would be welcome. I agree that this is a common issue that trips up new users.
Activity
mrocklin commentedon Mar 8, 2018
First, have you considered using dask.dataframe? The join operations there will be much faster. It may be that your data doesn't fit nicely into dask.dataframe, but I thought I'd check.
mrocklin commentedon Mar 8, 2018
See #3254 for a partial fix and the docstring especially for suggestions.
I recommend the following:
gabrielelanaro commentedon Mar 8, 2018
Thank you so much @mrocklin . Yes I did try DataFrame and it is much better.
I've been introducing dask to my colleagues (the "industry case" you were mentioning in one of your talk), and I'm finding that almost all of the issues they're having are related to large object or large partials/closures (say, when you're trying to parallelize some pure-python workflow, written by non-scientists and you need to pass these objects around). So I thought I'd report these kind of issues anyway to help the project get adopted faster in the industry.
I was actually thinking that this kind of optimizations could be implemented as an optimizer pass. But let me know if you think this is a good idea.
given the dask graph:
Do you think this is a feasible approach? I'm afraid the recursive calculation of sizes may be really slow. If you think this make sense I can stub a PR.
mrocklin commentedon Mar 8, 2018
Yes, I think that that would be a feasible approach. An optional optimization would be the right place to add that.
As you suggest, there might be costs associated with determining the size of objects. This cost might be reduced somewhat by only considering those objects that are included in the graph several times, and are not base types (ints, floats, strings, ...) (so swap steps 2 and 3?)
A PR exploring this topic would be welcome. I agree that this is a common issue that trips up new users.