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

numpy has teriminated the get_info method #691

Closed
ankarsingh309600 opened this issue Sep 21, 2023 · 4 comments
Closed

numpy has teriminated the get_info method #691

ankarsingh309600 opened this issue Sep 21, 2023 · 4 comments

Comments

@ankarsingh309600
Copy link

ankarsingh309600 commented Sep 21, 2023

In the latest versions of numpy>1.24.0, np.__config__.get_info method has been terminated, which is causing the follwoing error when running the ALS:

AttributeError: module 'numpy.__config__' has no attribute 'get_info'.
The functionality is used to detect OpenBLAS and Intel MKL BLAS.

Simple fix is to use the function get_info which numpy has deprecated.

def get_info(name):
    """Check given global attribute."""
    g = globals()
    return g.get(name, g.get(name + "_info", {}))
@nwittenberg
Copy link

Upvote. Facing same issue - now we have to manage numpy dependency explicitly. Would be great if this could be addressed.

@benfred
Copy link
Owner

benfred commented Sep 28, 2023

I think we should probably remove this block of code. We're trying to detect a potential performance problem (having BLAS configured to use a threadpool causes severe perf isues since we are also internally multi-threading which leads to thrashing- so we want to make sure that BLAS is configured to just use one thread, and we're using this method to try to figure out which BLAS library is being used by numpy).

Instead I think we should use https://github.com/joblib/threadpoolctl here - which both lets us get the threadpool status for the BLAS libraries, as well as programmatically set it. This means rather than just detecting the perf issue, we can configure BLAS appropriately to not have the issue in the first place.

@benfred
Copy link
Owner

benfred commented Sep 28, 2023

#692

@benfred
Copy link
Owner

benfred commented Sep 29, 2023

Fix is in the 0.7.2 release : https://github.com/benfred/implicit/releases/tag/v0.7.2

@benfred benfred closed this as completed Sep 29, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants