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 sparse + sparse = sparse matrix addition API #586

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

Comments

@gajanan-choudhary
Copy link
Contributor

This is a request tracker to add an API for sparse + sparse = sparse matrix addition API in the sparse BLAS domain in the oneMKL Specification.

  • The operation performed is, $C = \alpha\cdot\text{op}(A) + \beta\cdot\text{op}(B)$, where:
    • $A$, $B$, and $C$ are sparse matrices,
    • $\alpha$ and $\beta$ are scalars, and
    • $\text{op}(\cdot)$ is one non-transpose/transpose/conjugate-transpose.
  • Going by the recent overhaul in [oneMKL][spblas] Update sparse blas API #522, in all likelihood, the APIs will likely need 3 or 4 stages. The APIs could be a modified version of the soon-to-be-added Intel oneMKL sparse::omatadd APIs:
    namespace oneapi::mkl::sparse {
    
        struct omatadd_descr;
        using omatadd_descr_t = omatadd_descr*;
    
        void init_omatadd_descr(sycl::queue                          &queue,
                                oneapi::mkl::sparse::omatadd_descr_t *p_omatadd_descr);
    
        sycl::event release_omatadd_descr(sycl::queue                          &queue,
                                          oneapi::mkl::sparse::omatadd_descr_t omatadd_descr,
                                          const std::vector<sycl::event>       &dependencies = {});
    
        enum class omatadd_alg {
            default_alg
        };
    
        void omatadd_buffer_size(
            sycl::queue                          &queue,
            oneapi::mkl::transpose               opA,
            oneapi::mkl::transpose               opB,
            oneapi::mkl::sparse::matrix_handle_t A_handle,
            oneapi::mkl::sparse::matrix_handle_t B_handle,
            oneapi::mkl::sparse::matrix_handle_t C_handle,
            oneapi::mkl::sparse::omatadd_alg     alg,
            oneapi::mkl::sparse::omatadd_descr_t omatadd_descr,
            std::size_t                          &temp_buffer_size);
    
        void omatadd_analyze(
            sycl::queue                          &queue,
            oneapi::mkl::transpose               opA,
            oneapi::mkl::transpose               opB,
            oneapi::mkl::sparse::matrix_handle_t A_handle,
            oneapi::mkl::sparse::matrix_handle_t B_handle,
            oneapi::mkl::sparse::matrix_handle_t C_handle,
            oneapi::mkl::sparse::omatadd_alg     alg,
            oneapi::mkl::sparse::omatadd_descr_t omatadd_descr,
            sycl::buffer<std::uint8_t, 1>        workspace);
    
        sycl::event omatadd_analyze(
            sycl::queue                          &queue,
            oneapi::mkl::transpose               opA,
            oneapi::mkl::transpose               opB,
            oneapi::mkl::sparse::matrix_handle_t A_handle,
            oneapi::mkl::sparse::matrix_handle_t B_handle,
            oneapi::mkl::sparse::matrix_handle_t C_handle,
            oneapi::mkl::sparse::omatadd_alg     alg,
            oneapi::mkl::sparse::omatadd_descr_t omatadd_descr,
            void*                                workspace,
            const std::vector<sycl::event>       &dependencies = {});
    
        void omatadd_get_nnz(
            sycl::queue                          &queue,
            oneapi::mkl::transpose               opA,
            oneapi::mkl::transpose               opB,
            oneapi::mkl::sparse::matrix_handle_t A_handle,
            oneapi::mkl::sparse::matrix_handle_t B_handle,
            oneapi::mkl::sparse::matrix_handle_t C_handle,
            oneapi::mkl::sparse::omatadd_alg     alg,
            oneapi::mkl::sparse::omatadd_descr_t omatadd_descr,
            std::int64_t                         &nnzC,
            const std::vector<sycl::event>       &dependencies = {});
    
        sycl::event omatadd(
            sycl::queue                          &queue,
            oneapi::mkl::transpose               opA,
            oneapi::mkl::transpose               opB,
            const void*                          alpha,
            oneapi::mkl::sparse::matrix_handle_t A_handle,
            const void*                          beta,
            oneapi::mkl::sparse::matrix_handle_t B_handle,
            oneapi::mkl::sparse::matrix_handle_t C_handle,
            oneapi::mkl::sparse::omatadd_alg     alg,
            oneapi::mkl::sparse::omatadd_descr_t omatadd_descr,
            const std::vector<sycl::event>       &dependencies = {});
    
    }
@Rbiessy
Copy link
Contributor

Rbiessy commented Sep 25, 2024

Thank you for the issues Gajanan. Do you know if there is any order of priority between the different issues #578, #584, #585 and this one?
We'll update the issues when we get to them and if no one else start working on them first.

@gajanan-choudhary
Copy link
Contributor Author

gajanan-choudhary commented Sep 25, 2024

Thank you for the issues Gajanan. Do you know if there is any order of priority between the different issues #578, #584, #585 and this one? We'll update the issues when we get to them and if no one else start working on them first.

The priorities are coincidentally in the order of their issue numbers: #578, #584, #585, and this issue, (#586). I would add that the first two are high priority and the last two are lower priority.

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

2 participants