-
-
Notifications
You must be signed in to change notification settings - Fork 9.9k
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
Excessive cpu usage for np.unique #12374
Comments
I don't see that here in master or 14.6, python 3.7.1. What is your setup? Maybe Anaconda? |
I am using conda 4.5.11, python 3.6.6, numpy 1.15.3 |
Steps to create the conda environment: conda create -n numpy-env python=3.6
conda activate numpy-env
conda install numpy |
I don't see anything in the function that should cause problems unless conda has done something about the sorting. What happens if you pip install numpy? |
It looks like this only happens when installing via conda. The following does not cause problems: conda create -n numpy-env python=3.6
conda activate numpy-env
pip install numpy |
@jimmyyhwu out of curiosity, can you try if the issue goes away with |
Yes, for the numpy installed via conda, setting |
So I guess it is some MKL hook, but I am not sure what parts Intel/Anaconda monkeypatches inside numpy, I know there is monkeypatching for FFT and of course linear algebra is always external (and tends to be parallel). But both are not used here. @oleksandr-pavlyk do you maybe happen to know where we can see quickly what parts of numpy can be monkeypatched here? Also, in case gh-11826 moves forward it might be good to keep an eye on. |
Probably Try setting Doing so reduces CPU usage to about 110% for me. |
@oleksandr-pavlyk good to know. What is the issue tracker for the project? I know |
There is no dedicated issue tracker at the moment, and it's a good idea to create one. Changes to If you have Intel's numpy installed in conda environment, they can be accessed in |
Is there a public repo for those patches? It seems some of them are not mkl specific and could be merged to numpy, but I could not find licensing info in the diffs |
Is the CPU usage still an issue? |
Yes, I just tried the above with numpy 1.15.4 and the problem still persists. |
The similar problem with the follwoing setup: Win10 x64, conda=4.6.7, python=3.6
I tried different numpy versions by
On two intel machine (i7-6700k) CPU usage increases from 15% to 52%, time of copying reduces from 600 µs to 530 µs. So 3.5 times more CPU results in only 1.13 speed up. |
I faced this issue when I use |
@jjhelmus Could you please pay attention to this issue? Thank you. |
Rather than tagging an individual maintainer of Anaconda or Intel, it may be useful to open an issue on the correct tracker: https://github.com/ContinuumIO/anaconda-issues/issues. @njzjz it would be very helpful if you could do this and let us know so we can close this issue. |
For the record:
|
Closing the issue here, interested parties should follow the discussion on the open anaconda issue. |
Calling np.unique seems to result in > 100% cpu usage (no multiprocessing).
Reproducing code example:
Error message:
htop shows ~3600% CPU usage.
Numpy/Python version information:
1.15.3 3.6.6 |Anaconda, Inc.| (default, Oct 9 2018, 12:34:16)
[GCC 7.3.0]
The text was updated successfully, but these errors were encountered: