Performance regression on 0.52.0 wrt accumulation
See original GitHub issueReporting a bug
- I have tried using the latest released version of Numba (most recent is visible in the change log (https://github.com/numba/numba/blob/master/CHANGE_LOG).
- I have included a self contained code sample to reproduce the problem. i.e. it’s possible to run as ‘python bug.py’.
Commit f4000439daac2aaefc20994c80e8fe9d903ce31a slows down my workload from ~60s to ~200s. I’ve slimmed down a repo to:
from numba import njit
from numpy import random, uint64, empty_like
from timeit import timeit
@njit
def fn(x, out):
for i in range(len(x)):
for j in range(1, 63):
out[i] = x[i] << j # no accumulation here but the shift exhibits the perf problem
rng = random.default_rng(0)
x = rng.integers(~uint64(0), size=500, dtype=uint64)
out = empty_like(x)
print(timeit(lambda: fn(x, out)))
on my server, f4000439daac2aaefc20994c80e8fe9d903ce31a gives ~11s and 9381206a03a3e7231d417f147474577745f6a720 gives ~3s.
Issue Analytics
- State:
- Created 3 years ago
- Comments:12 (7 by maintainers)
Top Results From Across the Web
Release Notes - Numba - PyData |
There are some performance regressions in very short running nopython functions due to the additional overhead incurred by memory management. We will work...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
It seems like this issue might overlap with this example from the Numba Discourse.
@cmartinezdem Thanks for the report. Do you have a reproducer please?