-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
CLN/PERF: no need for kahan for int group_cumsum #41874
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 5 commits
e2fb9ac
246d829
6c1b9ca
8b8a832
06e98ab
a24a7f4
208e6ed
6996b57
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -253,18 +253,16 @@ def group_cumsum(numeric[:, ::1] out, | |
t = accum[lab, j] + y | ||
compensation[lab, j] = t - accum[lab, j] - y | ||
accum[lab, j] = t | ||
out[i, j] = accum[lab, j] | ||
out[i, j] = t | ||
else: | ||
out[i, j] = NaN | ||
if not skipna: | ||
accum[lab, j] = NaN | ||
break | ||
else: | ||
y = val - compensation[lab, j] | ||
t = accum[lab, j] + y | ||
compensation[lab, j] = t - accum[lab, j] - y | ||
t = val + accum[lab, j] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. umm this is affecting all dtypes. do we not have tests for this for small floats? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is inside the else block from an if statement There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ahh ok that was not clear from the difff There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can you add a comment to that effect (maybe just on the float32/64 branch, e.g. using Kahan summation) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Have added a comment |
||
accum[lab, j] = t | ||
out[i, j] = accum[lab, j] | ||
out[i, j] = t | ||
|
||
|
||
@cython.boundscheck(False) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doubt this affects compiled result, but may as well to not depend on a smart compiler avoiding this extra indexing step