Skip to content

Commit

Permalink
Merge branch 'branch-24.02' into to_undirected
Browse files Browse the repository at this point in the history
  • Loading branch information
eriknw committed Dec 15, 2023
2 parents f566363 + d7c88d1 commit 2bd2392
Show file tree
Hide file tree
Showing 30 changed files with 100 additions and 582 deletions.
61 changes: 13 additions & 48 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ HELP="$0 [<target> ...] [<flag> ...]
-v - verbose build mode
-g - build for debug
-n - do not install after a successful build (does not affect Python packages)
--pydevelop - use setup.py develop instead of install
--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
Expand Down Expand Up @@ -187,14 +187,18 @@ if hasArg --cmake_default_generator; then
CMAKE_GENERATOR_OPTION=""
fi
if hasArg --pydevelop; then
PYTHON_ARGS_FOR_INSTALL="-m pip install --no-build-isolation --no-deps -e"
PYTHON_ARGS_FOR_INSTALL="${PYTHON_ARGS_FOR_INSTALL} -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

# Replace spaces with semicolons in SKBUILD_EXTRA_CMAKE_ARGS
SKBUILD_EXTRA_CMAKE_ARGS=$(echo ${SKBUILD_EXTRA_CMAKE_ARGS} | sed 's/ /;/g')

# Append `-DFIND_CUGRAPH_CPP=ON` to EXTRA_CMAKE_ARGS unless a user specified the option.
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
Expand All @@ -213,8 +217,7 @@ if hasArg uninstall; then
if [ -e ${LIBCUGRAPH_BUILD_DIR}/install_manifest.txt ]; then
xargs rm -f < ${LIBCUGRAPH_BUILD_DIR}/install_manifest.txt > /dev/null 2>&1
fi
# uninstall cugraph and pylibcugraph installed from a prior "setup.py
# install"
# uninstall cugraph and pylibcugraph installed from a prior install
# FIXME: if multiple versions of these packages are installed, this only
# removes the latest one and leaves the others installed. build.sh uninstall
# can be run multiple times to remove all of them, but that is not obvious.
Expand All @@ -226,10 +229,6 @@ if hasArg clean; then
# Ignore errors for clean since missing files, etc. are not failures
set +e
# remove artifacts generated inplace
# FIXME: ideally the "setup.py clean" command would be used for this, but
# currently running any setup.py command has side effects (eg. cloning
# repos).
# (cd ${REPODIR}/python && python setup.py clean)
if [[ -d ${REPODIR}/python ]]; then
cleanPythonDir ${REPODIR}/python
fi
Expand Down Expand Up @@ -317,24 +316,7 @@ if buildDefault || hasArg pylibcugraph || hasArg all; then
if hasArg --clean; then
cleanPythonDir ${REPODIR}/python/pylibcugraph
else
# FIXME: skbuild with setuptools>=64 has a bug when called from a "pip
# install -e" command, resulting in a broken editable wheel. Continue
# to use "setup.py bdist_ext --inplace" for a develop build until
# https://github.com/scikit-build/scikit-build/issues/981 is closed.
if hasArg --pydevelop; then
cd ${REPODIR}/python/pylibcugraph
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}
cd -
fi
SKBUILD_CONFIGURE_OPTIONS="${SKBUILD_EXTRA_CMAKE_ARGS} -DUSE_CUGRAPH_OPS=${BUILD_WITH_CUGRAPHOPS}" \
SKBUILD_BUILD_OPTIONS="-j${PARALLEL_LEVEL}" \
SKBUILD_CMAKE_ARGS="${SKBUILD_EXTRA_CMAKE_ARGS};-DUSE_CUGRAPH_OPS=${BUILD_WITH_CUGRAPHOPS}" \
python ${PYTHON_ARGS_FOR_INSTALL} ${REPODIR}/python/pylibcugraph
fi
fi
Expand All @@ -344,24 +326,7 @@ if buildDefault || hasArg cugraph || hasArg all; then
if hasArg --clean; then
cleanPythonDir ${REPODIR}/python/cugraph
else
# FIXME: skbuild with setuptools>=64 has a bug when called from a "pip
# install -e" command, resulting in a broken editable wheel. Continue
# to use "setup.py bdist_ext --inplace" for a develop build until
# https://github.com/scikit-build/scikit-build/issues/981 is closed.
if hasArg --pydevelop; then
cd ${REPODIR}/python/cugraph
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}
cd -
fi
SKBUILD_CONFIGURE_OPTIONS="${SKBUILD_EXTRA_CMAKE_ARGS} -DUSE_CUGRAPH_OPS=${BUILD_WITH_CUGRAPHOPS}" \
SKBUILD_BUILD_OPTIONS="-j${PARALLEL_LEVEL}" \
SKBUILD_CMAKE_ARGS="${SKBUILD_EXTRA_CMAKE_ARGS};-DUSE_CUGRAPH_OPS=${BUILD_WITH_CUGRAPHOPS}" \
python ${PYTHON_ARGS_FOR_INSTALL} ${REPODIR}/python/cugraph
fi
fi
Expand Down
2 changes: 1 addition & 1 deletion ci/build_wheel_cugraph.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ RAPIDS_PY_CUDA_SUFFIX="$(rapids-wheel-ctk-name-gen ${RAPIDS_CUDA_VERSION})"
RAPIDS_PY_WHEEL_NAME=pylibcugraph_${RAPIDS_PY_CUDA_SUFFIX} rapids-download-wheels-from-s3 ./local-pylibcugraph
export PIP_FIND_LINKS=$(pwd)/local-pylibcugraph

