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

Bytes type fails len when parallel #8286

Open
benwilliamgraham opened this issue Jul 26, 2022 · 1 comment
Open

Bytes type fails len when parallel #8286

benwilliamgraham opened this issue Jul 26, 2022 · 1 comment
Labels
bug - failure to compile Bugs: failed to compile valid code ParallelAccelerator

Comments

@benwilliamgraham
Copy link
Contributor

import numba

@numba.njit(parallel=True)
def f(x):
    return len(x)

print(f(b"abcd"))

Bytes type fails in array analysis when in parallel with the following error. It appears to do so because it inherits from ArrayCompatible. Here is the resulting error:

numba.core.errors.LoweringError: Failed in nopython mode pipeline (step: native lowering)
No definition for lowering readonly bytes(uint8, 1d, C).shape

File "test.py", line 6:
def f(x):
    return len(x)
    ^
During: lowering "x_shape.0 = getattr(value=x, attr=shape)" at /tmp/test.py (6)
@stuartarchibald
Copy link
Contributor

Thanks for the report. As discussed at the Numba meeting today, the comment here: #8285 (comment) covers the reasons and potential fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug - failure to compile Bugs: failed to compile valid code ParallelAccelerator
Projects
None yet
Development

No branches or pull requests

2 participants