-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
remove threadedregion and move jl_threading_run to julia
#32477
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
c452cbc to
ca7aa31
Compare
|
Wow, this is great! Using the benchmarks from #32181, we get: Versus: Not only did you significantly shrink the overhead amount, you sped up the multithreaded case! |
|
The testing failures were all timeouts so I've restarted them to try and get a feel for how reliable those timeouts are. I've found some threading lock-ups in my explorations as well, opened an issue here: #32511 |
base/threadingconstructs.jl
Outdated
| ccall(:jl_threading_run, Cvoid, (Any,), threadsfor_fun) | ||
| in_threaded_loop[] = false | ||
| end | ||
| threading_run(threadsfor_fun) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because we are never invoking threadsfor_fun with an argument, should the onethread argument be removed?
One possible cause for that is that this additionally deletes the IO-capable scheduler and always instead uses the multi-threading-optimized scheduler. We currently may have a small lag when switching, while this just instead adds a large lag (latency) for any actual IO work. |
Right; part of the goal of this PR was to motivate a benchmark for that and then try to address it. So, do your worst! :) |
ca7aa31 to
4ea0211
Compare
|
Wait, we are still polling |
4ea0211 to
db14903
Compare
threadedregion and move jl_threading_run to juliathreadedregion and move jl_threading_run to julia
db14903 to
5100430
Compare
5100430 to
55ab710
Compare
f5cf4be to
d76ac5d
Compare
|
Earlier, I saw some code to the user, for applications that require more direct control over what's run on which thread? |
|
A possible application for such a |
|
Yes, that's possible to add. My thinking was just that it's not a good default for |
Oh sure - I was really thinking about specialized use cases. Certainly not something the average user will require, but HPC applications may sometimes need it, e.g. for benchmarking and performance analysis, etc. For such cases, I think it would be helpful to have an "offical" API, like |
d76ac5d to
0f3bf61
Compare
0f3bf61 to
31eeec3
Compare
|
I'd really love to see this merged — or otherwise make the "default/easy/obvious"
|
|
Is the appealing part the dynamic schedule? We could get that in a less invasive way just by flipping the sticky bit within the current implementation. |
|
The main thing is that I want to be able to throw |
|
There won't be any oversubscription either way (except via a native library), but I assume the real problem is the schedule --- we don't want |
|
Right, of course, I wasn't thinking straight. Yes, the scheduling won't be as ideal, but I also have it in my head that nested |
|
Should not be crashy. |
|
@JeffBezanson. Just wanted to clarify. I used to be of the opinion that nesting |
|
Correct, |
|
Are there any plans when this will be merged? It would be really nice to get the speed-up when using |
|
This was moved to Julia (and so the PR is conflicted) |
Putting this up to see if we can find any adversarial test cases.
Resolves #32970