export SKBUILD_CONFIGURE_OPTIONS="-DDETECT_CONDA_ENV=OFF -DFIND_CUGRAPH_CPP=OFF -DCPM_cugraph-ops_SOURCE=${GITHUB_WORKSPACE}/cugraph-ops/"
export SKBUILD_CMAKE_ARGS="-DDETECT_CONDA_ENV=OFF;-DFIND_CUGRAPH_CPP=OFF;-DCPM_cugraph-ops_SOURCE=${GITHUB_WORKSPACE}/cugraph-ops/"

./ci/build_wheel.sh cugraph python/cugraph
2 changes: 1 addition & 1 deletion ci/build_wheel_pylibcugraph.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@

set -euo pipefail

export SKBUILD_CONFIGURE_OPTIONS="-DDETECT_CONDA_ENV=OFF -DFIND_CUGRAPH_CPP=OFF -DCPM_cugraph-ops_SOURCE=${GITHUB_WORKSPACE}/cugraph-ops/"
export SKBUILD_CMAKE_ARGS="-DDETECT_CONDA_ENV=OFF;-DFIND_CUGRAPH_CPP=OFF;-DCPM_cugraph-ops_SOURCE=${GITHUB_WORKSPACE}/cugraph-ops/"

./ci/build_wheel.sh pylibcugraph python/pylibcugraph
7 changes: 0 additions & 7 deletions ci/notebook_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ def skip_book_dir(runtype):
# Not strictly true... however what we mean is
# Pascal or earlier
#
pascal = False
ampere = False
device = cuda.get_current_device()

Expand All @@ -62,8 +61,6 @@ def skip_book_dir(runtype):
cc = getattr(device, "COMPUTE_CAPABILITY", None) or getattr(
device, "compute_capability"
)
if cc[0] < 7:
pascal = True
if cc[0] >= 8:
ampere = True

Expand Down Expand Up @@ -91,10 +88,6 @@ def skip_book_dir(runtype):
)
skip = True
break
elif pascal and re.search("# Does not run on Pascal", line):
print(f"SKIPPING {filename} (does not run on Pascal)", file=sys.stderr)
skip = True
break
elif ampere and re.search("# Does not run on Ampere", line):
print(f"SKIPPING {filename} (does not run on Ampere)", file=sys.stderr)
skip = True
Expand Down
4 changes: 1 addition & 3 deletions ci/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,7 @@ fi
# EXITCODE for the script.
set +e

