-
-
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
stockcorr benchmark is slow #445
Comments
That's interesting. Will certainly try this out. Although, multiplication of skinny matrices is something that does differ greatly across various BLAS. |
We will be looking at this. For now I'll just point out that you don't need the semicolons :) |
Yep, on my machine:
In matlab:
So the BLAS is at least part of the difference. |
We should file an issue with openblas. -viral On 24-Feb-2012, at 12:34 AM, JeffBezansonreply@reply.github.com wrote:
|
Already done. |
On my box,
and if i replace
|
Is it that easy to swap in MKL? I tried this at some point and thought it was harder than this. If so, we should make it even easier — perhaps to the point of automatically using MKL if we can find one installed (say under the Matlab install directory };-). |
Yes, swapping BLAS and LAPACK should be that easy. I don't think we should do anything automatically, but have a config file. Also, we need a bit of reworking, because other libraries that depend on BLAS/LAPACK will still continue using the old statically linked version. We need to do that -rpath thing. -viral On 25-Feb-2012, at 1:56 PM, Stefan Karpinski wrote:
|
I wonder if it would be faster to implement this DGEMM in julia rather than calling OpenBLAS. We have matmul2x2, which could be extended to handle this case, and it just may be faster. Worth trying. |
I am now running @dgleich Can you also post both, the unvectorized matlab code and the vectorized one? @JeffBezanson It doesn't seem that matrix multiplication is taking much of the time now, even though it is still slower than matlab. For me the same matmul is only twice as much slower:
I updated my openblas to 0.1.0, which seems to have addressed the matrix-multiplication issue, but doing so does not make any difference. |
I don't think this is a v1.0 issue. It would be awesome to make this faster and I'm sure we will, but making something faster won't break any existing code. Since there's no breaking change involved in fixing this and it isn't a "can't possibly announce 1.0 without fixing this embarrassment" sort of thing, I'm removing the v1.0 milestone. |
I have checked in stockcorr.m into examples. Julia is taking 40 seconds for me, whereas Matlab is taking 10 seconds, using only one computational thread. |
@JeffBezanson How do you suggest we sort this one out? |
We just need to do a detailed performance analysis. Delete bits of it until the performance problem goes away, try running without GC, etc. until we have a clear idea what the problem is. |
The julia code now takes 6.4 seconds, whereas the matlab code takes 9 seconds. I suppose we can close this issue. |
Add invpermute! and a pairs method for replace
The track CI runs `configlet lint`, which currently exits with a non-zero exit code if it sees an optional string key that has the value of the empty string. This commit therefore removes all such key/value pairs on the track - they otherwise cause a failing CI check.
* compat with Julia 1.x * work around compiler error on 1.2 * rm travis/appveyor
Julia looks really interesting. My impression was that it'd be a great language to compare in the studies done here: http://www.walkingrandomly.com/?p=3604.
The idea is to generate about 500MB of synthetic time series data for financial applications.
The unoptimized Matlab code takes about 10 seconds on my machine.
I expected Julia to do much better on that same unoptimized code, which heavily utilizes for loops.
However, when I tried the following julia port:
I was surprised to see that it took 60 seconds... 6 times longer than Matlab.
If I take out the matrix multiplication:
Then the function takes only 6 seconds instead, which is still a bit slower than I would have expected. Vectorized Matlab code takes 3 seconds.
Is there something else in that code that is "slow" in julia?
And does the MKL in Matlab really make the 500x2 -times- 2x2 mat-mults that much faster?
The text was updated successfully, but these errors were encountered: