-
Couldn't load subscription status.
- Fork 1.6k
Introduced callback to Pthread, Win32 and OpenMP backend #4577
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
Introduced callback to Pthread, Win32 and OpenMP backend #4577
Conversation
|
Thanks. CI suggests the changes currently make Windows/MSYS builds prone to hanging in/after a fork() for some reason - at least that is what the apparently hanging "test_kernel_regress" in utest does. |
2bd9c44 to
a9d2b01
Compare
|
Sorry, I'm not sure I understand the latest update here, and which state of the respective files you are restoring with it - would you prefer to convert this to a draft for now ? |
|
Hi @martin-frbg, |
e5a39ff to
553031f
Compare
|
Ok, thanks, it was indeed a bit confusing to see seemingly unrelated blocks copied around without explanation, and then removed again in the same style. Unfortunately I hadn't gotten further than checking that the code still works on Linux/Unix when the new callback is not used, and that it compiles and works locally on Windows with gcc (but no explanation for the segfaults with clang) |
c1d8fbc to
6fcd2dc
Compare
6fcd2dc to
7102367
Compare
|
Hi @martin-frbg , |
|
these OSX jobs on Azure have been randomly timing out for a while - certainly unrelated to your PR. I still need to investigate if it is simply due to old hardware in the Azure cloud becoming too slow for dynamic_arch builds, or if some test started to hang on Nehalem |
@martin-frbg Thanks for the review. Are there any other comments for us to incorporate? |
|
No concerns, I've just been very busy lately, sorry. I hope to merge this tomorrow after trying out and documenting what integration with TBB would involve. |
|
fixes #4066 |
|
@shivammonaka is your OpenBLAS+TBB integration packaged somewhere? |
|
@ogrisel, this is a callback feature — the user can choose any threading backend to execute the OpenBLAS load. However, they must respect OpenBLAS’s internal threading constraints: each load requires a specific number of threads to complete execution. If not, the process can hang indefinitely due to two synchronization barriers within OpenBLAS’s matrix multiplication algorithm. |
Motivation: This pull request enables OpenBLAS threading to be composable with caller multithreading. It allows OpenBLAS threading to be composable with callers using Intel’s Thread Building Blocks (TBB), etc.
Brief description:
openblas_set_threads_callback_function(myfunction_);Kindly note: Extending this feature to Pthreads and Win32 threading backends required us to make additional changes, as outlined below: