I maintain a project called PyNNDescent for approximate nearest neighbor search which makes heavy use of Numba. I am testing against the new 0.59rc1 pre-release and the project currently gives errors. The error message is quite long, so I won’t reproduce it here until asked, but the issue seems to revolve around a single function:
@numba.njit(
parallel=True,
locals={
"p": numba.int32,
"q": numba.int32,
"d": numba.float32,
"added": numba.uint8,
"n": numba.uint32,
"i": numba.uint32,
"j": numba.uint32,
},
cache=False,
)
def apply_graph_updates_low_memory(current_graph, updates, n_threads):
n_changes = 0
priorities = current_graph[1]
indices = current_graph[0]
flags = current_graph[2]
for n in numba.prange(n_threads):
for i in range(len(updates)):
for j in range(len(updates[i])):
p, q, d = updates[i][j]
if p == -1 or q == -1:
continue
if p % n_threads == n:
added = checked_flagged_heap_push(
priorities[p], indices[p], flags[p], d, q, 1
)
n_changes += added
if q % n_threads == n:
added = checked_flagged_heap_push(
priorities[q], indices[q], flags[q], d, p, 1
)
n_changes += added
return n_changes
With parallel set to True this function fails to compile; with parallel set to False it works. Under previous releases of Numba this code worked with parallel True. Since the code is relatively short, and the error sufficiently opaque, I was hoping that someone could suggest something about this code that contravenes what numba requires for parallelism under 0.59 (but not under previosu versions).
Thanks in advance for any suggestions.