Hello,
I’ve been struggling with this all day and I can’t seem to figure out my issue.
Basic test code
import scipy
import numpy as np
import numba
from numba import njit
print("Numba version: ",numba.__version__)
print("Numpy version: ",np.__version__)
print("Scipy version: ",scipy.__version__)
@njit
def test(x):
out = np.linalg.inv(x)
return out
x = np.eye(10, dtype='complex')
print(test(x))
Notes
I was able to open a remote server and have this run via the website (https://numba.pydata.org/), so I think it is something on my side. Additionally, this error pops up for almost any function from numpy.linalg, but not for numpy in general. I have updated all the libraries I can via pip, but it has me stuck on an old numba version. I do not think the older numba version should be the issue, since np.linalg.solve has been implemented since 0.27.0
Code output
Numba version: 0.51.2
Numpy version: 1.20.0
Scipy version: 1.6.0
Traceback (most recent call last):
File “/home/gregs/git_files/Resolvent_Python/Resolvent_Analysis/testing.py”, line 16, in
print(test(x))
File “/home/gregs/.local/lib/python3.9/site-packages/numba/core/dispatcher.py”, line 415, in _compile_for_args
error_rewrite(e, ‘typing’)
File “/home/gregs/.local/lib/python3.9/site-packages/numba/core/dispatcher.py”, line 358, in error_rewrite
reraise(type(e), e, None)
File “/home/gregs/.local/lib/python3.9/site-packages/numba/core/utils.py”, line 80, in reraise
raise value.with_traceback(tb)
numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopython frontend)
No implementation of function Function(<function inv at 0x7ff7c8c17160>) found for signature:
>>> inv(array(complex128, 2d, C))
There are 2 candidate implementations:
- Of which 2 did not match due to:
Overload in function 'inv_impl': File: numba/np/linalg.py: Line 833.
With argument(s): '(array(complex128, 2d, C))':
Rejected as the implementation raised a specific error:
TypingError: Failed in nopython mode pipeline (step: nopython frontend)
No implementation of function Function(<function _inv_err_handler at 0x7ff7bdf60550>) found for signature:
>>> _inv_err_handler(int32)
There are 2 candidate implementations:
- Of which 2 did not match due to:
Overload in function 'register_jitable.<locals>.wrap.<locals>.ov_wrap': File: numba/core/extending.py: Line 150.
With argument(s): '(int32)':
Rejected as the implementation raised a specific error:
UnsupportedError: Failed in nopython mode pipeline (step: analyzing bytecode)
Use of unsupported opcode (LOAD_ASSERTION_ERROR) found
File "../../../.local/lib/python3.9/site-packages/numba/np/linalg.py", line 822:
def _inv_err_handler(r):
<source elided>
fatal_error_func()
assert 0 # unreachable
^
raised from /home/gregs/.local/lib/python3.9/site-packages/numba/core/byteflow.py:269
During: resolving callee type: Function(<function _inv_err_handler at 0x7ff7bdf60550>)
During: typing of call at /home/gregs/.local/lib/python3.9/site-packages/numba/np/linalg.py (861)
File "../../../.local/lib/python3.9/site-packages/numba/np/linalg.py", line 861:
def inv_impl(a):
<source elided>
r = numba_xxgetrf(kind, n, n, acpy.ctypes, n, ipiv.ctypes)
_inv_err_handler(r)
^
raised from /home/gregs/.local/lib/python3.9/site-packages/numba/core/typeinfer.py:1071
During: resolving callee type: Function(<function inv at 0x7ff7c8c17160>)
During: typing of call at /home/gregs/git_files/Resolvent_Python/Resolvent_Analysis/testing.py (12)
File "testing.py", line 12:
def test(a):
x = np.linalg.inv(a)
^