-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Add :greedy
scheduler to @threads
#52096
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Some initial benchmarks: https://github.com/carstenbauer/parallel-julia-zoo/tree/greedy/multithreading In particular, see the
The worst result is probably found in the
|
To reference the conversation on slack, that benchmark was run with N = 10_000 and 8 threads, so 80_000 elements in the input array or about 64 KiB of data. With 800 chunks, that's a miniscule amount of data per chunk, increasing the overhead dramatically. I'll keep that in mind for the docs of In general, I don't expect |
A bit of an aside, but could we actually make |
I was thinking about that too while implementing this, but that's likely something better suited for another PR later. I thought about this in particular because I originally wanted to just have this implementation be a replacement for
Emphasis mine. The problem with this is that we can't then swap the underlying implementation to be greedily work stealing (or otherwise loadbalancing on a per-item basis), since that would result in the regions/items worked on no longer being contiguous for any given task. In essence, this makes |
Does this need anything else? |
CI failures seem unrelated. Does this need anything else? |
No idea what the SparseArrays build/test failures mean. This shouldn't touch them at all. Is this just master being flaky master again? Other than that, @vtjnash if you agree I think this is good to go. |
What's the status here? |
Thank you! |
This implements a very greedy scheduler for
@threads
, spawning up tothreadpoolsize()
tasks that greedily work on the elements from the iterator as they are produced. This scheduler supports infinite iterators.Needs