if (python ${CUGRAPH_ROOT}/ci/utils/is_pascal.py); then
echo "WARNING: skipping C++ tests on Pascal GPU arch."
elif hasArg "--run-cpp-tests"; then
if hasArg "--run-cpp-tests"; then
echo "C++ gtests for cuGraph (single-GPU only)..."
for gt in "${CONDA_PREFIX}/bin/gtests/libcugraph/"*_TEST; do
test_name=$(basename $gt)
Expand Down
37 changes: 0 additions & 37 deletions ci/utils/is_pascal.py

This file was deleted.

2 changes: 1 addition & 1 deletion conda/environments/all_cuda-118_arch-x86_64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ dependencies:
- recommonmark
- requests
- rmm==24.2.*
- scikit-build>=0.13.1
- scikit-build-core>=0.7.0
- scikit-learn>=0.23.1
- scipy
- setuptools>=61.0.0
Expand Down
2 changes: 1 addition & 1 deletion conda/environments/all_cuda-120_arch-x86_64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ dependencies:
- recommonmark
- requests
- rmm==24.2.*
- scikit-build>=0.13.1
- scikit-build-core>=0.7.0
- scikit-learn>=0.23.1
- scipy
- setuptools>=61.0.0
Expand Down
2 changes: 1 addition & 1 deletion conda/recipes/cugraph-pyg/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ requirements:
host:
- cython >=3.0.0
- python
- scikit-build >=0.13.1
- scikit-build-core >=0.7.0
run:
- rapids-dask-dependency ={{ minor_version }}
- numba >=0.57
Expand Down
2 changes: 1 addition & 1 deletion conda/recipes/cugraph/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ requirements:
- python
- raft-dask ={{ minor_version }}
- rmm ={{ minor_version }}
- scikit-build >=0.13.1
- scikit-build-core >=0.7.0
- setuptools
run:
- aiohttp
Expand Down
2 changes: 1 addition & 1 deletion conda/recipes/pylibcugraph/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ requirements:
- libcugraph ={{ version }}
- pylibraft ={{ minor_version }}
- python
- scikit-build >=0.13.1
- scikit-build-core >=0.7.0
- setuptools
run:
- {{ pin_compatible('cuda-version', max_pin='x', min_pin='x') }}
Expand Down
2 changes: 1 addition & 1 deletion cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ endif()
# cuhornet currently doesn't support
#
# >= 90
set(supported_archs "60" "62" "70" "72" "75" "80" "86" "89" "90")
set(supported_archs "70" "72" "75" "80" "86" "89" "90")
foreach( arch IN LISTS CMAKE_CUDA_ARCHITECTURES)
string(REPLACE "-real" "" arch ${arch})
if( arch IN_LIST supported_archs )
Expand Down
42 changes: 15 additions & 27 deletions cpp/tests/community/ecg_test.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2019-2022, NVIDIA CORPORATION. All rights reserved.
* Copyright (c) 2019-2023, NVIDIA CORPORATION. All rights reserved.
*
* NVIDIA CORPORATION and its licensors retain all intellectual property
* and proprietary rights in and to this software, related documentation
Expand Down Expand Up @@ -121,41 +121,29 @@ TEST(ecg, dolphin)
cugraph::legacy::GraphCSRView<int, int, float> graph_csr(
offsets_v.data(), indices_v.data(), weights_v.data(), num_verts, num_edges);

