Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you do parallel matrix multiplication in Julia?

Tags:

julia

Is there a good way to do parallel matrix multiplication in julia? I tried using DArrays, but it was significantly slower than just a single-thread multiplication.

like image 277
Omar Abudayyeh Avatar asked Nov 26 '15 20:11

Omar Abudayyeh


People also ask

How do you multiply matrices in Julia?

In Julia, we can do matrix multiplication on two variables with a Matrix data type. We can use the asterisk ( * ) operator for this purpose.

Can matrix multiplication be parallel?

Net. A matrix is a set of numerical and non-numerical data arranged in a fixed number of rows and column. Matrix multiplication is an important multiplication design in parallel computation.

Does Julia use Lapack?

Linear algebra functions in Julia are largely implemented by calling functions from LAPACK.

How do you get the dot product in Julia?

We should have dot(x::RowVector, y::RowVector) = dot(transpose(x), transpose(y)) (see mailing list). Mathematically, an inner product on a vector space induces an... But if we define dot(a,b) = a'*b one would expect to get back a matrix (the outer product) when a and b are row vectors.


1 Answers

Parallel in what sense? If you mean single-machine, multi-threaded, then Julia does this by default as OpenBLAS (the underlying linear algebra library used) is multithreaded.

If you mean multiple-machine, distributed-computing-style, then you will be encountering a lot of communications overhead that will only be worth it for very large problems, and a customized approach might be needed.

like image 189
IainDunning Avatar answered Sep 20 '22 22:09

IainDunning