Skip to content

Conversation

@lshaw8317
Copy link
Collaborator

@lshaw8317 lshaw8317 commented Feb 10, 2026

Add cumulative_sum/prod for array api compliance #466.

Also change reduction convention to load chunks along reduction axis, rather than last axis (benchmarks suggest doesn't make much difference though).
Could also implement kahan summation maybe although doesn't seem to help precision, as the problem is in np.cumsum on the chunks (less accurate than np.sum).

Copy link
Member

@FrancescAlted FrancescAlted left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I think this a good enough implementation for now. Just make sure that you add the two new entries (cumsum and cumprod) in the documentation.

@lshaw8317 lshaw8317 merged commit ff5ea66 into main Feb 11, 2026
21 of 22 checks passed
@lshaw8317 lshaw8317 deleted the optimise_cumsum branch February 11, 2026 14:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants