question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Performance regression on 0.52.0 wrt accumulation

See original GitHub issue

Reporting 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:open
  • Created 3 years ago
  • Comments:12 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
brandonwillardcommented, Jul 31, 2021

It seems like this issue might overlap with this example from the Numba Discourse.

0reactions
stuartarchibaldcommented, Jan 25, 2021

@cmartinezdem Thanks for the report. Do you have a reproducer please?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found