-
Notifications
You must be signed in to change notification settings - Fork 96
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
Sparse matrix addition (related to Trilinos pull request #1957) #122
Conversation
Implemented in sparse/KokkosSparse_spadd.hpp Has associated handle type (like spgemm) and unit tests
src/sparse/KokkosSparse_spadd.hpp
Outdated
addHandle->set_a_b_pos(a_pos, b_pos); | ||
} | ||
//provide the number of NNZ in C to user through handle | ||
addHandle->set_max_result_nnz(c_rowmap(nrows)); |
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.
This causes memory access errors if UVM is not enabled on GPUs. Something like below is needed for this.
auto d_c_nnz_size = Kokkos::subview(c_rowmap, nrows);
auto h_c_nnz_size = Kokkos::create_mirror_view (d_c_nnz_size);
Kokkos::deep_copy (h_c_nnz_size, d_c_nnz_size);
execution_space::fence();
addHandle->set_max_result_nnz(h_c_nnz_size());
src/sparse/KokkosSparse_spadd.hpp
Outdated
Kokkos::parallel_scan(range_type(0, nrows + 1), prefix); | ||
//compute uncompressed entries of C (just indices, no scalars) | ||
execution_space::fence(); | ||
c_nnz_upperbound = c_rowmap_upperbound(nrows); |
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.
auto d_c_nnz_size = Kokkos::subview(c_rowmap_upperbound, nrows);
auto h_c_nnz_size = Kokkos::create_mirror_view (d_c_nnz_size);
Kokkos::deep_copy (h_c_nnz_size, d_c_nnz_size);
execution_space::fence();
c_nnz_upperbound = h_c_nnz_size();
src/sparse/KokkosSparse_spadd.hpp
Outdated
execution_space::fence(); | ||
clno_nnz_view_t_ a_pos("A entry positions", a_rowmap(nrows)); | ||
clno_nnz_view_t_ b_pos("B entry positions", b_rowmap(nrows)); | ||
//merge the entries and compute Apos/Bpos, as well as Crowcounts |
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.
same this for lines 477 and 478. The array cannot be accessed by the host.
Simply, we can use a_entries.dimension_0() here, right?
- Changing the name of the function to spadd to be consistent with the file name. - Minor fixes for UVM spaces.
Minor edits for SpADD function.
Somebody needs to rework this to follow our coding guidelines as well as adding ETI and the TPL hooks etc. |
SpAdd handle was originally a copy-paste of the spgemm handle way back in kokkos#122, and included get_sort_option() and set_sort_option() from spgemm. But these try to use the member bool sort_option, which doesn't exist. Somehow these functions never produced compile errors until someone tried to call them.
SpAdd handle was originally a copy-paste of the spgemm handle way back in #122, and included get_sort_option() and set_sort_option() from spgemm. But these try to use the member bool sort_option, which doesn't exist. Somehow these functions never produced compile errors until someone tried to call them.
SpAdd handle was originally a copy-paste of the spgemm handle way back in kokkos#122, and included get_sort_option() and set_sort_option() from spgemm. But these try to use the member bool sort_option, which doesn't exist. Somehow these functions never produced compile errors until someone tried to call them.
SpAdd handle was originally a copy-paste of the spgemm handle way back in kokkos#122, and included get_sort_option() and set_sort_option() from spgemm. But these try to use the member bool sort_option, which doesn't exist. Somehow these functions never produced compile errors until someone tried to call them.
* Restore size_t as default offset, in Tribits builds (#2313) If building KokkosKernels standalone, leave int as the default offset (this was the case since #2140). But if building KokkosKernels as a Trilinos/Tribits package, then make size_t the default offset because this is what the Tpetra stack currently uses. Signed-off-by: Brian Kelley <bmkelle@sandia.gov> * Improve crs/bsr sorting performance (#2293) * CRS sorting improvements - Wrote bulk sort/permutation based sorting for CRS graph, matrix, and BSR matrix (bulk = one large sort of all the entries, using row-major dense index as keys) - This is more performant for imbalanced entries per row - If matrix dimensions are too large to do bulk sort, fall back to sorting within each row with a thread. * Add perf test for sort_crs_matrix * sort_crs: improve parallel labels * Work around kokkos issue 7036 * sort_crs: replace radix sort lambda with functor (Lambda segfaults with nvcc+openmp) --------- Signed-off-by: Brian Kelley <bmkelle@sandia.gov> * SpAdd handle: delete sort_option getter/setter (#2296) SpAdd handle was originally a copy-paste of the spgemm handle way back in #122, and included get_sort_option() and set_sort_option() from spgemm. But these try to use the member bool sort_option, which doesn't exist. Somehow these functions never produced compile errors until someone tried to call them. * Improve GH action to produce release artifacts (#2312) * coo2csr: add parens to function calls (#2318) * Update changelog * Update master_history.txt * .github/workflows: Group jobs under common github-AT2 name (#2320) * Update master_history.txt --------- Signed-off-by: Brian Kelley <bmkelle@sandia.gov> Co-authored-by: brian-kelley <bmkelle@sandia.gov> Co-authored-by: Damien L-G <dalg24@gmail.com> Co-authored-by: Carl Pearson <cwpearson@users.noreply.github.com> Co-authored-by: Evan Harvey <57234914+e10harvey@users.noreply.github.com>
* Set version number to 4.4.01 * [4.4.01] Patches to 4.4.01 (#2327) * Restore size_t as default offset, in Tribits builds (#2313) If building KokkosKernels standalone, leave int as the default offset (this was the case since #2140). But if building KokkosKernels as a Trilinos/Tribits package, then make size_t the default offset because this is what the Tpetra stack currently uses. Signed-off-by: Brian Kelley <bmkelle@sandia.gov> * Improve crs/bsr sorting performance (#2293) * CRS sorting improvements - Wrote bulk sort/permutation based sorting for CRS graph, matrix, and BSR matrix (bulk = one large sort of all the entries, using row-major dense index as keys) - This is more performant for imbalanced entries per row - If matrix dimensions are too large to do bulk sort, fall back to sorting within each row with a thread. * Add perf test for sort_crs_matrix * sort_crs: improve parallel labels * Work around kokkos issue 7036 * sort_crs: replace radix sort lambda with functor (Lambda segfaults with nvcc+openmp) --------- Signed-off-by: Brian Kelley <bmkelle@sandia.gov> * SpAdd handle: delete sort_option getter/setter (#2296) SpAdd handle was originally a copy-paste of the spgemm handle way back in #122, and included get_sort_option() and set_sort_option() from spgemm. But these try to use the member bool sort_option, which doesn't exist. Somehow these functions never produced compile errors until someone tried to call them. * Improve GH action to produce release artifacts (#2312) * coo2csr: add parens to function calls (#2318) * Update changelog * Update master_history.txt * .github/workflows: Group jobs under common github-AT2 name (#2320) * Update master_history.txt --------- Signed-off-by: Brian Kelley <bmkelle@sandia.gov> Co-authored-by: brian-kelley <bmkelle@sandia.gov> Co-authored-by: Damien L-G <dalg24@gmail.com> Co-authored-by: Carl Pearson <cwpearson@users.noreply.github.com> Co-authored-by: Evan Harvey <57234914+e10harvey@users.noreply.github.com> * Update master_history.txt for 4.4.01 --------- Signed-off-by: Brian Kelley <bmkelle@sandia.gov> Co-authored-by: brian-kelley <bmkelle@sandia.gov> Co-authored-by: Damien L-G <dalg24@gmail.com> Co-authored-by: Carl Pearson <cwpearson@users.noreply.github.com> Co-authored-by: Evan Harvey <57234914+e10harvey@users.noreply.github.com>
Same interface as spgemm (separate symbolic/numeric)
Implemented in sparse/KokkosSparse_spadd.hpp
Has associated handle type (like spgemm) and unit tests