Skip to content

Commit

Permalink
Merge branch 'rapidsai:branch-23.08' into branch-23.08
Browse files Browse the repository at this point in the history
  • Loading branch information
nv-rliu authored Jul 24, 2023
2 parents 02e23ef + 487efd6 commit 30734f9
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 67 deletions.
65 changes: 18 additions & 47 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ HELP="$0 [<target> ...] [<flag> ...]
and <flag> 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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand All @@ -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

Expand All @@ -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

Expand All @@ -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

Expand All @@ -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

Expand Down
3 changes: 0 additions & 3 deletions cpp/src/community/legacy/spectral_clustering.cu
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@
#include <cugraph/legacy/graph.hpp>
#include <cugraph/utilities/error.hpp>

#if defined RAFT_COMPILED
#include <raft/distance/specializations.cuh>
#endif
#include <raft/spectral/modularity_maximization.cuh>
#include <raft/spectral/partition.cuh>

Expand Down
1 change: 0 additions & 1 deletion cpp/tests/sampling/mg_uniform_neighbor_sampling.cu
Original file line number Diff line number Diff line change
Expand Up @@ -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<cugraph::edge_property_view_t<edge_t, edge_t const*>>{std::nullopt},
Expand Down
36 changes: 20 additions & 16 deletions cpp/tests/sampling/sg_uniform_neighbor_sampling.cu
Original file line number Diff line number Diff line change
Expand Up @@ -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<int32_t const>(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<std::tuple<raft::device_span<int32_t const>, raft::device_span<int32_t const>>>
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<cugraph::edge_property_view_t<edge_t, edge_t const*>>{std::nullopt},
std::optional<cugraph::edge_property_view_t<edge_t, int32_t const*>>{std::nullopt},
raft::device_span<vertex_t const>{random_sources_copy.data(), random_sources.size()},
batch_number ? std::make_optional(raft::device_span<int32_t const>{batch_number->data(),
batch_number->size()})
: std::nullopt,
label_to_output_comm_rank_mapping,
raft::host_span<int32_t const>(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,
Expand Down

0 comments on commit 30734f9

Please sign in to comment.