// "FIXME": remove this check once we drop support for Pascal
//
// Calling louvain on Pascal will throw an exception, we'll check that
// this is the behavior while we still support Pascal (device_prop.major < 7)
//
if (handle.get_device_properties().major < 7) {
EXPECT_THROW(
(cugraph::ecg<int32_t, int32_t, float>(handle, graph_csr, .05, 16, result_v.data())),
cugraph::logic_error);
} else {
cugraph::ecg<int32_t, int32_t, float>(handle, graph_csr, .05, 16, result_v.data());
cugraph::ecg<int32_t, int32_t, float>(handle, graph_csr, .05, 16, result_v.data());

auto cluster_id = cugraph::test::to_host(handle, result_v);
auto cluster_id = cugraph::test::to_host(handle, result_v);

int max = *max_element(cluster_id.begin(), cluster_id.end());
int min = *min_element(cluster_id.begin(), cluster_id.end());
int max = *max_element(cluster_id.begin(), cluster_id.end());
int min = *min_element(cluster_id.begin(), cluster_id.end());

ASSERT_EQ((min >= 0), 1);
ASSERT_EQ((min >= 0), 1);

std::set<int> cluster_ids;
for (auto c : cluster_id) {
cluster_ids.insert(c);
}
std::set<int> cluster_ids;
for (auto c : cluster_id) {
cluster_ids.insert(c);
}

ASSERT_EQ(cluster_ids.size(), size_t(max + 1));
ASSERT_EQ(cluster_ids.size(), size_t(max + 1));

float modularity{0.0};
float modularity{0.0};

cugraph::ext_raft::analyzeClustering_modularity(
graph_csr, max + 1, result_v.data(), &modularity);
cugraph::ext_raft::analyzeClustering_modularity(graph_csr, max + 1, result_v.data(), &modularity);

float random_modularity{0.95 * 0.4962422251701355};
float random_modularity{0.95 * 0.4962422251701355};

ASSERT_GT(modularity, random_modularity);
}
ASSERT_GT(modularity, random_modularity);
}

CUGRAPH_TEST_PROGRAM_MAIN()
36 changes: 8 additions & 28 deletions cpp/tests/community/leiden_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,39 +79,19 @@ class Tests_Leiden : public ::testing::TestWithParam<std::tuple<Leiden_Usecase,
auto edge_weight_view =
edge_weights ? std::make_optional((*edge_weights).view()) : std::nullopt;

// "FIXME": remove this check once we drop support for Pascal
//
// Calling leiden on Pascal will throw an exception, we'll check that
// this is the behavior while we still support Pascal (device_prop.major < 7)
//
cudaDeviceProp device_prop;
RAFT_CUDA_TRY(cudaGetDeviceProperties(&device_prop, 0));

if (cugraph::test::g_perf) {
RAFT_CUDA_TRY(cudaDeviceSynchronize()); // for consistent performance measurement
hr_timer.start("Leiden");
}

if (device_prop.major < 7) {
EXPECT_THROW(leiden(graph_view,
edge_weight_view,
graph_view.local_vertex_partition_range_size(),
leiden_usecase.max_level_,
leiden_usecase.resolution_,
leiden_usecase.check_correctness_,
leiden_usecase.expected_level_,
leiden_usecase.expected_modularity_),
cugraph::logic_error);
} else {
leiden(graph_view,
edge_weight_view,
graph_view.local_vertex_partition_range_size(),
leiden_usecase.max_level_,
leiden_usecase.resolution_,
leiden_usecase.check_correctness_,
leiden_usecase.expected_level_,
leiden_usecase.expected_modularity_);
}
leiden(graph_view,
edge_weight_view,
graph_view.local_vertex_partition_range_size(),
leiden_usecase.max_level_,
leiden_usecase.resolution_,
leiden_usecase.check_correctness_,
leiden_usecase.expected_level_,
leiden_usecase.expected_modularity_);

if (cugraph::test::g_perf) {
RAFT_CUDA_TRY(cudaDeviceSynchronize()); // for consistent performance measurement
Expand Down
Loading

0 comments on commit 2bd2392

Please sign in to comment.