From 54a30b933922cc0dbef7c0fa0d98b49889bcbbe8 Mon Sep 17 00:00:00 2001 From: Vyas Ramasubramani Date: Fri, 21 Jul 2023 08:39:39 -0700 Subject: [PATCH 1/3] Stop using setup.py in build.sh (#3704) This PR changes replaces direct invocations of setup.py in build.sh with `pip install` commands since setup.py usage is deprecated. This change will facilitate upcoming changes to our build systems. Authors: - Vyas Ramasubramani (https://github.com/vyasr) Approvers: - Rick Ratzel (https://github.com/rlratzel) URL: https://github.com/rapidsai/cugraph/pull/3704 --- build.sh | 65 ++++++++++++++++---------------------------------------- 1 file changed, 18 insertions(+), 47 deletions(-) diff --git a/build.sh b/build.sh index a8e97d924c6..18359229822 100755 --- a/build.sh +++ b/build.sh @@ -60,7 +60,7 @@ HELP="$0 [ ...] [ ...] and is: -v - verbose build mode -g - build for debug - -n - do not install after a successful build + -n - do not install after a successful build (does not affect Python packages) --pydevelop - use setup.py develop instead of install --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 @@ -104,7 +104,7 @@ BUILD_CPP_MG_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 ." +PYTHON_ARGS_FOR_INSTALL="-m pip install --no-build-isolation --no-deps" # Set defaults for vars that may not have been defined externally # FIXME: if PREFIX is not set, check CONDA_PREFIX, but there is no fallback @@ -178,6 +178,12 @@ if hasArg --pydevelop; then PYTHON_ARGS_FOR_INSTALL="-m pip install --no-build-isolation --no-deps -e ." fi +# Append `-DFIND_RAFT_CPP=ON` to EXTRA_CMAKE_ARGS unless a user specified the option. +SKBUILD_EXTRA_CMAKE_ARGS="${EXTRA_CMAKE_ARGS}" + if [[ "${EXTRA_CMAKE_ARGS}" != *"DFIND_CUGRAPH_CPP"* ]]; then + SKBUILD_EXTRA_CMAKE_ARGS="${SKBUILD_EXTRA_CMAKE_ARGS} -DFIND_CUGRAPH_CPP=ON" + fi + # If clean or uninstall targets given, run them prior to any other steps if hasArg uninstall; then if [[ "$INSTALL_PREFIX" != "" ]]; then @@ -296,21 +302,9 @@ if buildAll || hasArg pylibcugraph; then if hasArg --clean; then cleanPythonDir ${REPODIR}/python/pylibcugraph else - cd ${REPODIR}/python/pylibcugraph - # setup.py references an env var CUGRAPH_BUILD_PATH to find the libcugraph - # build. If not set by the user, set it to LIBCUGRAPH_BUILD_DIR - CUGRAPH_BUILD_PATH=${CUGRAPH_BUILD_PATH:=${LIBCUGRAPH_BUILD_DIR}} - python setup.py build_ext \ - --inplace \ - -- \ - -DFIND_CUGRAPH_CPP=ON \ - -DUSE_CUGRAPH_OPS=${BUILD_WITH_CUGRAPHOPS} \ - -Dcugraph_ROOT=${LIBCUGRAPH_BUILD_DIR} \ - -- \ - -j${PARALLEL_LEVEL:-1} - if [[ ${INSTALL_TARGET} != "" ]]; then - env CUGRAPH_BUILD_PATH=${CUGRAPH_BUILD_PATH} python ${PYTHON_ARGS_FOR_INSTALL} - fi + SKBUILD_CONFIGURE_OPTIONS="${SKBUILD_EXTRA_CMAKE_ARGS} -DUSE_CUGRAPH_OPS=${BUILD_WITH_CUGRAPHOPS}" \ + SKBUILD_BUILD_OPTIONS="-j${PARALLEL_LEVEL}" \ + python ${PYTHON_ARGS_FOR_INSTALL} ${REPODIR}/python/pylibcugraph fi fi @@ -319,22 +313,9 @@ if buildAll || hasArg cugraph; then if hasArg --clean; then cleanPythonDir ${REPODIR}/python/cugraph else - cd ${REPODIR}/python/cugraph - # FIXME: this needs to eventually reference the pylibcugraph build - # setup.py references an env var CUGRAPH_BUILD_PATH to find the libcugraph - # build. If not set by the user, set it to LIBCUGRAPH_BUILD_DIR - CUGRAPH_BUILD_PATH=${CUGRAPH_BUILD_PATH:=${LIBCUGRAPH_BUILD_DIR}} - python setup.py build_ext \ - --inplace \ - -- \ - -DFIND_CUGRAPH_CPP=ON \ - -DUSE_CUGRAPH_OPS=${BUILD_WITH_CUGRAPHOPS} \ - -Dcugraph_ROOT=${LIBCUGRAPH_BUILD_DIR} \ - -- \ - -j${PARALLEL_LEVEL:-1} - if [[ ${INSTALL_TARGET} != "" ]]; then - env CUGRAPH_BUILD_PATH=${CUGRAPH_BUILD_PATH} python ${PYTHON_ARGS_FOR_INSTALL} - fi + SKBUILD_CONFIGURE_OPTIONS="${SKBUILD_EXTRA_CMAKE_ARGS} -DUSE_CUGRAPH_OPS=${BUILD_WITH_CUGRAPHOPS}" \ + SKBUILD_BUILD_OPTIONS="-j${PARALLEL_LEVEL}" \ + python ${PYTHON_ARGS_FOR_INSTALL} ${REPODIR}/python/cugraph fi fi @@ -343,12 +324,8 @@ if hasArg cugraph-service; then if hasArg --clean; then cleanPythonDir ${REPODIR}/python/cugraph-service else - if [[ ${INSTALL_TARGET} != "" ]]; then - cd ${REPODIR}/python/cugraph-service/client - python ${PYTHON_ARGS_FOR_INSTALL} - cd ${REPODIR}/python/cugraph-service/server - python ${PYTHON_ARGS_FOR_INSTALL} - fi + python ${PYTHON_ARGS_FOR_INSTALL} ${REPODIR}/python/cugraph-service/client + python ${PYTHON_ARGS_FOR_INSTALL} ${REPODIR}/python/cugraph-service/server fi fi @@ -357,10 +334,7 @@ if hasArg cugraph-pyg; then if hasArg --clean; then cleanPythonDir ${REPODIR}/python/cugraph-pyg else - if [[ ${INSTALL_TARGET} != "" ]]; then - cd ${REPODIR}/python/cugraph-pyg - python ${PYTHON_ARGS_FOR_INSTALL} - fi + python ${PYTHON_ARGS_FOR_INSTALL} ${REPODIR}/python/cugraph-pyg fi fi @@ -369,10 +343,7 @@ if hasArg cugraph-dgl; then if hasArg --clean; then cleanPythonDir ${REPODIR}/python/cugraph-dgl else - if [[ ${INSTALL_TARGET} != "" ]]; then - cd ${REPODIR}/python/cugraph-dgl - python ${PYTHON_ARGS_FOR_INSTALL} - fi + python ${PYTHON_ARGS_FOR_INSTALL} ${REPODIR}/python/cugraph-dgl fi fi From cab836896aeba2c5549c57ebfd4818e883c17b5c Mon Sep 17 00:00:00 2001 From: Bradley Dice Date: Fri, 21 Jul 2023 12:09:24 -0500 Subject: [PATCH 2/3] Remove RAFT specialization. (#3727) This PR removes a deprecation warning coming from RAFT. Including the specializations header no longer has an effect, so it can be safely removed. Authors: - Bradley Dice (https://github.com/bdice) Approvers: - Chuck Hastings (https://github.com/ChuckHastings) URL: https://github.com/rapidsai/cugraph/pull/3727 --- cpp/src/community/legacy/spectral_clustering.cu | 3 --- 1 file changed, 3 deletions(-) diff --git a/cpp/src/community/legacy/spectral_clustering.cu b/cpp/src/community/legacy/spectral_clustering.cu index 5ab71e7d280..84e9891b7ce 100644 --- a/cpp/src/community/legacy/spectral_clustering.cu +++ b/cpp/src/community/legacy/spectral_clustering.cu @@ -24,9 +24,6 @@ #include #include -#if defined RAFT_COMPILED -#include -#endif #include #include From 487efd6d69bdd67c5ea03be56bda2d7e73005431 Mon Sep 17 00:00:00 2001 From: Chuck Hastings <45364586+ChuckHastings@users.noreply.github.com> Date: Fri, 21 Jul 2023 17:28:01 -0400 Subject: [PATCH 3/3] Fix sampling call parameters if compiled with -DNO_CUGRAPH_OPS (#3729) Updated sampling call in the `#ifdef NO_CUGRAPH_OPS` branch of the SG unit test. The MG unit test was correctly updated previously. Fixes #3726 Authors: - Chuck Hastings (https://github.com/ChuckHastings) Approvers: - Seunghwa Kang (https://github.com/seunghwak) - Bradley Dice (https://github.com/bdice) URL: https://github.com/rapidsai/cugraph/pull/3729 --- .../sampling/mg_uniform_neighbor_sampling.cu | 1 - .../sampling/sg_uniform_neighbor_sampling.cu | 36 ++++++++++--------- 2 files changed, 20 insertions(+), 17 deletions(-) diff --git a/cpp/tests/sampling/mg_uniform_neighbor_sampling.cu b/cpp/tests/sampling/mg_uniform_neighbor_sampling.cu index 82fb2430ca1..57f85a212b1 100644 --- a/cpp/tests/sampling/mg_uniform_neighbor_sampling.cu +++ b/cpp/tests/sampling/mg_uniform_neighbor_sampling.cu @@ -163,7 +163,6 @@ class Tests_MGUniform_Neighbor_Sampling EXPECT_THROW( cugraph::uniform_neighbor_sample( *handle_, - handle, mg_graph_view, mg_edge_weight_view, std::optional>{std::nullopt}, diff --git a/cpp/tests/sampling/sg_uniform_neighbor_sampling.cu b/cpp/tests/sampling/sg_uniform_neighbor_sampling.cu index a59ea7feb8f..f795c11437f 100644 --- a/cpp/tests/sampling/sg_uniform_neighbor_sampling.cu +++ b/cpp/tests/sampling/sg_uniform_neighbor_sampling.cu @@ -128,25 +128,29 @@ class Tests_Uniform_Neighbor_Sampling random_sources.size(), handle.get_stream()); -#ifdef NO_CUGRAPH_OPS - EXPECT_THROW(cugraph::uniform_neighbor_sample( - handle, - graph_view, - edge_weight_view, - std::nullopt, - std::nullopt, - std::move(random_sources_copy), - std::move(batch_number), - 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 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 auto&& [src_out, dst_out, wgt_out, edge_id, edge_type, hop, labels, offsets] = cugraph::uniform_neighbor_sample( handle,