From 2d1189b82b134cd5e319b0a6456ef723c2ac8de6 Mon Sep 17 00:00:00 2001 From: Chuck Hastings <45364586+ChuckHastings@users.noreply.github.com> Date: Fri, 8 Nov 2024 16:24:33 -0500 Subject: [PATCH] Remove CMake/C++ references to cugraph-ops (#4744) Delete deprecated cugraph-ops functionality, clean up references to cugraph-ops. Authors: - Chuck Hastings (https://github.com/ChuckHastings) Approvers: - James Lamb (https://github.com/jameslamb) - Bradley Dice (https://github.com/bdice) - Seunghwa Kang (https://github.com/seunghwak) - Rick Ratzel (https://github.com/rlratzel) URL: https://github.com/rapidsai/cugraph/pull/4744 --- build.sh | 11 +- cpp/CMakeLists.txt | 23 ---- cpp/cmake/thirdparty/get_libcugraphops.cmake | 83 ------------ cpp/include/cugraph/algorithms.hpp | 74 +---------- .../sample_and_compute_local_nbr_indices.cuh | 11 +- ...r_v_random_select_transform_outgoing_e.cuh | 6 - cpp/src/sampling/neighbor_sampling_impl.hpp | 7 - cpp/src/sampling/neighborhood.cu | 122 ------------------ cpp/tests/c_api/biased_neighbor_sample_test.c | 10 -- .../c_api/mg_biased_neighbor_sample_test.c | 20 --- .../c_api/mg_uniform_neighbor_sample_test.c | 20 --- .../c_api/uniform_neighbor_sample_test.c | 10 -- .../sampling/mg_uniform_neighbor_sampling.cpp | 22 ---- .../sampling/uniform_neighbor_sampling.cpp | 21 --- python/cugraph/CMakeLists.txt | 9 -- .../cugraph/tests/docs/test_doctests.py | 9 +- python/cugraph/pytest.ini | 1 - 17 files changed, 6 insertions(+), 453 deletions(-) delete mode 100644 cpp/cmake/thirdparty/get_libcugraphops.cmake delete mode 100644 cpp/src/sampling/neighborhood.cu diff --git a/build.sh b/build.sh index 24ce8c08e8d..29abd48166a 100755 --- a/build.sh +++ b/build.sh @@ -43,7 +43,6 @@ VALIDARGS=" --pydevelop --allgpuarch --skip_cpp_tests - --without_cugraphops --cmake_default_generator --clean -h @@ -74,7 +73,6 @@ HELP="$0 [ ...] [ ...] --pydevelop - install the Python packages in editable mode --allgpuarch - build for all supported GPU architectures --skip_cpp_tests - do not build the SG test binaries as part of the libcugraph and libcugraph_etl targets - --without_cugraphops - do not build algos that require cugraph-ops --cmake_default_generator - use the default cmake generator instead of ninja --clean - clean an individual target (note: to do a complete rebuild, use the clean target described above) -h - print this text @@ -107,7 +105,6 @@ BUILD_CPP_TESTS=ON BUILD_CPP_MG_TESTS=OFF BUILD_CPP_MTMG_TESTS=OFF BUILD_ALL_GPU_ARCH=0 -BUILD_WITH_CUGRAPHOPS=ON CMAKE_GENERATOR_OPTION="-G Ninja" PYTHON_ARGS_FOR_INSTALL="-m pip install --no-build-isolation --no-deps --config-settings rapidsai.disable-cuda=true" @@ -170,9 +167,6 @@ fi if hasArg --skip_cpp_tests; then BUILD_CPP_TESTS=OFF fi -if hasArg --without_cugraphops; then - BUILD_WITH_CUGRAPHOPS=OFF -fi if hasArg cpp-mtmgtests; then BUILD_CPP_MTMG_TESTS=ON fi @@ -268,7 +262,6 @@ if buildDefault || hasArg libcugraph || hasArg all; then -DBUILD_TESTS=${BUILD_CPP_TESTS} \ -DBUILD_CUGRAPH_MG_TESTS=${BUILD_CPP_MG_TESTS} \ -DBUILD_CUGRAPH_MTMG_TESTS=${BUILD_CPP_MTMG_TESTS} \ - -DUSE_CUGRAPH_OPS=${BUILD_WITH_CUGRAPHOPS} \ ${CMAKE_GENERATOR_OPTION} \ ${CMAKE_VERBOSE_OPTION} cmake --build "${LIBCUGRAPH_BUILD_DIR}" -j${PARALLEL_LEVEL} ${INSTALL_TARGET} ${VERBOSE_FLAG} @@ -312,7 +305,7 @@ if buildDefault || hasArg pylibcugraph || hasArg all; then if hasArg --clean; then cleanPythonDir ${REPODIR}/python/pylibcugraph else - SKBUILD_CMAKE_ARGS="${SKBUILD_EXTRA_CMAKE_ARGS};-DUSE_CUGRAPH_OPS=${BUILD_WITH_CUGRAPHOPS}" \ + SKBUILD_CMAKE_ARGS="${SKBUILD_EXTRA_CMAKE_ARGS}" \ python ${PYTHON_ARGS_FOR_INSTALL} ${REPODIR}/python/pylibcugraph fi fi @@ -322,7 +315,7 @@ if buildDefault || hasArg cugraph || hasArg all; then if hasArg --clean; then cleanPythonDir ${REPODIR}/python/cugraph else - SKBUILD_CMAKE_ARGS="${SKBUILD_EXTRA_CMAKE_ARGS};-DUSE_CUGRAPH_OPS=${BUILD_WITH_CUGRAPHOPS}" \ + SKBUILD_CMAKE_ARGS="${SKBUILD_EXTRA_CMAKE_ARGS}" \ python ${PYTHON_ARGS_FOR_INSTALL} ${REPODIR}/python/cugraph fi fi diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index fc3dbb57e1f..2cea2e504ab 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -54,17 +54,11 @@ option(BUILD_SHARED_LIBS "Build cuGraph shared libraries" ON) option(BUILD_CUGRAPH_MG_TESTS "Build cuGraph multigpu algorithm tests" OFF) option(CMAKE_CUDA_LINEINFO "Enable the -lineinfo option for nvcc (useful for cuda-memcheck / profiler" OFF) option(BUILD_TESTS "Configure CMake to build tests" ON) -option(USE_CUGRAPH_OPS "Enable all functions that call cugraph-ops" ON) option(USE_RAFT_STATIC "Build raft as a static library" OFF) option(CUGRAPH_COMPILE_RAFT_LIB "Compile the raft library instead of using it header-only" ON) option(CUDA_STATIC_RUNTIME "Statically link the CUDA toolkit runtime and libraries" OFF) -option(CUGRAPH_USE_CUGRAPH_OPS_STATIC "Build and statically link the cugraph-ops library" OFF) -option(CUGRAPH_EXCLUDE_CUGRAPH_OPS_FROM_ALL "Exclude cugraph-ops targets from cuGraph's 'all' target" OFF) -option(ALLOW_CLONE_CUGRAPH_OPS "Whether to attempt to clone cugraph-ops when a local version is not available" OFF) message(VERBOSE "CUGRAPH: CUDA_STATIC_RUNTIME=${CUDA_STATIC_RUNTIME}") -message(VERBOSE "CUGRAPH: CUGRAPH_USE_CUGRAPH_OPS_STATIC=${CUGRAPH_USE_CUGRAPH_OPS_STATIC}") -message(VERBOSE "CUGRAPH: CUGRAPH_EXCLUDE_CUGRAPH_OPS_FROM_ALL=${CUGRAPH_EXCLUDE_CUGRAPH_OPS_FROM_ALL}") ################################################################################ # - compiler options ----------------------------------------------------------- @@ -115,13 +109,6 @@ if(CMAKE_BUILD_TYPE MATCHES Debug) list(APPEND CUGRAPH_CUDA_FLAGS -G -Xcompiler=-rdynamic) endif() -if(NOT USE_CUGRAPH_OPS) - message(STATUS "Disabling functions that reference cugraph-ops") - list(APPEND CUGRAPH_C_FLAGS -DNO_CUGRAPH_OPS) - list(APPEND CUGRAPH_CXX_FLAGS -DNO_CUGRAPH_OPS) - list(APPEND CUGRAPH_CUDA_FLAGS -DNO_CUGRAPH_OPS) -endif() - ################################################################################################### # - find CPM based dependencies ------------------------------------------------------------------ @@ -151,10 +138,6 @@ include(${rapids-cmake-dir}/cpm/cuco.cmake) rapids_cpm_cuco(BUILD_EXPORT_SET cugraph-exports INSTALL_EXPORT_SET cugraph-exports) include(cmake/thirdparty/get_raft.cmake) -if(USE_CUGRAPH_OPS) - include(cmake/thirdparty/get_libcugraphops.cmake) -endif() - if(BUILD_TESTS) include(${rapids-cmake-dir}/cpm/gtest.cmake) rapids_cpm_gtest(BUILD_STATIC) @@ -438,12 +421,6 @@ set(CUGRAPH_SOURCES src/mtmg/vertex_pairs_result_mg_v64_e64.cu ) -if(USE_CUGRAPH_OPS) - list(APPEND CUGRAPH_SOURCES - src/sampling/neighborhood.cu - ) -endif() - add_library(cugraph ${CUGRAPH_SOURCES}) set_target_properties(cugraph diff --git a/cpp/cmake/thirdparty/get_libcugraphops.cmake b/cpp/cmake/thirdparty/get_libcugraphops.cmake deleted file mode 100644 index b10af300a98..00000000000 --- a/cpp/cmake/thirdparty/get_libcugraphops.cmake +++ /dev/null @@ -1,83 +0,0 @@ -#============================================================================= -# Copyright (c) 2022, NVIDIA CORPORATION. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#============================================================================= - -set(CUGRAPH_MIN_VERSION_cugraph_ops "${CUGRAPH_VERSION_MAJOR}.${CUGRAPH_VERSION_MINOR}.00") - -if(NOT DEFINED CUGRAPH_CUGRAPH_OPS_VERSION) - set(CUGRAPH_CUGRAPH_OPS_VERSION "${CUGRAPH_VERSION_MAJOR}.${CUGRAPH_VERSION_MINOR}") -endif() - -if(NOT DEFINED CUGRAPH_CUGRAPH_OPS_BRANCH) - set(CUGRAPH_CUGRAPH_OPS_BRANCH "branch-${CUGRAPH_CUGRAPH_OPS_VERSION}") -endif() - -if(NOT DEFINED CUGRAPH_CUGRAPH_OPS_REPOSITORY) - set(CUGRAPH_CUGRAPH_OPS_REPOSITORY "git@github.com:rapidsai/cugraph-ops.git") -endif() - -function(find_and_configure_cugraph_ops) - - set(oneValueArgs VERSION REPO PINNED_TAG BUILD_STATIC EXCLUDE_FROM_ALL ALLOW_CLONE_CUGRAPH_OPS) - cmake_parse_arguments(PKG "" "${oneValueArgs}" "" ${ARGN}) - - if(PKG_ALLOW_CLONE_CUGRAPH_OPS) - if(NOT PKG_PINNED_TAG STREQUAL "branch-${CUGRAPH_CUGRAPH_OPS_VERSION}") - message("Pinned tag found: ${PKG_PINNED_TAG}. Cloning cugraph-ops locally.") - set(CPM_DOWNLOAD_cugraph-ops ON) - elseif(PKG_BUILD_STATIC AND (NOT CPM_cugraph-ops_SOURCE)) - message(STATUS "CUGRAPH: Cloning cugraph-ops locally to build static libraries.") - set(CPM_DOWNLOAD_cugraph-ops ON) - endif() - endif() - - set(CUGRAPH_OPS_BUILD_SHARED_LIBS ON) - if(PKG_BUILD_STATIC) - set(CUGRAPH_OPS_BUILD_SHARED_LIBS OFF) - endif() - - rapids_cpm_find(cugraph-ops ${PKG_VERSION} REQUIRED - GLOBAL_TARGETS cugraph-ops::cugraph-ops++ - BUILD_EXPORT_SET cugraph-exports - INSTALL_EXPORT_SET cugraph-exports - CPM_ARGS - SOURCE_SUBDIR cpp - GIT_REPOSITORY ${PKG_REPO} - GIT_TAG ${PKG_PINNED_TAG} - EXCLUDE_FROM_ALL ${PKG_EXCLUDE_FROM_ALL} - OPTIONS - "BUILD_CUGRAPH_OPS_CPP_TESTS OFF" - "BUILD_SHARED_LIBS ${CUGRAPH_OPS_BUILD_SHARED_LIBS}" - ) -endfunction() - -### -# Change pinned tag and fork here to test a commit in CI -# -# To use a locally-built cugraph-ops package, set the CMake variable -# `-D cugraph-ops_ROOT=/path/to/cugraph-ops/build` -### -find_and_configure_cugraph_ops(VERSION ${CUGRAPH_MIN_VERSION_cugraph_ops} - REPO ${CUGRAPH_CUGRAPH_OPS_REPOSITORY} - PINNED_TAG ${CUGRAPH_CUGRAPH_OPS_BRANCH} - BUILD_STATIC ${CUGRAPH_USE_CUGRAPH_OPS_STATIC} - EXCLUDE_FROM_ALL ${CUGRAPH_EXCLUDE_CUGRAPH_OPS_FROM_ALL} - # Allow cloning cugraph-ops in cases when we - # expect the local copy of cugraph-ops to not be - # the one that we want. Cases include static - # linking such that we need to compile a static - # lib or during development when using a - # different branch of cugraph-ops. - ALLOW_CLONE_CUGRAPH_OPS ${ALLOW_CLONE_CUGRAPH_OPS}) diff --git a/cpp/include/cugraph/algorithms.hpp b/cpp/include/cugraph/algorithms.hpp index 7e5af4ac686..60f4d21822f 100644 --- a/cpp/include/cugraph/algorithms.hpp +++ b/cpp/include/cugraph/algorithms.hpp @@ -23,16 +23,12 @@ #include #include -#include - -#ifndef NO_CUGRAPH_OPS -#include -#endif - #include #include #include +#include + #include #include @@ -1678,72 +1674,6 @@ node2vec_random_walks(raft::handle_t const& handle, weight_t p, weight_t q); -#ifndef NO_CUGRAPH_OPS -/** - * @brief generate sub-sampled graph as an adjacency list (CSR format) given input graph, - * list of vertices and sample size per vertex. The output graph consists of the given - * vertices with each vertex having at most `sample_size` neighbors from the original graph - * - * @deprecated This API will be deprecated. uniform_neighbor_sample can be used instead. - * - * @tparam graph_t Type of input graph/view (typically, graph_view_t, non-transposed and - * single-gpu). - * @param handle RAFT handle object to encapsulate resources (e.g. CUDA stream, communicator, and - * handles to various CUDA libraries) to run graph algorithms. - * @param rng_state The RngState instance holding pseudo-random number generator state. - * @param graph Graph (view )object to sub-sample. - * @param ptr_d_start Device pointer to set of starting vertex indices for the sub-sampling. - * @param num_start_vertices = number(vertices) to use for sub-sampling. - * @param sampling_size = max number of neighbors per output vertex. - * @param sampling_algo = the sampling algorithm (algo R/algo L/etc.) used to produce outputs. - * @return std::tuple, - * rmm::device_uvector> - * Tuple consisting of two arrays representing the offsets and indices of - * the sub-sampled graph. - */ -template -std::tuple, rmm::device_uvector> -sample_neighbors_adjacency_list(raft::handle_t const& handle, - raft::random::RngState& rng_state, - graph_view_t const& graph_view, - vertex_t const* ptr_d_start, - size_t num_start_vertices, - size_t sampling_size, - ops::graph::SamplingAlgoT sampling_algo); - -/** - * @brief generate sub-sampled graph as an edge list (COO format) given input graph, - * list of vertices and sample size per vertex. The output graph consists of the given - * vertices with each vertex having at most `sample_size` neighbors from the original graph - * - * @deprecated This API will be deprecated. uniform_neighbor_sample can be used instead. - * - * @tparam graph_t Type of input graph/view (typically, graph_view_t, non-transposed and - * single-gpu). - * @param handle RAFT handle object to encapsulate resources (e.g. CUDA stream, communicator, and - * handles to various CUDA libraries) to run graph algorithms. - * @param rng_state The RngState instance holding pseudo-random number generator state. - * @param graph Graph (view )object to sub-sample. - * @param ptr_d_start Device pointer to set of starting vertex indices for the sub-sampling. - * @param num_start_vertices = number(vertices) to use for sub-sampling. - * @param sampling_size = max number of neighbors per output vertex. - * @param sampling_algo = the sampling algorithm (algo R/algo L/etc.) used to produce outputs. - * @return std::tuple, - * rmm::device_uvector> - * Tuple consisting of two arrays representing the source and destination nodes of - * the sub-sampled graph. - */ -template -std::tuple, rmm::device_uvector> sample_neighbors_edgelist( - raft::handle_t const& handle, - raft::random::RngState& rng_state, - graph_view_t const& graph_view, - vertex_t const* ptr_d_start, - size_t num_start_vertices, - size_t sampling_size, - ops::graph::SamplingAlgoT sampling_algo); -#endif - /** * @brief Finds (weakly-connected-)component IDs of each vertices in the input graph. * diff --git a/cpp/src/prims/detail/sample_and_compute_local_nbr_indices.cuh b/cpp/src/prims/detail/sample_and_compute_local_nbr_indices.cuh index a6a164d36c1..5ebc3dc8aea 100644 --- a/cpp/src/prims/detail/sample_and_compute_local_nbr_indices.cuh +++ b/cpp/src/prims/detail/sample_and_compute_local_nbr_indices.cuh @@ -597,7 +597,6 @@ rmm::device_uvector compute_uniform_sampling_index_without_replacement( raft::random::RngState& rng_state, size_t K) { -#ifndef NO_CUGRAPH_OPS assert(cugraph::invalid_edge_id_v == cugraph::ops::graph::INVALID_ID); edge_t mid_partition_degree_range_last = static_cast(K * 10); // tuning parameter @@ -978,9 +977,6 @@ rmm::device_uvector compute_uniform_sampling_index_without_replacement( frontier_degrees.shrink_to_fit(handle.get_stream()); return nbr_indices; -#else - CUGRAPH_FAIL("unimplemented."); -#endif } template @@ -1572,7 +1568,7 @@ uniform_sample_and_compute_local_nbr_indices( bool with_replacement) { using edge_t = typename GraphViewType::edge_type; -#ifndef NO_CUGRAPH_OPS + assert(cugraph::invalid_edge_id_v == cugraph::ops::graph::INVALID_ID); using vertex_t = typename GraphViewType::vertex_type; @@ -1673,11 +1669,6 @@ uniform_sample_and_compute_local_nbr_indices( return std::make_tuple( std::move(local_nbr_indices), std::move(key_indices), std::move(local_frontier_sample_offsets)); -#else - CUGRAPH_FAIL("unimplemented."); - return std::make_tuple( - rmm::device_uvector(0, handle.get_stream()), std::nullopt, std::vector()); -#endif } template invalid_value, bool do_expensive_check) { -#ifndef NO_CUGRAPH_OPS using vertex_t = typename GraphViewType::vertex_type; using edge_t = typename GraphViewType::edge_type; using key_t = typename VertexFrontierBucketType::key_type; @@ -590,11 +589,6 @@ per_v_random_select_transform_e(raft::handle_t const& handle, } return std::make_tuple(std::move(sample_offsets), std::move(sample_e_op_results)); -#else - CUGRAPH_FAIL("unimplemented."); - return std::make_tuple(std::nullopt, - allocate_dataframe_buffer(size_t{0}, rmm::cuda_stream_view{})); -#endif } } // namespace detail diff --git a/cpp/src/sampling/neighbor_sampling_impl.hpp b/cpp/src/sampling/neighbor_sampling_impl.hpp index 1785f934426..d8e8cc2b756 100644 --- a/cpp/src/sampling/neighbor_sampling_impl.hpp +++ b/cpp/src/sampling/neighbor_sampling_impl.hpp @@ -67,12 +67,6 @@ neighbor_sample_impl( raft::random::RngState& rng_state, bool do_expensive_check) { -#ifdef NO_CUGRAPH_OPS // FIXME: this is relevant only when edge_bias_view.has_value() is false, - // this ifdef statement will be removed once we migrate relevant cugraph-ops - // functions to cugraph - CUGRAPH_FAIL( - "neighbor_sample_impl not supported in this configuration, built with NO_CUGRAPH_OPS"); -#else static_assert(std::is_floating_point_v); CUGRAPH_EXPECTS(fan_out.size() > 0, "Invalid input argument: number of levels must be non-zero."); @@ -336,7 +330,6 @@ neighbor_sample_impl( std::move(result_hops), std::move(result_labels), label_to_output_comm_rank); -#endif } } // namespace detail diff --git a/cpp/src/sampling/neighborhood.cu b/cpp/src/sampling/neighborhood.cu deleted file mode 100644 index e75b08136ea..00000000000 --- a/cpp/src/sampling/neighborhood.cu +++ /dev/null @@ -1,122 +0,0 @@ -/* - * Copyright (c) 2021-2024, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "utilities/cugraph_ops_utils.hpp" - -#include -#include - -#include - -#include - -namespace cugraph { - -template -std::tuple, rmm::device_uvector> -sample_neighbors_adjacency_list(raft::handle_t const& handle, - raft::random::RngState& rng_state, - graph_view_t const& graph_view, - vertex_t const* ptr_d_start, - size_t num_start_vertices, - size_t sampling_size, - ops::graph::SamplingAlgoT sampling_algo) -{ - using base_vertex_t = std::decay_t; - using base_edge_t = std::decay_t; - static_assert(std::is_same_v, - "cugraph-ops sampling not yet implemented for different node and edge types"); - - const auto ops_graph = detail::get_graph(graph_view); - return ops::graph::uniform_sample_csc(rng_state, - ops_graph, - ptr_d_start, - num_start_vertices, - sampling_size, - sampling_algo, - ops_graph.dst_max_in_degree, - handle.get_stream()); -} - -template -std::tuple, rmm::device_uvector> sample_neighbors_edgelist( - raft::handle_t const& handle, - raft::random::RngState& rng_state, - graph_view_t const& graph_view, - vertex_t const* ptr_d_start, - size_t num_start_vertices, - size_t sampling_size, - ops::graph::SamplingAlgoT sampling_algo) -{ - using base_vertex_t = std::decay_t; - using base_edge_t = std::decay_t; - static_assert(std::is_same_v, - "cugraph-ops sampling not yet implemented for different node and edge types"); - - const auto ops_graph = detail::get_graph(graph_view); - return ops::graph::uniform_sample_coo(rng_state, - ops_graph, - ptr_d_start, - num_start_vertices, - sampling_size, - sampling_algo, - ops_graph.dst_max_in_degree, - handle.get_stream()); -} - -// template explicit instantiation directives (EIDir's): -// -// CSR SG FP32{ -template std::tuple, rmm::device_uvector> -sample_neighbors_adjacency_list(raft::handle_t const& handle, - raft::random::RngState& rng_state, - graph_view_t const& gview, - int32_t const* ptr_d_start, - size_t num_start_vertices, - size_t sampling_size, - ops::graph::SamplingAlgoT sampling_algo); - -template std::tuple, rmm::device_uvector> -sample_neighbors_adjacency_list(raft::handle_t const& handle, - raft::random::RngState& rng_state, - graph_view_t const& gview, - int64_t const* ptr_d_start, - size_t num_start_vertices, - size_t sampling_size, - ops::graph::SamplingAlgoT sampling_algo); -//} -// -// COO SG FP32{ -template std::tuple, rmm::device_uvector> -sample_neighbors_edgelist(raft::handle_t const& handle, - raft::random::RngState& rng_state, - graph_view_t const& gview, - int32_t const* ptr_d_start, - size_t num_start_vertices, - size_t sampling_size, - ops::graph::SamplingAlgoT sampling_algo); - -template std::tuple, rmm::device_uvector> -sample_neighbors_edgelist(raft::handle_t const& handle, - raft::random::RngState& rng_state, - graph_view_t const& gview, - int64_t const* ptr_d_start, - size_t num_start_vertices, - size_t sampling_size, - ops::graph::SamplingAlgoT sampling_algo); -//} - -} // namespace cugraph diff --git a/cpp/tests/c_api/biased_neighbor_sample_test.c b/cpp/tests/c_api/biased_neighbor_sample_test.c index 6f0af3a8e0d..e0c9945e091 100644 --- a/cpp/tests/c_api/biased_neighbor_sample_test.c +++ b/cpp/tests/c_api/biased_neighbor_sample_test.c @@ -149,10 +149,6 @@ int generic_biased_neighbor_sample_test(const cugraph_resource_handle_t* handle, &result, &ret_error); -#ifdef NO_CUGRAPH_OPS - TEST_ASSERT( - test_ret_value, ret_code != CUGRAPH_SUCCESS, "biased_neighbor_sample should have failed") -#else TEST_ASSERT(test_ret_value, ret_code == CUGRAPH_SUCCESS, cugraph_error_message(ret_error)); TEST_ASSERT(test_ret_value, ret_code == CUGRAPH_SUCCESS, "biased_neighbor_sample failed."); @@ -459,7 +455,6 @@ int generic_biased_neighbor_sample_test(const cugraph_resource_handle_t* handle, } cugraph_sample_result_free(result); -#endif cugraph_graph_free(graph); cugraph_error_free(ret_error); @@ -584,10 +579,6 @@ int test_biased_neighbor_sample_with_labels(const cugraph_resource_handle_t* han &result, &ret_error); -#ifdef NO_CUGRAPH_OPS - TEST_ASSERT( - test_ret_value, ret_code != CUGRAPH_SUCCESS, "biased_neighbor_sample should have failed") -#else TEST_ASSERT(test_ret_value, ret_code == CUGRAPH_SUCCESS, cugraph_error_message(ret_error)); TEST_ASSERT(test_ret_value, ret_code == CUGRAPH_SUCCESS, "biased_neighbor_sample failed."); @@ -678,7 +669,6 @@ int test_biased_neighbor_sample_with_labels(const cugraph_resource_handle_t* han cugraph_sample_result_free(result); cugraph_sampling_options_free(sampling_options); -#endif cugraph_graph_free(graph); cugraph_error_free(ret_error); diff --git a/cpp/tests/c_api/mg_biased_neighbor_sample_test.c b/cpp/tests/c_api/mg_biased_neighbor_sample_test.c index f7103d1e39d..ba06ffb254d 100644 --- a/cpp/tests/c_api/mg_biased_neighbor_sample_test.c +++ b/cpp/tests/c_api/mg_biased_neighbor_sample_test.c @@ -142,10 +142,6 @@ int generic_biased_neighbor_sample_test(const cugraph_resource_handle_t* handle, &result, &ret_error); -#ifdef NO_CUGRAPH_OPS - TEST_ASSERT( - test_ret_value, ret_code != CUGRAPH_SUCCESS, "biased_neighbor_sample should have failed") -#else TEST_ASSERT(test_ret_value, ret_code == CUGRAPH_SUCCESS, cugraph_error_message(ret_error)); TEST_ASSERT(test_ret_value, ret_code == CUGRAPH_SUCCESS, "biased_neighbor_sample failed."); @@ -430,7 +426,6 @@ int generic_biased_neighbor_sample_test(const cugraph_resource_handle_t* handle, } cugraph_sample_result_free(result); -#endif cugraph_graph_free(graph); cugraph_error_free(ret_error); @@ -576,10 +571,6 @@ int test_biased_neighbor_from_alex(const cugraph_resource_handle_t* handle) &result, &ret_error); -#ifdef NO_CUGRAPH_OPS - TEST_ASSERT( - test_ret_value, ret_code != CUGRAPH_SUCCESS, "biased_neighbor_sample should have failed"); -#else TEST_ASSERT(test_ret_value, ret_code == CUGRAPH_SUCCESS, cugraph_error_message(ret_error)); TEST_ASSERT(test_ret_value, ret_code == CUGRAPH_SUCCESS, "biased_neighbor_sample failed."); @@ -673,7 +664,6 @@ int test_biased_neighbor_from_alex(const cugraph_resource_handle_t* handle) M[h_srcs[i]][h_dsts[i]] >= 0, "biased_neighbor_sample got edge that doesn't exist"); } -#endif cugraph_sample_result_free(result); @@ -854,10 +844,6 @@ int test_biased_neighbor_sample_alex_bug(const cugraph_resource_handle_t* handle &result, &ret_error); -#ifdef NO_CUGRAPH_OPS - TEST_ASSERT( - test_ret_value, ret_code != CUGRAPH_SUCCESS, "biased_neighbor_sample should have failed") -#else TEST_ASSERT(test_ret_value, ret_code == CUGRAPH_SUCCESS, cugraph_error_message(ret_error)); TEST_ASSERT(test_ret_value, ret_code == CUGRAPH_SUCCESS, "biased_neighbor_sample failed."); @@ -939,7 +925,6 @@ int test_biased_neighbor_sample_alex_bug(const cugraph_resource_handle_t* handle test_ret_value, result_offsets_size == expected_size[rank], "incorrect number of results"); cugraph_sample_result_free(result); -#endif cugraph_graph_free(graph); cugraph_error_free(ret_error); @@ -1114,10 +1099,6 @@ int test_biased_neighbor_sample_sort_by_hop(const cugraph_resource_handle_t* han &result, &ret_error); -#ifdef NO_CUGRAPH_OPS - TEST_ASSERT( - test_ret_value, ret_code != CUGRAPH_SUCCESS, "biased_neighbor_sample should have failed") -#else TEST_ASSERT(test_ret_value, ret_code == CUGRAPH_SUCCESS, cugraph_error_message(ret_error)); TEST_ASSERT(test_ret_value, ret_code == CUGRAPH_SUCCESS, "biased_neighbor_sample failed."); @@ -1219,7 +1200,6 @@ int test_biased_neighbor_sample_sort_by_hop(const cugraph_resource_handle_t* han } cugraph_sample_result_free(result); -#endif cugraph_graph_free(graph); cugraph_error_free(ret_error); diff --git a/cpp/tests/c_api/mg_uniform_neighbor_sample_test.c b/cpp/tests/c_api/mg_uniform_neighbor_sample_test.c index f9388a2e565..7322b7379d3 100644 --- a/cpp/tests/c_api/mg_uniform_neighbor_sample_test.c +++ b/cpp/tests/c_api/mg_uniform_neighbor_sample_test.c @@ -141,10 +141,6 @@ int generic_uniform_neighbor_sample_test(const cugraph_resource_handle_t* handle &result, &ret_error); -#ifdef NO_CUGRAPH_OPS - TEST_ASSERT( - test_ret_value, ret_code != CUGRAPH_SUCCESS, "uniform_neighbor_sample should have failed") -#else TEST_ASSERT(test_ret_value, ret_code == CUGRAPH_SUCCESS, cugraph_error_message(ret_error)); TEST_ASSERT(test_ret_value, ret_code == CUGRAPH_SUCCESS, "uniform_neighbor_sample failed."); @@ -429,7 +425,6 @@ int generic_uniform_neighbor_sample_test(const cugraph_resource_handle_t* handle } cugraph_sample_result_free(result); -#endif cugraph_graph_free(graph); cugraph_error_free(ret_error); @@ -574,10 +569,6 @@ int test_uniform_neighbor_from_alex(const cugraph_resource_handle_t* handle) &result, &ret_error); -#ifdef NO_CUGRAPH_OPS - TEST_ASSERT( - test_ret_value, ret_code != CUGRAPH_SUCCESS, "uniform_neighbor_sample should have failed"); -#else TEST_ASSERT(test_ret_value, ret_code == CUGRAPH_SUCCESS, cugraph_error_message(ret_error)); TEST_ASSERT(test_ret_value, ret_code == CUGRAPH_SUCCESS, "uniform_neighbor_sample failed."); @@ -671,7 +662,6 @@ int test_uniform_neighbor_from_alex(const cugraph_resource_handle_t* handle) M[h_srcs[i]][h_dsts[i]] >= 0, "uniform_neighbor_sample got edge that doesn't exist"); } -#endif cugraph_sample_result_free(result); @@ -851,10 +841,6 @@ int test_uniform_neighbor_sample_alex_bug(const cugraph_resource_handle_t* handl &result, &ret_error); -#ifdef NO_CUGRAPH_OPS - TEST_ASSERT( - test_ret_value, ret_code != CUGRAPH_SUCCESS, "uniform_neighbor_sample should have failed") -#else TEST_ASSERT(test_ret_value, ret_code == CUGRAPH_SUCCESS, cugraph_error_message(ret_error)); TEST_ASSERT(test_ret_value, ret_code == CUGRAPH_SUCCESS, "uniform_neighbor_sample failed."); @@ -936,7 +922,6 @@ int test_uniform_neighbor_sample_alex_bug(const cugraph_resource_handle_t* handl test_ret_value, result_offsets_size == expected_size[rank], "incorrect number of results"); cugraph_sample_result_free(result); -#endif cugraph_graph_free(graph); cugraph_error_free(ret_error); @@ -1110,10 +1095,6 @@ int test_uniform_neighbor_sample_sort_by_hop(const cugraph_resource_handle_t* ha &result, &ret_error); -#ifdef NO_CUGRAPH_OPS - TEST_ASSERT( - test_ret_value, ret_code != CUGRAPH_SUCCESS, "uniform_neighbor_sample should have failed") -#else TEST_ASSERT(test_ret_value, ret_code == CUGRAPH_SUCCESS, cugraph_error_message(ret_error)); TEST_ASSERT(test_ret_value, ret_code == CUGRAPH_SUCCESS, "uniform_neighbor_sample failed."); @@ -1215,7 +1196,6 @@ int test_uniform_neighbor_sample_sort_by_hop(const cugraph_resource_handle_t* ha } cugraph_sample_result_free(result); -#endif cugraph_graph_free(graph); cugraph_error_free(ret_error); diff --git a/cpp/tests/c_api/uniform_neighbor_sample_test.c b/cpp/tests/c_api/uniform_neighbor_sample_test.c index 931d1fbfe07..d37c8b9ffdc 100644 --- a/cpp/tests/c_api/uniform_neighbor_sample_test.c +++ b/cpp/tests/c_api/uniform_neighbor_sample_test.c @@ -148,10 +148,6 @@ int generic_uniform_neighbor_sample_test(const cugraph_resource_handle_t* handle &result, &ret_error); -#ifdef NO_CUGRAPH_OPS - TEST_ASSERT( - test_ret_value, ret_code != CUGRAPH_SUCCESS, "uniform_neighbor_sample should have failed") -#else TEST_ASSERT(test_ret_value, ret_code == CUGRAPH_SUCCESS, cugraph_error_message(ret_error)); TEST_ASSERT(test_ret_value, ret_code == CUGRAPH_SUCCESS, "uniform_neighbor_sample failed."); @@ -458,7 +454,6 @@ int generic_uniform_neighbor_sample_test(const cugraph_resource_handle_t* handle } cugraph_sample_result_free(result); -#endif cugraph_graph_free(graph); cugraph_error_free(ret_error); @@ -674,10 +669,6 @@ int test_uniform_neighbor_sample_with_labels(const cugraph_resource_handle_t* ha &result, &ret_error); -#ifdef NO_CUGRAPH_OPS - TEST_ASSERT( - test_ret_value, ret_code != CUGRAPH_SUCCESS, "uniform_neighbor_sample should have failed") -#else TEST_ASSERT(test_ret_value, ret_code == CUGRAPH_SUCCESS, cugraph_error_message(ret_error)); TEST_ASSERT(test_ret_value, ret_code == CUGRAPH_SUCCESS, "uniform_neighbor_sample failed."); @@ -768,7 +759,6 @@ int test_uniform_neighbor_sample_with_labels(const cugraph_resource_handle_t* ha cugraph_sample_result_free(result); cugraph_sampling_options_free(sampling_options); -#endif cugraph_graph_free(graph); cugraph_error_free(ret_error); diff --git a/cpp/tests/sampling/mg_uniform_neighbor_sampling.cpp b/cpp/tests/sampling/mg_uniform_neighbor_sampling.cpp index 0dd63e4fb06..dc9043e0c02 100644 --- a/cpp/tests/sampling/mg_uniform_neighbor_sampling.cpp +++ b/cpp/tests/sampling/mg_uniform_neighbor_sampling.cpp @@ -155,27 +155,6 @@ class Tests_MGUniform_Neighbor_Sampling random_sources.size(), handle_->get_stream()); -#ifdef NO_CUGRAPH_OPS - EXPECT_THROW( - cugraph::uniform_neighbor_sample( - *handle_, - mg_graph_view, - mg_edge_weight_view, - std::optional>{std::nullopt}, - std::optional>{std::nullopt}, - raft::device_span{random_sources_copy.data(), random_sources.size()}, - std::make_optional( - raft::device_span{batch_number.data(), batch_number.size()}), - std::make_optional(std::make_tuple( - raft::device_span{unique_batches.data(), unique_batches.size()}, - raft::device_span{comm_ranks.data(), comm_ranks.size()})), - raft::host_span(uniform_neighbor_sampling_usecase.fanout.data(), - uniform_neighbor_sampling_usecase.fanout.size()), - rng_state, - true, - uniform_neighbor_sampling_usecase.with_replacement), - std::exception); -#else if (cugraph::test::g_perf) { RAFT_CUDA_TRY(cudaDeviceSynchronize()); // for consistent performance measurement handle_->get_comms().barrier(); @@ -291,7 +270,6 @@ class Tests_MGUniform_Neighbor_Sampling } } } -#endif } private: diff --git a/cpp/tests/sampling/uniform_neighbor_sampling.cpp b/cpp/tests/sampling/uniform_neighbor_sampling.cpp index 87524b03acf..db4123d2476 100644 --- a/cpp/tests/sampling/uniform_neighbor_sampling.cpp +++ b/cpp/tests/sampling/uniform_neighbor_sampling.cpp @@ -131,26 +131,6 @@ class Tests_Uniform_Neighbor_Sampling std::optional, raft::device_span>> label_to_output_comm_rank_mapping{std::nullopt}; -#ifdef NO_CUGRAPH_OPS - EXPECT_THROW( - cugraph::uniform_neighbor_sample( - handle, - graph_view, - edge_weight_view, - std::optional>{std::nullopt}, - std::optional>{std::nullopt}, - raft::device_span{random_sources_copy.data(), random_sources.size()}, - batch_number ? std::make_optional(raft::device_span{batch_number->data(), - batch_number->size()}) - : std::nullopt, - label_to_output_comm_rank_mapping, - raft::host_span(uniform_neighbor_sampling_usecase.fanout.data(), - uniform_neighbor_sampling_usecase.fanout.size()), - rng_state, - true, - uniform_neighbor_sampling_usecase.flag_replacement), - std::exception); -#else if (cugraph::test::g_perf) { RAFT_CUDA_TRY(cudaDeviceSynchronize()); // for consistent performance measurement hr_timer.start("Uniform neighbor sampling"); @@ -224,7 +204,6 @@ class Tests_Uniform_Neighbor_Sampling uniform_neighbor_sampling_usecase.fanout.size())); } } -#endif } }; diff --git a/python/cugraph/CMakeLists.txt b/python/cugraph/CMakeLists.txt index ca38b5551c9..117f7cf5142 100644 --- a/python/cugraph/CMakeLists.txt +++ b/python/cugraph/CMakeLists.txt @@ -32,13 +32,8 @@ project( option(FIND_CUGRAPH_CPP "Search for existing CUGRAPH C++ installations before defaulting to local files" OFF ) -option(USE_CUGRAPH_OPS "Enable all functions that call cugraph-ops" ON) option(USE_CUDA_MATH_WHEELS "Use the CUDA math wheels instead of the system libraries" OFF) -if(NOT USE_CUGRAPH_OPS) - message(STATUS "Disabling libcugraph functions that reference cugraph-ops") - add_compile_definitions(NO_CUGRAPH_OPS) -endif() # If the user requested it, we attempt to find CUGRAPH. if(FIND_CUGRAPH_CPP) @@ -54,14 +49,10 @@ if(NOT cugraph_FOUND) set(BUILD_TESTS OFF) set(BUILD_CUGRAPH_MG_TESTS OFF) - set(BUILD_CUGRAPH_OPS_CPP_TESTS OFF) set(CUDA_STATIC_RUNTIME ON) set(CUDA_STATIC_MATH_LIBRARIES ON) set(USE_RAFT_STATIC ON) set(CUGRAPH_COMPILE_RAFT_LIB ON) - set(CUGRAPH_USE_CUGRAPH_OPS_STATIC ON) - set(CUGRAPH_EXCLUDE_CUGRAPH_OPS_FROM_ALL ON) - set(ALLOW_CLONE_CUGRAPH_OPS ON) if(CUDAToolkit_VERSION VERSION_GREATER_EQUAL 12.0) set(CUDA_STATIC_MATH_LIBRARIES OFF) diff --git a/python/cugraph/cugraph/tests/docs/test_doctests.py b/python/cugraph/cugraph/tests/docs/test_doctests.py index 44ab16410ca..2095fd41fe9 100644 --- a/python/cugraph/cugraph/tests/docs/test_doctests.py +++ b/python/cugraph/cugraph/tests/docs/test_doctests.py @@ -1,4 +1,4 @@ -# Copyright (c) 2022-2023, NVIDIA CORPORATION. +# Copyright (c) 2022-2024, NVIDIA CORPORATION. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at @@ -186,11 +186,4 @@ def test_docstring(self, docstring): f"{docstring.name}:\n{doctest_stdout.getvalue()}" ) except AssertionError: - # If some failed but all the failures were due to lack of - # cugraph-ops support, we can skip. - out = doctest_stdout.getvalue() - if ("CUGRAPH_UNKNOWN_ERROR" in out and "unimplemented" in out) or ( - "built with NO_CUGRAPH_OPS" in out - ): - pytest.skip("Doctest requires cugraph-ops support.") raise diff --git a/python/cugraph/pytest.ini b/python/cugraph/pytest.ini index 2f01a0cc51b..5cbc4631664 100644 --- a/python/cugraph/pytest.ini +++ b/python/cugraph/pytest.ini @@ -41,7 +41,6 @@ markers = nx_types: use NetworkX input types matrix_types: use SciPy/CuPy matrix input types slow: slow-running tests/benchmarks - cugraph_ops: Tests requiring cugraph-ops mg: Test MG code paths - number of gpu > 1 sg: Test SG code paths and dask sg tests - number of gpu == 1 ci: Tests that should be run in ci