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.
In Julia, we can do matrix multiplication on two variables with a Matrix data type. We can use the asterisk ( * ) operator for this purpose.
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.
Linear algebra functions in Julia are largely implemented by calling functions from LAPACK.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With