Why I’m not on the Julia bandwagon (yet) (2012)
wesmckinney.com
wesmckinney.com
Nonetheless, julia is awesome and if you haven't tried it you're missing out. It's pleasant to work in in a way that numpy + python isn't. It's a higher performance R, one which has a hope of scaling to the sizes of data I want to use. You can almost always write in matrix notation then decay to loops if necessary.
a toy irls implementation looks like:
sigma = function(X)
1/(1 + exp(-X*beta))
end
beta = zeros( size(X,2) );
max_iter = 50
iter = 0
converged = false
while iter < max_iter && ~converged
s = sigma(X);
cost = sum(Y .* log(s) + (1 - Y).*log(1 - s));
grad = X' * (s - Y);
H = X' * diagm( s .* (1-s) ) * X;
d = H\-grad;
# print([beta d])
beta_new = beta + d;
delta = norm(beta_new - beta);
beta = beta_new; # NB: exact hessian so no line search
@printf("iter: %d; beta delta %f log like %f\n", iter, delta, cost)
iter += 1
if delta < 1e-4 converged = true end
end
beta
If you haven't tried it and you're an R or numpy user, you should give it a try immediately. Lots of people seems to use ipython or ipython in the browser to efficiently use the repl with code. I prefer tmux with 2 windows; vim in the left, julia in the right, and vim-slime to move code over. Array operations took 79.55683398 ms
inner took 23.88444026 ms
BLAS took 48.182116560000004ms
Obviously its possible that this is just due to differences between our machines; just figured I'd throw it out there.Generally speaking, any language for numerical computing must feature vector syntax. Most numerical algorithms work on arrays (vectors, matrices, and so on) and can be easily translated into a language which supports vector notation: MATLAB, Fortran, and Python (NumPy).
Asking people, in 2013, to explicitly write loops in numerical code is a definite step backwards.
http://docs.julialang.org/en/release-0.2/manual/arrays/#vect...
http://docs.julialang.org/en/release-0.2/manual/linear-algeb...
My understanding was that Julia gives you the option to write loops explicitly but it doesn't stop you using vector and matrix operations when appropriate, so I'm curious if there are any particular operations that its array implementation are missing?
As to not being able to beat MKL, it isn't even necessarily hands down the best BLAS around. For example, OpenBLAS [3] is about as good as MKL, depending on what you're doing. They each have their strengths and weaknesses:
1. OpenBLAS is faster than MKL in all the level-1 tests for small numbers of threads (1-4). The difference is larger for smaller problems. In small level-2 and level-3 instances, however, MKL does better. Specifically in the case of matrix-vector products, MKL seems to do much better.
2. On various linear algebra tests with LAPACK, MKL is faster for smaller problem sizes, whereas OpenBLAS is faster for larger problems.
3. In general, MKL seems to have better tuning for threads. OpenBLAS, on the other hand, has optimized kernels for LU and Cholesky factorizations, which is what GotoBLAS [4] – on which OpenBLAS is based – did too.
Blake Johnson, who is a regular Julia contributor, did an excellent analysis of this, complete with pretty Gadfly-generated graphs, which can be found in the discussion of this issue: https://github.com/JuliaLang/julia/issues/3965. Interestingly, I believe that Kazushige Goto, who originally created GotoBLAS, now works on MKL at Intel.
All of the "modern" numerical computing environments can use whatever BLAS and FFT (and ...) libraries are available on the host system, including MKL. What new languages offer isn't (usually) better execution speed (though there's still plenty that can be done with optimizing evaluation of linear algebra expressions at a high level), it's faster and more pleasant development of numerical codes.
Oh, sure they say, "well, we don't know the other architecture, so we can't optimise for it," but you know this is full of lies, as if AMD were some obscure architecture that Intel can't possibly know if it supports SSE or not.
Are you referring to this article? http://acko.net/blog/on-asmjs/ Because this article is awesome