Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

use threadpoolctl for detecting BLAS threadpools #692

Merged
merged 1 commit into from
Sep 29, 2023
Merged

Conversation

benfred
Copy link
Owner

@benfred benfred commented Sep 28, 2023

We were using numpy.config.get_info to figure out what BLAS library was being used, in an effort to warn people if they hadn't disabled the internal threadpool for the BLAS they were using. This method is removed in numpy 1.26, causing errors.

Fix by using the threadpoolctl library to detect both the BLAS library and the number of threads its configured for.

While we could automatically configure the BLAS library to reduce the threadpool size to 1, this is process wide - and would have side effects for our users. Instead just warn here, and give instructions for people on how to configure themselves.

We were using numpy.__config__.get_info to figure out what BLAS library was being used,
in an effort to warn people if they hadn't disabled the internal threadpool for the
BLAS they were using. This method is removed in numpy 1.26, causing errors.

Fix by using the threadpoolctl library to detect both the BLAS library and the number
of threads its configured for.

While we could automatically configure the BLAS library to reduce the threadpool size
to 1, this is process wide - and would have side effects for our users. Instead just
warn here, and give instructions for people on how to configure themselves.
@benfred benfred merged commit 8ca25bd into main Sep 29, 2023
@benfred benfred deleted the threadpoolctl branch September 29, 2023 00:33
NiallBrickell pushed a commit to NiallBrickell/implicit that referenced this pull request Feb 6, 2024
We were using numpy.__config__.get_info to figure out what BLAS library was being used,
in an effort to warn people if they hadn't disabled the internal threadpool for the
BLAS they were using. This method is removed in numpy 1.26, causing errors.

Fix by using the threadpoolctl library to detect both the BLAS library and the number
of threads its configured for.

While we could automatically configure the BLAS library to reduce the threadpool size
to 1, this is process wide - and would have side effects for our users. Instead just
warn here, and give instructions for people on how to configure themselves.
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant