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

Adopt Kokkos::StaticCrsGraph from "Core" and move Static{Ccs,Crs}Graph to namespace KokkosSparse:: #2419

Merged
merged 1 commit into from
Dec 10, 2024

Conversation

dalg24
Copy link
Member

@dalg24 dalg24 commented Nov 6, 2024

This PR implements what we agreed on, that is Kokkos "Core" is deprecating Kokkos::StaticCrsGraph and we transition it to Kokkos Kernels into KokkosSparse::.

On 2nd thought we decided to give up on raising deprecation warnings because it was too tricky to guarantee same symbols and not emit diagnostics when the KokkosSparse:: versions are used.

Comment on lines +31 to +32
using Kokkos::create_staticcrsgraph;
using Kokkos::GraphRowViewConst;
using Kokkos::maximum_entry;
using Kokkos::StaticCrsGraph;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure what to do about create_mirror[_view]
I certainly want to pull all overloads from Kokkos into KokkosSparse::

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think Kokkos provides create_mirror... functions for any other non-view containers, right? Shall we just be consistent with that and move them into KokkosSparse namespace? Kokkos can make the suggestion in the deprecation message.

Copy link
Contributor

@cwpearson cwpearson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving to get some CI going

@cwpearson cwpearson added the AT2-CI-APPROVAL Approve CI to run at SNL label Nov 25, 2024
@ndellingwood
Copy link
Contributor

kokkos-kernels nightly builds with deprecated code off are failing after merge of kokkos/kokkos#7516 , I'm assuming merge of this PR is needed to get develop branches back in sync?

For reference, this is the error:

In file included from <https://jenkins-son.sandia.gov/job/KokkosKernels_CarawayMI210_Rocm600_HipSerial/ws/TestAll_2024-12-03_20.46.03/rocm/6.0.0/Hip_Serial-release/graph/eti/generated_specializations_cpp/color_d1/Graph_color_d1_eti_DOUBLE_ORDINAL_INT_OFFSET_INT_LAYOUTLEFT_EXECSPACE_HIP_MEMSPACE_HIPSPACE.cpp>:21:
In file included from <https://jenkins-son.sandia.gov/job/KokkosKernels_CarawayMI210_Rocm600_HipSerial/ws/kokkos-kernels/graph/impl/KokkosGraph_color_d1_spec.hpp>:22:
In file included from <https://jenkins-son.sandia.gov/job/KokkosKernels_CarawayMI210_Rocm600_HipSerial/ws/kokkos-kernels/sparse/src/KokkosKernels_Handle.hpp>:19:
In file included from <https://jenkins-son.sandia.gov/job/KokkosKernels_CarawayMI210_Rocm600_HipSerial/ws/kokkos-kernels/sparse/src/KokkosSparse_gauss_seidel_handle.hpp>:20:
In file included from <https://jenkins-son.sandia.gov/job/KokkosKernels_CarawayMI210_Rocm600_HipSerial/ws/kokkos-kernels/sparse/src/KokkosSparse_CrsMatrix.hpp>:28:
<https://jenkins-son.sandia.gov/job/KokkosKernels_CarawayMI210_Rocm600_HipSerial/ws/TestAll_2024-12-03_20.46.03/rocm/6.0.0/Hip_Serial-release/kokkos-install/include/Kokkos_StaticCrsGraph.hpp>:38:2: error: "Deprecated <Kokkos_StaticCrsGraph.hpp> header is included"
#error "Deprecated <Kokkos_StaticCrsGraph.hpp> header is included"
 ^
