-
-
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
Slow sparse matrix-vector multiplication with symmetric matrices #32689
Comments
cc @KlausC |
I just want to remind of this PR, which I think will enable many kinds of specializations on wrapped sparse matrices. Unfortunately there is no progress there. #31563. |
There seems to be a mismatch of julia versions. I saw the same effect on an older version of julia. First the old version, which I could test:
Now the current development version:
|
Yes, I am using the 1.0.4 LTS version. I will update to 1.3 and try again. Do you think Bx will outperform Ax in future releases? |
@mancolric , not in general. But the quotient is less than 2 or 1 in more populated matrices. See the example below, which has ~100 entries per column. In the case of 1000 entries per column it is even better than the unwrapped matrix; break-even occurs for ~250 entries per column. The current implementation is optimized to access only the upper or lower part of the stored matrix. That requires to identify the diagonal position in each of the sparse columns, which needs a certain effort. Of course there is still improvement possible, but probable not worth the effort.
|
OK, thank you for your answer! I will upload to the 1.3 version and try. |
Hello,
I have performance problems when multiplying a symmetric sparse matrix with a vector: the multiplication is much slower than if we do not consider the matrix symmetry. Some other people have reported the same problems:
https://discourse.julialang.org/t/slow-sparse-matrix-vector-product-with-symmetric-matrices/3968
Please consider the following MWE:
The last two output lines are
I also have the same problem with non-diagonal sparse matrices and with matrix-matrix multiplications if one of the matrices is symmetric.
Thanks,
Manu
The text was updated successfully, but these errors were encountered: