Skip to content

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

Open
@gajanan-choudhary

Description

@gajanan-choudhary

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 = {});
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions