Numba workqueue threading error
See original GitHub issueThanks for the great library!
I’m getting the following error:
Terminating: Nested parallel kernel launch detected, the workqueue threading layer does not supported nested parallelism. Try the TBB threading layer.
The context is that I’m calling the umap library from flask and two clients are hitting a umap call at the same time. I’m guessing this is what is causing nested threading – flask is already using some kind of threading, and umap seems to be doing the same under the hood. I think this is related to numba threading, but I’m setting a random seed so as per the docs I don’t think this should be an issue.
Is there a proposed/preferred solution to this issue?
Issue Analytics
- State:
- Created 2 years ago
- Comments:9 (3 by maintainers)
Top Results From Across the Web
The Threading Layers — Numba 0.50.1 documentation
In practice, the only threading layer guaranteed to be present is workqueue . The omp layer requires the presence of a suitable OpenMP...
Read more >Nested parallel kernel launch detected, the workqueue ...
I understand that the error says to Try the TBB threading layer but these tests were passing previously without TBB on MacOS and...
Read more >numba/numba - Gitter
I think this is a bug. Seems to only fail in the workqueue threading layer though, so perhaps try installing tbb ( conda...
Read more >TypeError: No matching version. GPU ufunc requires array ...
error: TypeError: No matching version. ... I am just started looking into numba's GPU capabilities. ... Workqueue Threading layer available : True. __Numba ......
Read more >Performance Comparison of Python Translators for a Multi ...
for a Multi-threaded CPU-bound Application ... comes to parallelizing algorithms; while Numba and Cython achieved sig-.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
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
And, in the end my problem was incorrect wsgi configuration… what a treasure hunt! It works now, thanks for all the support!
The most common cause of this issue is nesting parallel kernels, here’s an example:
The
workqueue
threading layer does not support nested kernels, whereas OpenMP and TBB do. The message you are seeing is coming from theworkqueue
threading layer as it’s detected that the code does something it doesn’t support and is “protecting” itself from inevitable corruption that would occur were it to attempt to run it.My first question is… do you have something like the case above or do you have a parallel kernel being called from two python threads? I think the effect would manifest in the same error message as the
workqueue
backend isn’t threadsafe and it would “see” parallel region launches from two python threads as a kind of nest.