Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
6cfafee
need the ifdefs
ChuckHastings Dec 10, 2020
7cbfded
missed a spot
ChuckHastings Dec 10, 2020
18fa79c
Merge branch 'branch-0.17-archtempfix' into fix_experimental_louvain_…
ChuckHastings Dec 11, 2020
dc7d664
re-enable EXPERIMENTAL_LOUVAIN_TEST
ChuckHastings Dec 11, 2020
d1ee4be
add runtime check
ChuckHastings Dec 11, 2020
ba5cda8
clean up some guards and text
ChuckHastings Dec 11, 2020
5644580
remove guard from host code... causing compilation issues
ChuckHastings Dec 16, 2020
e75c74d
moved ifdefs into the experimental::louvain implementation
Dec 17, 2020
47b01e3
fix clang format issue
ChuckHastings Dec 17, 2020
df082d8
undo --allgpuarch change
ChuckHastings Dec 17, 2020
940aa66
Merge branch 'branch-0.18' into fix_experimental_louvain_test
ChuckHastings Dec 17, 2020
2316f03
add comments based on PR feedback
ChuckHastings Dec 18, 2020
521952f
bug fixes
Iroy30 Dec 28, 2020
e8f0631
add changelog
Iroy30 Dec 28, 2020
a80ca57
remove unused code
Iroy30 Jan 4, 2021
9ab78a9
don't need to skip includes on Pascal, update comment
ChuckHastings Jan 4, 2021
049b088
Updates to support nightly MG test automation(#1308)
rlratzel Jan 4, 2021
d69cff7
Merge pull request #1312 from ChuckHastings/fix_experimental_louvain_…
BradReesWork Jan 5, 2021
78c383d
add test for renumbering from series
Iroy30 Jan 5, 2021
d3e846f
Update test_renumber.py
Iroy30 Jan 5, 2021
44ffc54
FIX Setup trap after PATH is updated
dillon-cullinan Jan 5, 2021
e2557d0
DOC Update changelog
dillon-cullinan Jan 5, 2021
ea25305
review changes
Iroy30 Jan 5, 2021
499d956
Fix MNMG Louvain tests on Pascal architecture(#1322)
ChuckHastings Jan 6, 2021
896db87
Update SG PageRank C++ tests(#1307)
seunghwak Jan 6, 2021
dfab2ee
flake8
Iroy30 Jan 6, 2021
2e55604
Merge branch 'branch-0.18' into bug_fixes
Iroy30 Jan 6, 2021
0af875a
Update input_utils.py
Iroy30 Jan 6, 2021
85f0a3a
Create labeler.yml(#1318)
jolorunyomi Jan 11, 2021
7971a36
Updated git utils used by copyright.py for compatibility with current…
rlratzel Jan 11, 2021
d53b9cf
Merge pull request #1319 from Iroy30/bug_fixes
BradReesWork Jan 12, 2021
85ec66c
Merge pull request #1321 from dillon-cullinan/fix-benchmark
BradReesWork Jan 12, 2021
1f2345d
Fix mnmg cleanup exceptions(#1326)
Iroy30 Jan 12, 2021
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
30 changes: 30 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# https://github.com/actions/labeler#common-examples
# Adapted from https://github.com/rapidsai/cugraph/blob/main/.github/CODEOWNERS
# Labels culled from https://github.com/rapidsai/cugraph/labels

python:
- 'python/**'
- 'notebooks/**'
- 'benchmarks/**'

doc:
- 'docs/**'
- '**/*.md'

datasets:
- 'datasets/**'

cuGraph:
- 'cpp/**'

CMake:
- '**/CMakeLists.txt'
- '**/cmake/**'

Ops:
- '.github/**'
- 'ci/**'
- 'conda/**'
- '**/Dockerfile'
- '**/.dockerignore'
- 'docker/**'
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
## Improvements

## Bug Fixes
- PR #1321 Fix benchmark script trap setup to come after the PATH variable update

# cuGraph 0.17.0 (10 Dec 2020)
## New Features
Expand Down
12 changes: 6 additions & 6 deletions ci/benchmark/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,18 @@ function cleanup {
rm -f testoutput.txt
}

# Set cleanup trap for Jenkins
if [ ! -z "$JENKINS_HOME" ] ; then
gpuci_logger "Jenkins environment detected, setting cleanup trap"
trap cleanup EXIT
fi

# Set path, build parallel level, and CUDA version
cd $WORKSPACE
export PATH=/opt/conda/bin:/usr/local/cuda/bin:$PATH
export PARALLEL_LEVEL=${PARALLEL_LEVEL:-4}
export CUDA_REL=${CUDA_VERSION%.*}

# Set cleanup trap for Jenkins
if [ ! -z "$JENKINS_HOME" ] ; then
gpuci_logger "Jenkins environment detected, setting cleanup trap"
trap cleanup EXIT
fi

# Set home
export HOME=$WORKSPACE

Expand Down
7 changes: 4 additions & 3 deletions ci/checks/style.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
# Copyright (c) 2018-2020, NVIDIA CORPORATION.
# Copyright (c) 2018-2021, NVIDIA CORPORATION.
########################
# cuGraph Style Tester #
########################
Expand Down Expand Up @@ -52,13 +52,14 @@ COPYRIGHT=`env PYTHONPATH=ci/utils python ci/checks/copyright.py --git-modified-
CR_RETVAL=$?
ERRORCODE=$((ERRORCODE | ${CR_RETVAL}))

# Output results if failure otherwise show pass
if [ "$CR_RETVAL" != "0" ]; then
echo -e "\n\n>>>> FAILED: copyright check; begin output\n\n"
echo -e "$COPYRIGHT"
echo -e "\n\n>>>> FAILED: copyright check; end output\n\n"
else
echo -e "\n\n>>>> PASSED: copyright check\n\n"
echo -e "\n\n>>>> PASSED: copyright check; begin debug output\n\n"
echo -e "$COPYRIGHT"
echo -e "\n\n>>>> PASSED: copyright check; end debug output\n\n"
fi

exit ${ERRORCODE}
2 changes: 1 addition & 1 deletion ci/gpu/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ conda list --show-channel-urls

if [[ -z "$PROJECT_FLASH" || "$PROJECT_FLASH" == "0" ]]; then
gpuci_logger "Build from source"
$WORKSPACE/build.sh -v clean libcugraph cugraph --allgpuarch
$WORKSPACE/build.sh -v clean libcugraph cugraph
fi

################################################################################
Expand Down
51 changes: 36 additions & 15 deletions ci/utils/git_helpers.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2019-2020, NVIDIA CORPORATION.
# Copyright (c) 2019-2021, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -59,14 +59,24 @@ def uncommittedFiles():
return ret


def changedFilesBetween(b1, b2):
"""Returns a list of files changed between branches b1 and b2"""
def changedFilesBetween(baseName, branchName, commitHash):
"""
Returns a list of files changed between branches baseName and latest commit
of branchName.
"""
current = branch()
__git("checkout", "--quiet", b1)
__git("checkout", "--quiet", b2)
files = __gitdiff("--name-only", "--ignore-submodules", "%s...%s" %
(b1, b2))
__git("checkout", "--quiet", current)
# checkout "base" branch
__git("checkout", "--force", baseName)
# checkout branch for comparing
__git("checkout", "--force", branchName)
# checkout latest commit from branch
__git("checkout", "-fq", commitHash)

files = __gitdiff("--name-only", "--ignore-submodules",
f"{baseName}..{branchName}")

# restore the original branch
__git("checkout", "--force", current)
return files.splitlines()


Expand All @@ -87,26 +97,37 @@ def changesInFileBetween(file, b1, b2, pathFilter=None):

def modifiedFiles(pathFilter=None):
"""
If inside a CI-env (ie. currentBranch=current-pr-branch and the env-var
PR_TARGET_BRANCH is defined), then lists out all files modified between
these 2 branches. Else, lists out all the uncommitted files in the current
branch.
If inside a CI-env (ie. TARGET_BRANCH and COMMIT_HASH are defined, and
current branch is "current-pr-branch"), then lists out all files modified
between these 2 branches. Else, lists out all the uncommitted files in the
current branch.

Such utility function is helpful while putting checker scripts as part of
cmake, as well as CI process. This way, during development, only the files
touched (but not yet committed) by devs can be checked. But, during the CI
process ALL files modified by the dev, as submiited in the PR, will be
checked. This happens, all the while using the same script.
"""
if "PR_TARGET_BRANCH" in os.environ and branch() == "current-pr-branch":
allFiles = changedFilesBetween(os.environ["PR_TARGET_BRANCH"],
branch())
targetBranch = os.environ.get("TARGET_BRANCH")
commitHash = os.environ.get("COMMIT_HASH")
currentBranch = branch()
print(f" [DEBUG] TARGET_BRANCH={targetBranch}, COMMIT_HASH={commitHash}, "
f"currentBranch={currentBranch}")

if targetBranch and commitHash and (currentBranch == "current-pr-branch"):
print(" [DEBUG] Assuming a CI environment.")
allFiles = changedFilesBetween(targetBranch, currentBranch, commitHash)
else:
print(" [DEBUG] Did not detect CI environment.")
allFiles = uncommittedFiles()

files = []
for f in allFiles:
if pathFilter is None or pathFilter(f):
files.append(f)

filesToCheckString = "\n\t".join(files) if files else "<None>"
print(f" [DEBUG] Found files to check:\n\t{filesToCheckString}\n")
return files


Expand Down
38 changes: 16 additions & 22 deletions cpp/src/community/louvain.cu
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,8 @@
*/

#include <community/louvain.cuh>

// "FIXME": remove the guards after support for Pascal will be dropped;
//
// Disable louvain(experimenta::graph_view_t,...)
// versions for GPU architectures < 700
//(this is because cuco/static_map.cuh would not
// compile on those)
//
#if defined(__CUDA_ARCH__) && __CUDA_ARCH__ < 700
#include <experimental/graph.hpp>
#else
#include <experimental/louvain.cuh>
#endif

namespace cugraph {

Expand Down Expand Up @@ -58,13 +47,22 @@ std::pair<size_t, weight_t> louvain(
{
CUGRAPH_EXPECTS(clustering != nullptr, "Invalid input argument: clustering is null");

#if defined(__CUDA_ARCH__) && __CUDA_ARCH__ < 700
CUGRAPH_FAIL("Louvain not supported on Pascal and older architectures");
#else
experimental::Louvain<experimental::graph_view_t<vertex_t, edge_t, weight_t, false, multi_gpu>>
runner(handle, graph_view);
return runner(clustering, max_level, resolution);
#endif
// "FIXME": remove this check and the guards below
//
// Disable louvain(experimental::graph_view_t,...)
// versions for GPU architectures < 700
// (cuco/static_map.cuh depends on features not supported on or before Pascal)
//
cudaDeviceProp device_prop;
CUDA_CHECK(cudaGetDeviceProperties(&device_prop, 0));

if (device_prop.major < 7) {
CUGRAPH_FAIL("Louvain not supported on Pascal and older architectures");
} else {
experimental::Louvain<experimental::graph_view_t<vertex_t, edge_t, weight_t, false, multi_gpu>>
runner(handle, graph_view);
return runner(clustering, max_level, resolution);
}
}

} // namespace detail
Expand All @@ -78,11 +76,7 @@ std::pair<size_t, typename graph_t::weight_type> louvain(raft::handle_t const &h
{
CUGRAPH_EXPECTS(clustering != nullptr, "Invalid input argument: clustering is null");

#if defined(__CUDA_ARCH__) && __CUDA_ARCH__ < 700
CUGRAPH_FAIL("Louvain not supported on Pascal and older architectures");
#else
return detail::louvain(handle, graph, clustering, max_level, resolution);
#endif
}

// Explicit template instantations
Expand Down
27 changes: 24 additions & 3 deletions cpp/src/experimental/louvain.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@

#include <rmm/thrust_rmm_allocator.h>
#include <compute_partition.cuh>
#include <cuco/static_map.cuh>
#include <experimental/shuffle.cuh>
#include <utilities/comm_utils.cuh>
#include <utilities/graph_utils.cuh>
Expand All @@ -33,6 +32,23 @@
#include <patterns/transform_reduce_e.cuh>
#include <patterns/transform_reduce_v.cuh>

// "FIXME": remove the guards below and references to CUCO_STATIC_MAP_DEFINED
//
// cuco/static_map.cuh depends on features not supported on or before Pascal.
//
// If we build for sm_60 or before, the inclusion of cuco/static_map.cuh wil
// result in compilation errors.
//
// If we're Pascal or before we do nothing here and will suppress including
// some code below. If we are later than Pascal we define CUCO_STATIC_MAP_DEFINED
// which will result in the full implementation being pulled in.
//
#if defined(__CUDA_ARCH__) && __CUDA_ARCH__ < 700
#else
#define CUCO_STATIC_MAP_DEFINED
#include <cuco/static_map.cuh>
#endif

//#define TIMING

#ifdef TIMING
Expand All @@ -44,6 +60,7 @@ namespace experimental {

namespace detail {

#ifdef CUCO_STATIC_MAP_DEFINED
template <typename data_t>
struct create_cuco_pair_t {
cuco::pair_type<data_t, data_t> __device__ operator()(data_t data)
Expand All @@ -54,6 +71,7 @@ struct create_cuco_pair_t {
return tmp;
}
};
#endif

//
// These classes should allow cuco::static_map to generate hash tables of
Expand Down Expand Up @@ -443,7 +461,9 @@ class Louvain {
weight_t resolution)
{
size_t num_level{0};
weight_t best_modularity = weight_t{-1};

#ifdef CUCO_STATIC_MAP_DEFINED
weight_t total_edge_weight;
total_edge_weight = experimental::transform_reduce_e(
handle_,
Expand All @@ -453,8 +473,6 @@ class Louvain {
[] __device__(auto, auto, weight_t wt, auto, auto) { return wt; },
weight_t{0});

weight_t best_modularity = weight_t{-1};

//
// Initialize every cluster to reference each vertex to itself
//
Expand All @@ -480,6 +498,7 @@ class Louvain {
}

timer_display(std::cout);
#endif

return std::make_pair(num_level, best_modularity);
}
Expand Down Expand Up @@ -593,6 +612,7 @@ class Louvain {
}
}

#ifdef CUCO_STATIC_MAP_DEFINED
virtual weight_t update_clustering(weight_t total_edge_weight, weight_t resolution)
{
timer_start("update_clustering");
Expand Down Expand Up @@ -1616,6 +1636,7 @@ class Louvain {
cugraph::detail::offsets_to_indices(
current_graph_view_.offsets(), local_num_rows_, src_indices_v_.data().get());
}
#endif

std::
tuple<rmm::device_vector<vertex_t>, rmm::device_vector<vertex_t>, rmm::device_vector<weight_t>>
Expand Down
11 changes: 5 additions & 6 deletions cpp/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -302,12 +302,11 @@ ConfigureTest(EXPERIMENTAL_PAGERANK_TEST "${EXPERIMENTAL_PAGERANK_TEST_SRCS}" ""
###################################################################################################
# - Experimental LOUVAIN tests -------------------------------------------------------------------

# FIXME: Re-enable once failures are fixed
#set(EXPERIMENTAL_LOUVAIN_TEST_SRCS
# "${CMAKE_SOURCE_DIR}/../thirdparty/mmio/mmio.c"
# "${CMAKE_CURRENT_SOURCE_DIR}/experimental/louvain_test.cu")
#
#ConfigureTest(EXPERIMENTAL_LOUVAIN_TEST "${EXPERIMENTAL_LOUVAIN_TEST_SRCS}" "")
set(EXPERIMENTAL_LOUVAIN_TEST_SRCS
"${CMAKE_SOURCE_DIR}/../thirdparty/mmio/mmio.c"
"${CMAKE_CURRENT_SOURCE_DIR}/experimental/louvain_test.cu")

ConfigureTest(EXPERIMENTAL_LOUVAIN_TEST "${EXPERIMENTAL_LOUVAIN_TEST_SRCS}" "")

###################################################################################################
# - Experimental KATZ_CENTRALITY tests ------------------------------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions cpp/tests/experimental/bfs_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
#include <vector>

template <typename vertex_t, typename edge_t>
void bfs_reference(edge_t* offsets,
vertex_t* indices,
void bfs_reference(edge_t const* offsets,
vertex_t const* indices,
vertex_t* distances,
vertex_t* predecessors,
vertex_t num_vertices,
Expand Down
11 changes: 6 additions & 5 deletions cpp/tests/experimental/katz_centrality_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@
#include <vector>

template <typename vertex_t, typename edge_t, typename weight_t, typename result_t>
void katz_centrality_reference(edge_t* offsets,
vertex_t* indices,
weight_t* weights,
result_t* betas,
void katz_centrality_reference(edge_t const* offsets,
vertex_t const* indices,
weight_t const* weights,
result_t const* betas,
result_t* katz_centralities,
vertex_t num_vertices,
result_t alpha,
Expand Down Expand Up @@ -195,7 +195,8 @@ class Tests_KatzCentrality : public ::testing::TestWithParam<KatzCentrality_Usec

auto threshold_ratio = 1e-3;
auto threshold_magnitude =
(epsilon / static_cast<result_t>(graph_view.get_number_of_vertices())) * threshold_ratio;
(1.0 / static_cast<result_t>(graph_view.get_number_of_vertices())) *
threshold_ratio; // skip comparison for low Katz Centrality verties (lowly ranked vertices)
auto nearly_equal = [threshold_ratio, threshold_magnitude](auto lhs, auto rhs) {
auto diff = std::abs(lhs - rhs);
return (diff < std::max(lhs, rhs) * threshold_ratio) || (diff < threshold_magnitude);
Expand Down
Loading