Don't sample dict result of a shuffle group when calculating its size#7834
Merged
Don't sample dict result of a shuffle group when calculating its size#7834
Conversation
Member
|
cc @madsbk |
The size calculation for shuffle group results is very sensitive to sampling since there may be empty splits skewing the result. See also dask/distributed#4962
f836cef to
b2e5a3f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The size calculation for shuffle group results is very sensitive to sampling since there may
be empty splits skewing the result.
See also dask/distributed#4962
I decided to go for this weird sentinel to not have to import
dask.dataframe.backendsindask.sizeofbut rather the opposite. Open to other suggestions.Regarding the implementation, there is also the possibility to have some pseudo sampling which ensures that we have at least X% of the rows in our sum. I figured this is not necessary since iterating over the splits should be sufficiently fast. In my micro benchmarks it was still about a factor of 2 slower than the ordinary
sizeofbut still around 1ms for a DF with 1M rows (incl a str col)black dask/flake8 dask/isort dask