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

Remove CMake/C++ references to cugraph-ops #4744

Open
wants to merge 4 commits into
base: branch-24.12
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 2 additions & 9 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ VALIDARGS="
--pydevelop
--allgpuarch
--skip_cpp_tests
--without_cugraphops
--cmake_default_generator
--clean
-h
Expand Down Expand Up @@ -74,7 +73,6 @@ HELP="$0 [<target> ...] [<flag> ...]
--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
Expand Down Expand Up @@ -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"

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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}
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
23 changes: 0 additions & 23 deletions cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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 -----------------------------------------------------------
Expand Down Expand Up @@ -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 ------------------------------------------------------------------

Expand Down Expand Up @@ -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)
jameslamb marked this conversation as resolved.
Show resolved Hide resolved
endif()

if(BUILD_TESTS)
include(${rapids-cmake-dir}/cpm/gtest.cmake)
rapids_cpm_gtest(BUILD_STATIC)
Expand Down Expand Up @@ -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
Expand Down
83 changes: 0 additions & 83 deletions cpp/cmake/thirdparty/get_libcugraphops.cmake

This file was deleted.

74 changes: 2 additions & 72 deletions cpp/include/cugraph/algorithms.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,12 @@
#include <cugraph/legacy/graph.hpp>
#include <cugraph/legacy/internals.hpp>

#include <rmm/resource_ref.hpp>

#ifndef NO_CUGRAPH_OPS
#include <cugraph-ops/graph/sampling.hpp>
#endif

#include <raft/core/device_span.hpp>
#include <raft/core/handle.hpp>
#include <raft/random/rng_state.hpp>

#include <rmm/resource_ref.hpp>

#include <optional>
#include <tuple>

Expand Down Expand Up @@ -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<typename graph_t::edge_type>,
* rmm::device_uvector<typename graph_t::vertex_type>>
* Tuple consisting of two arrays representing the offsets and indices of
* the sub-sampled graph.
*/
template <typename vertex_t, typename edge_t>
std::tuple<rmm::device_uvector<edge_t>, rmm::device_uvector<vertex_t>>
sample_neighbors_adjacency_list(raft::handle_t const& handle,
raft::random::RngState& rng_state,
graph_view_t<vertex_t, edge_t, false, false> 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<typename graph_t::edge_type>,
* rmm::device_uvector<typename graph_t::vertex_type>>
* Tuple consisting of two arrays representing the source and destination nodes of
* the sub-sampled graph.
*/
template <typename vertex_t, typename edge_t>
std::tuple<rmm::device_uvector<vertex_t>, rmm::device_uvector<vertex_t>> sample_neighbors_edgelist(
raft::handle_t const& handle,
raft::random::RngState& rng_state,
graph_view_t<vertex_t, edge_t, false, false> 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.
*
Expand Down
11 changes: 1 addition & 10 deletions cpp/src/prims/detail/sample_and_compute_local_nbr_indices.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,6 @@ rmm::device_uvector<edge_t> compute_uniform_sampling_index_without_replacement(
raft::random::RngState& rng_state,
size_t K)
{
#ifndef NO_CUGRAPH_OPS
assert(cugraph::invalid_edge_id_v<edge_t> == cugraph::ops::graph::INVALID_ID<edge_t>);

edge_t mid_partition_degree_range_last = static_cast<edge_t>(K * 10); // tuning parameter
Expand Down Expand Up @@ -978,9 +977,6 @@ rmm::device_uvector<edge_t> compute_uniform_sampling_index_without_replacement(
frontier_degrees.shrink_to_fit(handle.get_stream());

return nbr_indices;
#else
CUGRAPH_FAIL("unimplemented.");
#endif
}

template <typename edge_t, typename bias_t>
Expand Down Expand Up @@ -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<edge_t> == cugraph::ops::graph::INVALID_ID<edge_t>);

using vertex_t = typename GraphViewType::vertex_type;
Expand Down Expand Up @@ -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<edge_t>(0, handle.get_stream()), std::nullopt, std::vector<size_t>());
#endif
}

template <typename GraphViewType,
Expand Down
6 changes: 0 additions & 6 deletions cpp/src/prims/per_v_random_select_transform_outgoing_e.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,6 @@ per_v_random_select_transform_e(raft::handle_t const& handle,
std::optional<T> 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;
Expand Down Expand Up @@ -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<T>(size_t{0}, rmm::cuda_stream_view{}));
#endif
}

} // namespace detail
Expand Down
7 changes: 0 additions & 7 deletions cpp/src/sampling/neighbor_sampling_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<bias_t>);

CUGRAPH_EXPECTS(fan_out.size() > 0, "Invalid input argument: number of levels must be non-zero.");
Expand Down Expand Up @@ -336,7 +330,6 @@ neighbor_sample_impl(
std::move(result_hops),
std::move(result_labels),
label_to_output_comm_rank);
#endif
}

} // namespace detail
Expand Down
Loading
Loading