numba: ipython kernel dies when using jit
I am using numba on Windows 10 (64-bit) with Anaconda3 (v 5.2), numba 0.38.0, and numpy 1.14.3.
When I run the code attached below for test, ident_loops works just fine, but the ipython kernel dies if I use jit (jident_loops in the code). I tested it on spyder and jupyter notebook, but the kernel dies in both cases.
I tested the identical code on my previous machine (Ubuntu 16.04) without any problem, but it kills the kernel now. (Currently I have only Windows so I cannot test it on Ubuntu again).
I deleted Anaconda and re-installed, but nothing changed.
from numba import jit
import numpy as np
def ident_loops(x):
r = np.empty_like(x)
n = len(x)
for i in range(n):
r[i] = np.cos(x[i]) ** 2 + np.sin(x[i]) ** 2
return r
@jit
def jident_loops(x):
r = np.empty_like(x)
n = len(x)
for i in range(n):
r[i] = np.cos(x[i]) ** 2 + np.sin(x[i]) ** 2
return r
print(ident_loops(np.arange(1000)))
print(jident_loops(np.arange(1000)))
Any possible solution to this…?
Added: Some other examples, e.g., at documentation seem to work without problem. So now I guess my test code is seriously problematic…?
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 15 (10 by maintainers)
Commits related to this issue
- Unittest for issue #3016 — committed to anton-malakhov/numba by anton-malakhov 6 years ago
- Adding "important" tag on the test reproducing the issue #3016 — committed to anton-malakhov/numba by anton-malakhov 6 years ago
- Adding workaround for https://github.com/numba/numba/issues/3016 — committed to anton-malakhov/llvmlite by anton-malakhov 6 years ago
- Hot-fix for numba/numba#3016 — committed to anton-malakhov/llvmdev-feedstock by anton-malakhov 6 years ago
- Added test for numba/numba#3016 — committed to anton-malakhov/llvmdev-feedstock by anton-malakhov 6 years ago
- Merge pull request #3019 from anton-malakhov/develop workaround and unittest for issue #3016 — committed to numba/numba by stuartarchibald 6 years ago
- Merge pull request #38 from anton-malakhov/develop Hot-fix in LoopVectorize for numba/numba#3016 — committed to conda-forge/llvmdev-feedstock by isuruf 6 years ago
- llvmlite: Autospec creation for update from version 0.23.2 to version 0.24.0 Aaron Meurer (1): Guard against close being None in ObjectRef.__del__ Anton (1): Fixed the fix Anton Malakho... — committed to clearlinux-pkgs/llvmlite by fenrus75 6 years ago
I had this issue for a while as well - it turned out to be caused by an out-of-bounds NumPy array index, which was an easy fix once I figured it out. If possible, an explicit error message/warning could be very helpful for new users trying to figure out why the kernel is crashing.