In file included from <https://jenkins-son.sandia.gov/job/KokkosKernels_CarawayMI210_Rocm600_HipSerial/ws/TestAll_2024-12-03_20.46.03/rocm/6.0.0/Hip_Serial-release/graph/eti/generated_specializations_cpp/color_d1/Graph_color_d1_eti_DOUBLE_ORDINAL_INT_OFFSET_INT_LAYOUTLEFT_EXECSPACE_SERIAL_MEMSPACE_HOSTSPACE.cpp>:21:
In file included from <https://jenkins-son.sandia.gov/job/KokkosKernels_CarawayMI210_Rocm600_HipSerial/ws/kokkos-kernels/graph/impl/KokkosGraph_color_d1_spec.hpp>:22:
In file included from <https://jenkins-son.sandia.gov/job/KokkosKernels_CarawayMI210_Rocm600_HipSerial/ws/kokkos-kernels/sparse/src/KokkosKernels_Handle.hpp>:19:
In file included from <https://jenkins-son.sandia.gov/job/KokkosKernels_CarawayMI210_Rocm600_HipSerial/ws/kokkos-kernels/sparse/src/KokkosSparse_gauss_seidel_handle.hpp>:20:
In file included from <https://jenkins-son.sandia.gov/job/KokkosKernels_CarawayMI210_Rocm600_HipSerial/ws/kokkos-kernels/sparse/src/KokkosSparse_CrsMatrix.hpp>:28:
<https://jenkins-son.sandia.gov/job/KokkosKernels_CarawayMI210_Rocm600_HipSerial/ws/TestAll_2024-12-03_20.46.03/rocm/6.0.0/Hip_Serial-release/kokkos-install/include/Kokkos_StaticCrsGraph.hpp>:38:2: error: "Deprecated <Kokkos_StaticCrsGraph.hpp> header is included"
#error "Deprecated <Kokkos_StaticCrsGraph.hpp> header is included"

@ndellingwood
Copy link
Contributor

The issues with runners should be resolved (killed some of the previous runs)
@dalg24 can you rebase and force push updates with a --signoff on the commits for the DCO check? Something like git rebase HEAD~5 --signoff (applying signoff to previous 5 commits)

@dalg24 dalg24 force-pushed the static_crs_graph branch 3 times, most recently from d0b822b to a98bf46 Compare December 4, 2024 14:57
@ndellingwood
Copy link
Contributor

Failure from the osx-ci serial build, test fixure related:

 [ RUN      ] serial.staticcrsgraph
/Users/runner/work/kokkos-kernels/kokkos-kernels/kokkos-kernels/tpls/gtest/gtest/gtest-all.cc:4000: Failure
Failed
All tests in the same test suite must use the same test fixture
class, so mixing TEST_F and TEST in the same test suite is
illegal.  In test suite serial,
test sparse_coo2crs is defined using TEST_F but
test staticcrsgraph is defined using TEST.  You probably
want to change the TEST to TEST_F or move it to another test
case.
[  FAILED  ] serial.staticcrsgraph (0 ms)

@ndellingwood
Copy link
Contributor

bdw failure:

[ 85%] Building CXX object perf_test/sparse/CMakeFiles/sparse_spmv_struct_tuning.dir/KokkosSparse_spmv_struct_tuning.cpp.o
/home/runner/_work/kokkos-kernels/kokkos-kernels/kokkos-kernels/perf_test/sparse/KokkosSparse_spmv_struct.cpp: In function 'int main(int, char**)':
/home/runner/_work/kokkos-kernels/kokkos-kernels/kokkos-kernels/perf_test/sparse/KokkosSparse_spmv_struct.cpp:247:99: error: no matching function for call to 'create_mirror(KokkosSparse::CrsMatrix<double, int, Kokkos::OpenMP, void, int>::staticcrsgraph_type&)'
  247 |       typename matrix_type::StaticCrsGraphType::HostMirror h_graph = Kokkos::create_mirror(A.graph);
      |                                                                                                   ^
In file included from /home/runner/_work/kokkos-kernels/kokkos-kernels/kokkos/install/include/Kokkos_Core.hpp:70,
                 from /home/runner/_work/kokkos-kernels/kokkos-kernels/kokkos-kernels/perf_test/sparse/KokkosSparse_spmv_struct.cpp:29:
/home/runner/_work/kokkos-kernels/kokkos-kernels/kokkos/install/include/Kokkos_CopyViews.hpp:3495:6: note: candidate: 'template<class T, class ... P, class> auto Kokkos::create_mirror(const Kokkos::View<D, P ...>&)'
 3495 | auto create_mirror(Kokkos::View<T, P...> const& src) {
      |      ^~~~~~~~~~~~~
/home/runner/_work/kokkos-kernels/kokkos-kernels/kokkos/install/include/Kokkos_CopyViews.hpp:3495:6: note:   template argument deduction/substitution failed:
/home/runner/_work/kokkos-kernels/kokkos-kernels/kokkos-kernels/perf_test/sparse/KokkosSparse_spmv_struct.cpp:247:99: note:   'KokkosSparse::CrsMatrix<double, int, Kokkos::OpenMP, void, int>::staticcrsgraph_type' {aka 'KokkosSparse::StaticCrsGraph<int, Kokkos::LayoutLeft, Kokkos::Device<Kokkos::OpenMP, Kokkos::HostSpace>, void, int>'} is not derived from 'const Kokkos::View<D, P ...>'
  247 |       typename matrix_type::StaticCrsGraphType::HostMirror h_graph = Kokkos::create_mirror(A.graph);
      |                                                                                                   ^
# more candidate match and deduction failures listed...

@lucbv lucbv added AT2-CI-APPROVAL Approve CI to run at SNL and removed AT2-CI-APPROVAL Approve CI to run at SNL labels Dec 8, 2024
* Moved Static{Ccs,Crs}Graph to namespace KokkosSparse and into their
  own new header files
* Deprecate symbols in Kokkos namespace
* CRS counterpart used to come from the Containers subpackage in Kokkos
  "Core" but now is transitioned to Kokkos Kernels.

Signed-off-by: Damien L-G <[email protected]>

Fix a couple typos

Signed-off-by: Damien L-G <[email protected]>

Giving up on raising warnings

Signed-off-by: Damien L-G <[email protected]>

Avoid deprecation warnings when including deprecated header Kokkos_StaticCrsGraph.hpp

Signed-off-by: Damien L-G <[email protected]>

Adjust test category per review

Signed-off-by: Damien L-G <[email protected]>

Co-authored-by: Nathan Ellingwood <[email protected]>

Fix copy/pasta error third -> fourth

Signed-off-by: Damien L-G <[email protected]>

Co-authored-by: Jonas Schulze <[email protected]>

Update sparse/unit_test/Test_Sparse_StaticCrsGraph.hpp

Fixup deprecate code off

Signed-off-by: Damien L-G <[email protected]>

Fix typo allocat[i]on

Signed-off-by: Damien L-G <[email protected]>

Rely on ADL for creat_mirror(GRAPH)

Signed-off-by: Damien L-G <[email protected]>

Update header and namespace triangle counting test

Fixing a small issue with the triangle counting performance test for the upcoming move of StaticCrsGraph

Sparse - StaticCrsGraph: fixing issues with perf tests and docs

A few performance tests had not been updated to use the new namespace
for the graph overload of create_mirror. Additionally some of the
inline documentation for StaticCrsGraph is wrong...

Signed-off-by: Luc Berger-Vergiat <[email protected]>

Sparse - StaticCrsGraph: apply clang-format

Signed-off-by: Luc Berger-Vergiat <[email protected]>
#include <Kokkos_StaticCrsGraph.hpp>
#undef KOKKOS_IMPL_DO_NOT_WARN_INCLUDE_STATIC_CRS_GRAPH

namespace KokkosSparse {
Copy link
Contributor

@brian-kelley brian-kelley Dec 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer to take out the

#ifdef KOKKOS_ENABLE_DEPRECATED_CODE_4
...
#else

block that uses Kokkos_StaticCrsGraph.hpp to provide the declarations. If the user is including this new header, we might as well use the new declarations in it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the idea of avoiding the deprecated branch, but could there be a case for example with packages Trilinos (and deprecated code enabled) that pull in Kokkos_StaticCrsGraph.hpp indirectly through kokkos-kernels (including KokkosSparse_CrsMatrix.hpp prior to this PR) and use the deprecated functionality? Keeping the guarded deprecated region could prevent breakage in that case, though I'm unsure how likely an issue would be

Copy link
Contributor

@brian-kelley brian-kelley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have 1 comment but it's not a blocker

@lucbv
Copy link
Contributor

lucbv commented Dec 10, 2024

I am going to merge this then for the sake of getting the nightlies back. If we notice more deprecation warnings than reasonable in the Trilinos nightlies then we can go back and dial things appropriately in a subsequent PR.

@lucbv lucbv merged commit e18fef1 into kokkos:develop Dec 10, 2024
18 checks passed
@brian-kelley
Copy link
Contributor

@lucbv Yes this is fine to merge.

I originally thought this would create warnings but then I realized that with the KOKKOS_IMPL_DO_NOT_WARN_INCLUDE_STATIC_CRS_GRAPH defined it won't make any warnings so I edited my comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
AT2-CI-APPROVAL Approve CI to run at SNL
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants