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

Nightly build failure, Cuda backend, UVM enabled with deprecated code: error: namespace "KokkosSparse" has no member "create_mirror" #2455

Open
ndellingwood opened this issue Dec 11, 2024 · 1 comment

Comments

@ndellingwood
Copy link
Contributor

Nightly Cuda builds with UVM and deprecated code enabled have a couple remaining build failures following merge of #2419 (which got the nearly all jobs building again :)

00:42:10 /home/jenkins/blake-new/workspace/KokkosKernels_Nightly_Blake_Cuda_11_8_0_Gcc_11_3_0_Hopper90-cusparse-cublas-uvm/kokkos-kernels/perf_test/sparse/KokkosSparse_spmv_struct.cpp(247): error: namespace "KokkosSparse" has no member "create_mirror"
00:42:10 
00:42:11 1 error detected in the compilation of "/home/jenkins/blake-new/workspace/KokkosKernels_Nightly_Blake_Cuda_11_8_0_Gcc_11_3_0_Hopper90-cusparse-cublas-uvm/kokkos-kernels/perf_test/sparse/KokkosSparse_spmv_struct.cpp".
00:42:11 [ 85%] Built target KokkosKernels_batched_dla_cuda
00:42:11 [ 85%] Building CXX object perf_test/sparse/CMakeFiles/sparse_spmv_struct_tuning.dir/KokkosSparse_spmv_struct_tuning.cpp.o
00:42:11 make[2]: *** [perf_test/sparse/CMakeFiles/sparse_spmv_struct.dir/build.make:76: perf_test/sparse/CMakeFiles/sparse_spmv_struct.dir/KokkosSparse_spmv_struct.cpp.o] Error 1
00:42:11 make[1]: *** [CMakeFiles/Makefile2:2526: perf_test/sparse/CMakeFiles/sparse_spmv_struct.dir/all] Error 2
00:42:11 make[1]: *** Waiting for unfinished jobs....
00:42:12 [ 85%] Built target KokkosKernels_blocksparse_cuda
00:42:12 [ 85%] Linking CXX executable sparse_pcg
00:42:14 /home/jenkins/blake-new/workspace/KokkosKernels_Nightly_Blake_Cuda_11_8_0_Gcc_11_3_0_Hopper90-cusparse-cublas-uvm/kokkos-kernels/perf_test/sparse/KokkosSparse_spmv_struct_tuning.cpp(398): error: namespace "KokkosSparse" has no member "create_mirror"
00:42:14 
00:42:15 1 error detected in the compilation of "/home/jenkins/blake-new/workspace/KokkosKernels_Nightly_Blake_Cuda_11_8_0_Gcc_11_3_0_Hopper90-cusparse-cublas-uvm/kokkos-kernels/perf_test/sparse/KokkosSparse_spmv_struct_tuning.cpp".
00:42:15 make[2]: *** [perf_test/sparse/CMakeFiles/sparse_spmv_struct_tuning.dir/build.make:76: perf_test/sparse/CMakeFiles/sparse_spmv_struct_tuning.dir/KokkosSparse_spmv_struct_tuning.cpp.o] Error 1
00:42:15 make[1]: *** [CMakeFiles/Makefile2:2552: perf_test/sparse/CMakeFiles/sparse_spmv_struct_tuning.dir/all] Error 2

Reproducer (blake H100 queue):

salloc -N 1 -p H100

# Load module environment
source /projects/x86-64-icelake-rocky8/spack-config/blake-setup-user-module-env.sh
module purge
module load cmake gcc/11.3.0 cuda/11.8.0 git openblas/0.3.23

# Configuration
$KOKKOSKERNELS_PATH/cm_generate_makefile.bash --with-cuda --arch=HOPPER90 --compiler=$KOKKOS_PATH/bin/nvcc_wrapper --with-ordinals=int,int64_t --with-offsets=int,size_t -kokkos-path=$KOKKOS_PATH --with-tpls=cusparse,cublas --with-cuda-options=force_uvm --cmake-flags=-DKokkosKernels_INST_MEMSPACE_CUDAUVMSPACE=ON --deprecated-code

# Build
make -j16
@ndellingwood
Copy link
Contributor Author

ndellingwood commented Dec 11, 2024

The lines flagged by the compiler were due to namespace issues, when deprecated code is enabled the expected namespace was KokkosSparse::Kokkos::

A couple different options worked to resolve the issue:

  1. Dropping the namespace from the flagged lines resolved the issue,
diff --git a/perf_test/sparse/KokkosSparse_spmv_struct.cpp b/perf_test/sparse/KokkosSparse_spmv_struct.cpp
index 9b11ee973..f53d45c07 100644
--- a/perf_test/sparse/KokkosSparse_spmv_struct.cpp
+++ b/perf_test/sparse/KokkosSparse_spmv_struct.cpp
@@ -244,7 +244,7 @@ int main(int argc, char **argv) {
 
     if (check_errors) {
       h_y_compare                                                  = Kokkos::create_mirror(y);
-      typename matrix_type::StaticCrsGraphType::HostMirror h_graph = KokkosSparse::create_mirror(A.graph);
+      typename matrix_type::StaticCrsGraphType::HostMirror h_graph = create_mirror(A.graph);
       typename matrix_type::values_type::HostMirror h_values       = Kokkos::create_mirror_view(A.values);
 
       // Error Check Gold Values
diff --git a/perf_test/sparse/KokkosSparse_spmv_struct_tuning.cpp b/perf_test/sparse/KokkosSparse_spmv_struct_tuning.cpp
index 0dce5ffc8..865c4ec5e 100644
--- a/perf_test/sparse/KokkosSparse_spmv_struct_tuning.cpp
+++ b/perf_test/sparse/KokkosSparse_spmv_struct_tuning.cpp
@@ -395,7 +395,7 @@ int main(int argc, char** argv) {
 
     if (check_errors) {
       h_y_compare                                                  = Kokkos::create_mirror(y);
-      typename matrix_type::StaticCrsGraphType::HostMirror h_graph = KokkosSparse::create_mirror(A.graph);
+      typename matrix_type::StaticCrsGraphType::HostMirror h_graph = create_mirror(A.graph);
       typename matrix_type::values_type::HostMirror h_values       = Kokkos::create_mirror_view(A.values);
 
       // Error Check Gold Values
diff --git a/perf_test/sparse/KokkosSparse_spmv_test.cpp b/perf_test/sparse/KokkosSparse_spmv_test.cpp
index 3db04e0cf..7ddff743e 100644
--- a/perf_test/sparse/KokkosSparse_spmv_test.cpp
+++ b/perf_test/sparse/KokkosSparse_spmv_test.cpp
@@ -64,7 +64,7 @@ SPMVTestData setup_test(spmv_additional_data* data, SPMVTestData::matrix_type A,
   test_data.h_y         = Kokkos::create_mirror_view(y);
   test_data.h_y_compare = Kokkos::create_mirror(y);
 
-  h_graph_type h_graph   = KokkosSparse::create_mirror(test_data.A.graph);
+  h_graph_type h_graph   = create_mirror(test_data.A.graph);
   h_values_type h_values = Kokkos::create_mirror_view(test_data.A.values);
 
   for (int i = 0; i < test_data.numCols; i++) {
  1. Including the flagged routines in the KokkosSparse namespace when deprecated code is enabled,
diff --git a/sparse/src/KokkosSparse_StaticCrsGraph.hpp b/sparse/src/KokkosSparse_StaticCrsGraph.hpp
index c0174129c..d722039f4 100644
--- a/sparse/src/KokkosSparse_StaticCrsGraph.hpp
+++ b/sparse/src/KokkosSparse_StaticCrsGraph.hpp
@@ -30,6 +30,8 @@ using Kokkos::create_staticcrsgraph;
 using Kokkos::GraphRowViewConst;
 using Kokkos::maximum_entry;
 using Kokkos::StaticCrsGraph;
+using Kokkos::create_mirror;
+using Kokkos::create_mirror_view;
 }  // namespace KokkosSparse
 
 #else

As another alternative, we could drop the deprecated code region altogether like Brian suggested here

@lucbv do you have a preference?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant