-
Notifications
You must be signed in to change notification settings - Fork 30
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
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-subscription WDYT @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. |
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.
LGTM!
|
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.
I find the construction of the first sentence in the changelog entry a bit weird. See below:
Still |
CHANGES.md
Outdated
@@ -4,6 +4,13 @@ | |||
- 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- `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.