Skip to content
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

Parallel prange fails on higher number of iterations and is slower #6859

Closed
step135 opened this issue Mar 24, 2021 · 6 comments
Closed

Parallel prange fails on higher number of iterations and is slower #6859

step135 opened this issue Mar 24, 2021 · 6 comments
Labels
bug - segfault Bugs that cause SIGSEGV, SIGABRT, SIGILL, SIGBUS duplicate

Comments

@step135
Copy link

step135 commented Mar 24, 2021

from numba import jit, prange
@jit(nopython=True, parallel=True)
def parorig(p):
    o=[]
    for item in prange(p):
        if item%2==0:o.append(2)
        else: o.append(1)
    return o

It is 10 times slower and unstable than if we remove parallel=True.
It works for small numbers, but calling parorig(10000) fails with "The kernel appears to have died. It will restart automatically.".

@esc esc added the needtriage label Mar 24, 2021
@farahhariri
Copy link

Thanks for reporting the issue @step135 ! I have tried it on my linux machine and I am able to trigger an error for a large input p. I am getting:

malloc(): unsorted double linked list corrupted
Aborted (core dumped)

However, when I remove the parallel=True everything goes smoothly even for larger inputs. What machine are you running on? and what versions of python and numba?

@step135
Copy link
Author

step135 commented Mar 24, 2021

It was tested in Jupyter notebook on Lenovo tablet with graphics card from Intel. Anyway, I suppose that GPU acceleration is not supported in numba for Intel? Alternatively, it could cause some problems.

@farahhariri
Copy link

So after some debugging, it seems like this is an issue due to Numba not having support for parallelism with lists. Basically as of now you can't use a list with prange.

Suggestion to numba devs: to mark this issue as a bug/feature request as you see fit and open an issue to update the docs indicating that prange is not supported with lists

@sklam sklam added bug - segfault Bugs that cause SIGSEGV, SIGABRT, SIGILL, SIGBUS duplicate labels Mar 25, 2021
@sklam
Copy link
Member

sklam commented Mar 25, 2021

marking this as a segfault and a duplicate of #2408

@sklam sklam removed the needtriage label Mar 25, 2021
@stuartarchibald
Copy link
Contributor

Docs update in #6918

@stuartarchibald
Copy link
Contributor

Closing as duplicate of #2408.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug - segfault Bugs that cause SIGSEGV, SIGABRT, SIGILL, SIGBUS duplicate
Projects
None yet
Development

No branches or pull requests

5 participants