Skip to content

Commit

Permalink
Merge branch 'branch-24.12' into fix_similarity_issue
Browse files Browse the repository at this point in the history
  • Loading branch information
ChuckHastings committed Nov 8, 2024
2 parents bbdaf66 + 2d1189b commit 192bae0
Show file tree
Hide file tree
Showing 105 changed files with 588 additions and 865 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ repos:
setup[.]cfg$
- id: verify-alpha-spec
- repo: https://github.com/rapidsai/dependency-file-generator
rev: v1.13.11
rev: v1.16.0
hooks:
- id: rapids-dependency-file-generator
args: ["--clean"]
Expand Down
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
2 changes: 2 additions & 0 deletions ci/build_cpp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,6 @@ rapids-logger "Begin cpp build"

RAPIDS_PACKAGE_VERSION=$(rapids-generate-version) rapids-conda-retry mambabuild conda/recipes/libcugraph

sccache --show-adv-stats

rapids-upload-conda-to-s3 cpp
7 changes: 7 additions & 0 deletions ci/build_python.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,26 @@ export RAPIDS_PACKAGE_VERSION=$(head -1 ./VERSION)

rapids-logger "Begin py build"

sccache --zero-stats

# TODO: Remove `--no-test` flags once importing on a CPU
# node works correctly
rapids-conda-retry mambabuild \
--no-test \
--channel "${CPP_CHANNEL}" \
conda/recipes/pylibcugraph

sccache --show-adv-stats
sccache --zero-stats

rapids-conda-retry mambabuild \
--no-test \
--channel "${CPP_CHANNEL}" \
--channel "${RAPIDS_CONDA_BLD_OUTPUT_DIR}" \
conda/recipes/cugraph

sccache --show-adv-stats

# NOTE: nothing in nx-cugraph is CUDA-specific, but it is built on each CUDA
# platform to ensure it is included in each set of artifacts, since test
# scripts only install from one set of artifacts based on the CUDA version used
Expand Down
10 changes: 8 additions & 2 deletions ci/build_wheel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ rapids-generate-version > ./VERSION

cd "${package_dir}"

sccache --zero-stats

rapids-logger "Building '${package_name}' wheel"

python -m pip wheel \
-w dist \
-v \
Expand All @@ -23,12 +27,14 @@ python -m pip wheel \
--extra-index-url https://pypi.nvidia.com \
.

sccache --show-adv-stats

# pure-python packages should be marked as pure, and not have auditwheel run on them.
if [[ ${package_name} == "nx-cugraph" ]] || \
[[ ${package_name} == "cugraph-dgl" ]] || \
[[ ${package_name} == "cugraph-pyg" ]] || \
[[ ${package_name} == "cugraph-equivariant" ]]; then
RAPIDS_PY_WHEEL_NAME="${package_name}_${RAPIDS_PY_CUDA_SUFFIX}" RAPIDS_PY_WHEEL_PURE="1" rapids-upload-wheels-to-s3 dist
RAPIDS_PY_WHEEL_NAME="${package_name}_${RAPIDS_PY_CUDA_SUFFIX}" RAPIDS_PY_WHEEL_PURE="1" rapids-upload-wheels-to-s3 python dist
else
case "${RAPIDS_CUDA_VERSION}" in
12.*)
Expand All @@ -48,5 +54,5 @@ else

mkdir -p final_dist
python -m auditwheel repair -w final_dist "${EXCLUDE_ARGS[@]}" dist/*
RAPIDS_PY_WHEEL_NAME="${package_name}_${RAPIDS_PY_CUDA_SUFFIX}" rapids-upload-wheels-to-s3 final_dist
RAPIDS_PY_WHEEL_NAME="${package_name}_${RAPIDS_PY_CUDA_SUFFIX}" rapids-upload-wheels-to-s3 python final_dist
fi
4 changes: 2 additions & 2 deletions conda/recipes/cugraph/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,10 @@ requirements:
- {{ pin_compatible('cuda-version', max_pin='x', min_pin='x') }}
{% if cuda_major == "11" %}
- cudatoolkit
- cuda-python >=11.7.1,<12.0a0
- cuda-python >=11.7.1,<12.0a0,<=11.8.3
{% else %}
- cuda-cudart
- cuda-python >=12.0,<13.0a0
- cuda-python >=12.0,<13.0a0,<=12.6.0
{% endif %}
- cudf ={{ minor_version }}
- cupy >=12.0.0
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)
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
Loading

0 comments on commit 192bae0

Please sign in to comment.