Comments (8)
This bug appears to be a nasty corner case in control flow analysis of for-loop code that is being transformed into a while loop. I've added unit tests that illustrate this problem. The case where there is an if-else branch in the for loop is more horrifying since it is causing LLVM to abort due to bad phi node generation. We'll need these new unit tests working for any new release.
from numba.
Looks like the while-loop version wasn't complete enough. See also:
https://groups.google.com/a/continuum.io/d/topic/numba-users/tVwSYOdW518/discussion
from numba.
This was a whammy of an issue, caused by strange interactions between the dead bytecode Python will generate, phi node generation, and the for-loop transformation. Should be fixed per test results.
from numba.
Strange, works for me with numba 0.48.0 but fails with latest 0.51.1...
from numba.decorators import jit
import numba
@jit(arg_types=[numba.double], ret_type=numba.double)
def is_REALLY_five(some_value):
for i in range(5):
if some_value == 5.0:
return 1.0
return 0.0
from numba.
Strange, works for me with numba 0.48.0 but fails with latest 0.51.1...
from numba.decorators import jit
import numba@jit(arg_types=[numba.double], ret_type=numba.double)
def is_REALLY_five(some_value):
for i in range(5):
if some_value == 5.0:
return 1.0
return 0.0
The numba.decorators
module was removed, and you can import jit
from numba
instead.
If you have any further issues, please start a thread on the Numba Discourse (https://numba.discourse.group) describing your issue / question.
from numba.
The
numba.decorators
module was removed, and you can importjit
fromnumba
instead.If you have any further issues, please start a thread on the Numba Discourse (https://numba.discourse.group) describing your issue / question.
Thank you for your update.
from numba.
I tried both versions numba 0.48.0, 0.51.1, still, the if loop is getting failed.
from numba.
I tried both versions numba 0.48.0, 0.51.1, still, the if loop is getting failed.
@phanirohith thank you for bringing this to our attention. This seems like a regression. Can you please open a new issue and add the code your have as a reproducer. We will take a closer look then. Thank you!
from numba.
Related Issues (20)
- lack of overflow check and incorrect type init when using jitclass HOT 1
- Tuples and inline = 'always' don't play together HOT 5
- `sign` with complex values does not match numpy 2.0 HOT 1
- AttributeError: 'Integer' object has no attribute 'literal_value' #115 HOT 8
- Can Numba use c++functions? HOT 6
- objects from the jitclass lose dynamic features about the class attributions HOT 6
- unchecked out of bound when enable jit HOT 2
- let `new_style` be a superset of `old_style`? HOT 2
- Missing type promotions when doing python API calls HOT 7
- cuInit fails also "else without an if" HOT 4
- config.OPT is not overridden with override_config('OPT', 0) HOT 7
- Inconsistent behavior when handling empty iterator with jit HOT 2
- Change to versioning HOT 4
- Improve DeadBranchPrune to be type aware in `x is None` case HOT 1
- Function with @guvectorize allow the index of array out of bound, not sure if this is in purpose HOT 2
- Strange issue with round() function used in CUDA kernel HOT 1
- Numba njit "parallel=True"& Function Signature & Tuple int64 HOT 2
- Pass NULL pointer for cffi.FFI().from_buffer(empty array) HOT 7
- Allow passing of NULL pointer in CUDA function HOT 2
- compiling code ahead of time error with latest version 0.60.0 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from numba.