Multi-threaded sparse matrix multiplication

  • Follow


Here is multi-threaded SSE2-optimized implementation of matrix multiplication algorithm for the case when one or both matrices are sparse:

http://guryanov.org/other/spmm.zip

It is equivalent to * operator in Matlab (or mtimes function), but substantially faster. It is even faster than Intel MKL equivalent.

See "doc/readme.txt" for details.

Here are main points:

Usage:
spmm(A,B)
multiplies matrices A and B, at least one of them must be sparse, A and B may be real or complex in any combination.

Precompiled functions are included, if it doesn't run install Microsoft Visual C++ Redistributable Package for your platform.
For 32-bit:
http://www.microsoft.com/downloads/en/details.aspx?familyid=A5C84275-3B97-4AB7-A40D-3802B2AF5FC2&displaylang=en
For 64-bit:
http://www.microsoft.com/downloads/en/details.aspx?familyid=ba9257ca-337f-4b40-8c14-157cfdffee4e&displaylang=en

I tested its performance on my PC's and summarized the results here:
http://cid-61ceb32643f04cdb.office.live.com/view.aspx/.Documents/spmm%20benchmark.xlsx

You can do a quick performance comparison be running commands like this:

tic
for i=1:100
    spmm(A,B);
end
toc

tic
for i=1:100
    A*B;
end
toc

Previously, I published it here without source code:
http://www.mathworks.com/matlabcentral/newsreader/view_thread/296180
This new version comes with source code and has been improved in many ways.

This new version has been further optimized in following ways:

Note that this software and source code is available for free for testing purposes only and not for commercial use. 

I'll be glad to see speed tests and bug reports in this thread.
0
Reply Andrew 1/6/2011 4:00:08 PM


0 Replies
462 Views

(page loaded in 0.024 seconds)

Similiar Articles:










7/27/2012 9:32:05 AM


Reply: