Skip to content
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

[oneMKL][Sparse BLAS] Add matrix sorting API to oneMKL Specification #585

Open
gajanan-choudhary opened this issue Sep 24, 2024 · 0 comments
Labels

Comments

@gajanan-choudhary
Copy link
Contributor

The sparse BLAS domain currently supports unsorted arrays in its sparse matrix handles. However, for some APIs to have good performance or for supporting certain algorithms in the future, having sorted data in the matrix handles is essential. Some examples:

  • COO format: without at least partially sorted data, algorithms even for basic APIs must resort to atomics for parallelization, or have multiple passes over the sparse matrix, neither of which are performant
  • Sparse + sparse = sparse matrix addition (not currently in oneAPI spec, but may be in the future) should be very performant with sorted data (simply merging two sorted arrays to get a sorted array, O(m+n) complexity) compared to unsorted case (e.g., requires extra O(n) space for hash algorithm leading to unsorted output matrix).

This is a tracker for adding a sorting API to the sparse BLAS domain in the oneMKL Specification. A starting point in this direction may be Intel oneMKL's oneapi::mkl::sort_matrix() API:

namespace oneapi::mkl::sparse {
    sycl::event sort_matrix (sycl::queue                           &queue,
                             oneapi::mkl::sparse::matrix_handle_t  spMat,
                             const std::vector<sycl::event>        &dependencies = {});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant