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
Failed in nopython mode pipeline (step: nopython mode backend) #3932
Comments
Thanks for the report. Whilst there is no minimal working reproducer present I can guess from the lowering error that this is a case of trying to do this: from numba import njit
import numpy as np
@njit
def foo():
a = np.ones(1, np.bool_)
if a > 0:
print('truebr')
else:
print('falsebr')
foo() and the root cause is that |
Hi,
I'm sorry I forgot to add the minimum work. The function acted more like:
@njit(parallel=True, fastmath=True)
Def foo():
A = np.ones(1,10)
If(A[0,0]<0):
Print()
I write the statement like this because I was only passing one value of the array into the statement which is why I couldn't figure out the issue. No python mode has been very difficult to deal with especially in the case of machine learning which was my intended use. Great system but still having some issues on this if statement.
From: stuartarchibald
Sent: Wednesday 3 April, 09:52
Subject: Re: [numba/numba] Failed in nopython mode pipeline (step: nopython mode backend) (#3932)
To: numba/numba
Cc: Mainz, Adam, Author
Thanks for the report. Whilst there is no minimal working reproducer present I can guess from the lowering error that this is a case of trying to do this:
from numba import njit import numpy as np @njit def foo(): a = np.ones(1, np.bool_) if a > 0: print('truebr') else: print('falsebr') foo()
and the root cause is that a > 0 is not a predicate but rather a conditional. #3901<https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnumba%2Fnumba%2Fpull%2F3901&data=01%7C01%7Cadam.mainz%40kcl.ac.uk%7Cc65255550e654db2d27908d6b811bebf%7C8370cf1416f34c16b83c724071654356%7C0&sdata=vKm9B9DY5ICEyOpb%2BZeLD5IJ4w%2B%2FTzlLan4%2F%2Frjkt%2BA%3D&reserved=0> is WIP to fix.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnumba%2Fnumba%2Fissues%2F3932%23issuecomment-479400145&data=01%7C01%7Cadam.mainz%40kcl.ac.uk%7Cc65255550e654db2d27908d6b811bebf%7C8370cf1416f34c16b83c724071654356%7C0&sdata=sxM%2BpNZozX8rhM1fJXbBSE%2F5OPo3OaWK0V9iTFDFVQk%3D&reserved=0>, or mute the thread<https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAs_lFt4iKzUDhkzGjxk7Dibn_odawtLdks5vdGvdgaJpZM4cZNvb&data=01%7C01%7Cadam.mainz%40kcl.ac.uk%7Cc65255550e654db2d27908d6b811bebf%7C8370cf1416f34c16b83c724071654356%7C0&sdata=Y3wPu4owJic%2BRCqz4%2Bz7byT%2BRkoLzZtrY7MylTM3SS4%3D&reserved=0>.
|
Thanks for the update. If you could produce a sample that reproduces the error I'd be happy to take a look. The sample is invalid without Numba being involved as the import numpy as np
def foo():
A = np.ones(1, 10)
if(A[0,0]<0):
print()
foo() and if that is fixed then: from numba import njit
import numpy as np
@njit(parallel=True, fastmath=True)
def foo():
A = np.ones((1, 10))
if(A[0,0]<0):
print()
foo() compiles and executes fine. |
Closing this issue due to lack of information. If more information becomes available please add it and reopen the issue. Thanks. |
Cannot cast array(bool, 1d, C) to bool: %".1784" = load {i8*, i8*, i64, i64, i8*, [1 x i64], [1 x i64]}, {i8*, i8*, i64, i64, i8*, [1 x i64], [1 x i64]}* %"$222.6"
File "", line 31:
def stabilitySelect(lambdaNeed,x,y,numIter,mask):
[1] During: lowering "branch $222.6, 236, 305" at (31)
This should not have happened, a problem has occurred in Numba's internals.
Please report the error message and traceback, along with a minimal reproducer
at: https://github.com/numba/numba/issues/new
If more help is needed please feel free to speak to the Numba core developers
directly at: https://gitter.im/numba/numba
Thanks in advance for your help in improving Numba!
The text was updated successfully, but these errors were encountered: