High cpu usage by kernel while using inv and solve from linalg
See original GitHub issueHi guys,
So i run into a big trouble while using linalg.solver or linalg.inv. All my 8 cpus are running at 100% where most part is due to the kernel.
First the program:
import numpy as np
import time
np.random.seed(0)
n = 56
A = np.asarray(np.random(n,n))
b = np.eye(A.shape[0])
while True:
c = np.linalg.solve(A, b)
time.sleep(1e-2)
Here is what shows htop:
I am running under ubuntu 16.04.1. Kernel version: 4.4.0-38-generic Python version: 2.7.12 Numpy version: 1.11.0
Testing it on ubuntu 14.04 with older version of python (2.7.6) and numpy (1.8) seems to work fine.
Any help would be appreciated 😃
Issue Analytics
- State:
- Created 7 years ago
- Reactions:4
- Comments:15 (8 by maintainers)
Top Results From Across the Web
High CPU usage kernel_task with 2 monitors - Apple Developer
Hello guys! Anyone out there with high CPU usage issues by kernel_task when you have two monitors connected by Thunderbolt? CPU usage at...
Read more >numpy.linalg.inv(M) much slower on one system than another
On my cluster compute server it takes about 10s for over a 1000x slowdown. Why? And how can I fix it? import numpy...
Read more >How to fix the kernel_task high CPU usage issue - Setapp
The kernel_task high CPU issue is well-known and documented by now, so we have the exact steps you need to take to stop...
Read more >Linear algebra (numpy.linalg) — NumPy v1.24 Manual
For example, numpy.linalg.solve can handle “stacked” arrays, while scipy.linalg.solve accepts only a single square array as its first argument.
Read more >Basic Linear Algebra Subprograms - Wikipedia
BLAS implementations have known a spectacular explosion in uses with the development of GPGPU, with cuBLAS and rocBLAS being prime examples. CPU-based ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
To expand a bit:
Hope that helps. Don’t think there’s anything else here for numpy to do right now, so closing, but feel free to re-open if I’m wrong.
you are using openblas, it is expected that that will use all cpu cores and is super wasteful on small matrices. You should be able to control it with the OPENBLAS_NUM_THREADS environment variable.