Repository navigation
Workaround for openblas + openmp threading layer - #114
Conversation
|
Indeed, |
|
I think we need a dedicated API to protect about the
This should be a new context manager, both for the functional and the pre-loaded object oriented API. WDYT @jeremiedbb? |
|
So at first I tried this new context manager idea but I was very unsatisfied with it. I think I came up with a more satisfying solution. When we set the limit to blas only, we check if the internal state of openmp has changed and if so we set it back to the original state (this does not modify the state of the blas, I checked). I thinks it's better to just have this kind of workaround for a behavior that is unexpected at least and should even be considered a bug imo, than adding a new whole public object just to handle that. What do you think ? |
|
Hum, actually setting back openmp to its original state is bad when we don't want to set the limits for the nested openmp openblas case... It will run as if no limit was set even if |
|
Ok so I think I came up with an acceptable alternative: a new helper function that gives the appropriate params to pass to |
|
Nice! Maybe this could also be somehow exposed in the with threadpoolctl.threadpool_limits(limits="sequential_blas_under_openmp"):
# code protected against over-subscriptionWDYT @jeremiedbb? If you agree, please update the README to document that high level policy. |
I like this Idea. Actually I think it should be the only public way to do that and I would make the helper private. Ok for you ? |
|
I agree. Let's make the getter private. The changelog will need to be updated accordingly to only mention the new limit option. |
|
|
ogrisel
left a comment
There was a problem hiding this comment.
I find the construction of the first sentence in the changelog entry a bit weird. See below:
|
Still |
| - Fixed a detection issue of the BLAS libraires packaged by conda-forge on Windows. | ||
| https://github.com/joblib/threadpoolctl/pull/112 | ||
|
|
||
| - `threadpool_info` and `ThreadpoolController.limit` now accept the string |
There was a problem hiding this comment.
| - `threadpool_info` and `ThreadpoolController.limit` now accept the string | |
| - `threadpool_limit` and `ThreadpoolController.limit` now accept the string |
I can't think of a better time to do this. But unfortunately I don't have time and I'm still not crazy enough to make a half release a friday evening and finish it during the week-end :D |
|
Ok all green. Let's merge |
No description provided.