-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
To improve performance in cumsum #7342
Comments
What version of julia are you using? |
The current implementation of cumsum isn't cache-friendly. The |
Hi Jeff, I am using a Debian version of Julia: 0.2.1 from 11-02-2014. Best, Charles From: Jeff Bezanson [notifications@github.com] What version of julia are you using? — |
The code is cache friendly for cumsum along columns, but not rows, in a 2d case. Even so, the performance suffers because of the div check in every iteration. |
A version that, in 2d, runs roughly 10x faster is just a couple of lines:
(Note this works in-place, so it's a slightly different API). However, it doesn't use pairwise summation. Are we worried about that? |
even |
@JeffBezanson, ah, I was looking at the wrong implementation. Yes, the
Should be basically as fast as the Cartesian version. @lindahua, of course you're right. Good point. |
Oh, wait, no, that's not right. I'll put the Cartesian version in. |
Faster cumsum & cumprod. Fixes #7342.
@cndesantana, there's a significantly faster version in master now. To get it, you'll have to compile your own version of Julia from source, or wait for a nightly build package. |
Dear guys, You are amazing! I am learning a lot from your messages!! Thank you for your hard work, I will try to compile my own version and I will let you know about it in the general discussion list. Thank you very much! Long life to Julia! Best, Charles From: Tim Holy [notifications@github.com] @cndesantanahttps://github.com/cndesantana, there's a significantly faster version in master now. To get it, you'll have to compile your own version of Julia from source, or wait for a nightly build package. — |
Dear all,
By checking the profile of a program we are developing we noted that the "bottleneck" seems to be in a cumulative sum along a dimension in a matrix, for what we use the function cumsum.
We are doing something like this:
DI = rand(5,5);
Dc = cumsum(DI,2);
How to improve performance in cumsum? According to some comments in the forums, it seems that cumsum / cummax / cummin / cumprod, etc have suboptimal performance currently, which are about 20x slower than the sum/prod etc.
Best
The text was updated successfully, but these errors were encountered: