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
FEAT: sparse-sparse add/sub support #2312
Conversation
I have a pending issue on CPU backend that I am currently debugging but the other two backends work as expected. It is probably some typo, will get it soon. Update - Resolved: It was a mistake on my end mixing up custom code with MKL upstream calls that caused the segfaults. |
Update: There are some additional changes I need to make to sparse array creation when MKL upstream is used in CPU backend. It involves replacing deprecated API with newest. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Initial run through this. Some of the inner loops can be improved. I wonder if it would be better if we allocated memory based on the worst case scenario rather than the exact size. Will require experimentation.
cbf1c41
to
d65af90
Compare
I will look into the windows compiler errors tomorrow. |
I have fixed windows compilation problems. 🤞 |
83b9101
to
f07b818
Compare
23fad1f
to
223770e
Compare
223770e
to
41df2fa
Compare
Requires arrayfire/arrayfire-data#12 |
0c1a3cb
to
c464a69
Compare
c464a69
to
e93f5b0
Compare
e93f5b0
to
bb74531
Compare
Addressed feedback, review again pls
Latest MKL API, doesn't handle the dense data to sparse storage conversion. It expects pointers to rows, cols and values arrays. It also returns sparse_matrix_t opaque handles that we don't use inside ArrayFire. Hence, deprecated MKL API has been removed in favor of our in-house kernels for conversions.
CPU and OpenCL backends have support for mul/div but they are disabled to have feature parity with CUDA which doesn't have support for mul/div. The output of sub/div/mul is not guaranteed to have only non-zero results of the arithmetic operation. The user has to take care of pruning the zero results from the output.
- Includes tests to read sparse matrix from mtx file cmake configure downloads the compressed mtx files, uncompresses the files and places them under the source tree location `test/data/matrixmarket` so that clean builds don't redownload entire data set. Hence, a new change has been added to test/data git repository to ignore the matrixmarket folder. If for any reason download fails, MTX tests are disabled.
bb74531
to
3fdd452
Compare
CPU backend:
CUDA backend sparse-sparse add/sub
OpenCL backend sparse-sparse add/sub/div/mul
The output of sub/div/mul is not guaranteed to have only
non-zero results of the arithmetic operation. The user has
to take care of pruning the zero results from the output.
Support for div/mul isn't exposed to the user yet as it is not uniform across all backends or even within CPU backend at the moment.
Also moved mkl interface defs in CPU backend into single source file