Giter Site home page Giter Site logo

Comments (8)

jriehl avatar jriehl commented on July 22, 2024

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.

jriehl avatar jriehl commented on July 22, 2024

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.

jriehl avatar jriehl commented on July 22, 2024

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.

mvaladas2020 avatar mvaladas2020 commented on July 22, 2024

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.

gmarkall avatar gmarkall commented on July 22, 2024

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.

mvaladas2020 avatar mvaladas2020 commented on July 22, 2024

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.

Thank you for your update.

from numba.

phanirohith avatar phanirohith commented on July 22, 2024

I tried both versions numba 0.48.0, 0.51.1, still, the if loop is getting failed.

from numba.

esc avatar esc commented on July 22, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.