-
Notifications
You must be signed in to change notification settings - Fork 61
[BUG] python and sdc-compiled functions generate different output with same input #996
Comments
@dlee992 Hi, Thank you for the report! This is a bug in incorrect definition of a layout for the
|
@kozlov-alexey, thanks, the workaround makes sense. I tested a bit more, as below:
Tested on the newest master branch of SDC. |
@dlee992, The second error is kind of current limitation of SDC (mostly based on Numba, that is a JIT compiler with static typing), so generally iteration over heterogeneous collections using normal python syntax is forbidden. The reason is simple, in your example DF could have columns with different types, so that variable
Above should work. Regarding the first problem, I think this deviation in precision is somewhat expected, as parallelization of sum with SDC has the consequence of values being added in different order. As far as I see, if operating on sorted sequence and using parallel=False, the summation via explicit loop gives exactly same result for compiled and pure python versions:
But thank you to pointing this out, we will dig deeper if something can be improved. |
Details: definition of underlying data type of Series was done from PyObject dtype only and didn't take into account layout of original array, as a result 'C' layout was always inferred, where the original array might have other layout, breaking iteration over such Series (DF columns). Fixes IntelPython#996.
Details: definition of underlying data type of Series was done from PyObject dtype only and didn't take into account layout of original array, as a result 'C' layout was always inferred, where the original array might have other layout, breaking iteration over such Series (DF columns). Fixes IntelPython#996.
Details: definition of underlying data type of Series was done from PyObject dtype only and didn't take into account layout of original array, as a result 'C' layout was always inferred, where the original array might have other layout, breaking iteration over such Series (DF columns). Fixes IntelPython#996.
Reporting a bug
As you can see, python and sdc obtain different outputs with the same inputs.
Python 3.7.9 & numba 0.52.0 & sdc 0.38.0 & pandas 1.2.0
The text was updated successfully, but these errors were encountered: