Open mohammed5920 opened 1 month ago
I meet the same question, cpu busy with this.
I solve this question by use version: 0.57.0
issue goes away when specifically setting numba.config.THREADING_LAYER = "workqueue"
The script is measuring compile-time, and dispatch overhead. Numba is best used with a function with a lot of compute work for optimal trade off between overhead and runtime.
What is the other platform beside Linux that the code is measured on. The observed difference can also be an artifact of different granularity of the profiling/monitoring tool.
Regarding thread staying alive, that is the effect for certain threading backend (e.g. OpenMP or TBB) maintaining a threadpool.
Reporting a bug
i'm writing a program that draws video to the screen that the user can interact with, the core draw loop of the program uses numba to accelerate the iteration over all of the pixels - however, numba seems to waste cpu for no reason after the function is already done
code example:
the simple act of copying bytes from one array to the other takes 1.6ms on my ryzen 5600, which means over 90% of the loop is spent sleeping not doing any work. however, cpu usage will still be at 100% leading to high temperatures for seemingly no reason.
i think maybe it's spawning some threads that stay alive in some sort of busy loop even after the function returns? i'm honestly not quite sure - but this exact same code does not reproduce the same wasteful CPU usage on Linux, so i'm convinced it's not intended behaviour