Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial PropertyGraph implementation and tests #1999

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
d57e030
Initial partially working test and implementation of PropertyGraph cl…
rlratzel Dec 14, 2021
5de595e
Updates to get initial test passing.
rlratzel Dec 14, 2021
a03724c
Switched from pandas to cudf to ensure cudf special cases are handled…
rlratzel Dec 14, 2021
e4acb4c
Merge remote-tracking branch 'upstream/branch-22.02' into branch-22.0…
rlratzel Dec 14, 2021
62aed87
Cleaned up tests, added tests for add_*_data, added code to pass new …
rlratzel Dec 15, 2021
be93d44
More test cleanup, added test fixture for extract_subgraph tests, add…
rlratzel Dec 15, 2021
557aac4
Merge remote-tracking branch 'upstream/branch-22.02' into branch-22.0…
rlratzel Dec 15, 2021
be3fa54
Added option to build.sh to uninstall cmake deps, cleaned up unused i…
rlratzel Jan 3, 2022
8c23167
Merge remote-tracking branch 'upstream/branch-22.02' into branch-22.0…
rlratzel Jan 3, 2022
6fe7303
Update to allow properties that are used for vertex IDs to also be pa…
rlratzel Jan 4, 2022
dbfd86a
Added initial test for annotate_dataframe().
rlratzel Jan 4, 2022
1d3bb09
Merge remote-tracking branch 'upstream/branch-22.02' into branch-22.0…
rlratzel Jan 4, 2022
12606f2
Updates to accommodate dtype special cases with cuDF and Pandas DataF…
rlratzel Jan 8, 2022
b4392df
Updated copyright date.
rlratzel Jan 8, 2022
574130b
Added tests and code for including a unique edge ID for each edge in …
rlratzel Jan 9, 2022
92aec18
Created a single directed graph instance as part of setup.
rlratzel Jan 9, 2022
98dc735
Made internal column names more user friendly, added check for duplic…
rlratzel Jan 11, 2022
aac3d75
flake8 fixes.
rlratzel Jan 11, 2022
aacaca5
Updated annotate_dataframe() test to check individual columns and it …
rlratzel Jan 11, 2022
074e57e
WIP of changes to extract_subgraph to use a select() approach.
rlratzel Jan 12, 2022
b0d8796
Added check for matching DataFrame types for annotate_dataframe(), up…
rlratzel Jan 12, 2022
cee6734
flake8 fix.
rlratzel Jan 12, 2022
aa10b82
Renamed to PropertySelection, finished select_vertices(), added docst…
rlratzel Jan 13, 2022
e718dc1
Merge branch 'branch-22.02-propgraphselectchanges' into branch-22.02-…
rlratzel Jan 13, 2022
1ffa3aa
Merge remote-tracking branch 'upstream/branch-22.02' into branch-22.0…
rlratzel Jan 13, 2022
7a0928d
flake8 fixes.
rlratzel Jan 13, 2022
f718b56
Added docstrings.
rlratzel Jan 13, 2022
f6eb64c
Renamed test to match corresponding module name.
rlratzel Jan 13, 2022
6c016ab
flake8 fixes.
rlratzel Jan 13, 2022
67ed5b0
Updated docstring, added FIXME.
rlratzel Jan 13, 2022
119dd72
Merge remote-tracking branch 'upstream/branch-22.02' into branch-22.0…
rlratzel Jan 19, 2022
da7ab9d
Made PropertyGraph and PropertySelection "experimental"
rlratzel Jan 19, 2022
e0b248d
Added experimental package to top-level __init__.py
rlratzel Jan 19, 2022
c9d9b2e
Merge remote-tracking branch 'upstream/branch-22.02' into branch-22.0…
rlratzel Jan 20, 2022
6150d8a
Merge remote-tracking branch 'upstream/branch-22.02' into branch-22.0…
rlratzel Jan 24, 2022
7bf8d86
Merge remote-tracking branch 'upstream/branch-22.02' into branch-22.0…
rlratzel Jan 24, 2022
1421b4e
Added a simple test for a completely uninitialized property graph
acostadon Jan 24, 2022
a4d8779
cleaned up formatting errors revealed in flake8
acostadon Jan 24, 2022
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
65 changes: 44 additions & 21 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,24 +20,25 @@ REPODIR=$(cd $(dirname $0); pwd)
LIBCUGRAPH_BUILD_DIR=${LIBCUGRAPH_BUILD_DIR:=${REPODIR}/cpp/build}
LIBCUGRAPH_ETL_BUILD_DIR=${LIBCUGRAPH_ETL_BUILD_DIR:=${REPODIR}/cpp/libcugraph_etl/build}

VALIDARGS="clean uninstall libcugraph libcugraph_etl cugraph pylibcugraph cpp-mgtests docs -v -g -n --allgpuarch --skip_cpp_tests -h --help"
VALIDARGS="clean uninstall uninstall_cmake_deps libcugraph libcugraph_etl cugraph pylibcugraph cpp-mgtests docs -v -g -n --allgpuarch --skip_cpp_tests -h --help"
HELP="$0 [<target> ...] [<flag> ...]
where <target> is:
clean - remove all existing build artifacts and configuration (start over)
uninstall - uninstall libcugraph and cugraph from a prior build/install (see also -n)
libcugraph - build libcugraph.so and SG test binaries
libcugraph_etl - build libcugraph_etl.so and SG test binaries
cugraph - build the cugraph Python package
pylibcugraph - build the pylibcugraph Python package
cpp-mgtests - build libcugraph and libcugraph_etl MG tests. Builds MPI communicator, adding MPI as a dependency.
docs - build the docs
clean - remove all existing build artifacts and configuration (start over)
uninstall - uninstall libcugraph and cugraph from a prior build/install (see also -n)
uninstall_cmake_deps - uninstall headers from external dependencies installed by cmake (raft, rmm, cuco, etc.) (see also -n)
libcugraph - build libcugraph.so and SG test binaries
libcugraph_etl - build libcugraph_etl.so and SG test binaries
cugraph - build the cugraph Python package
pylibcugraph - build the pylibcugraph Python package
cpp-mgtests - build libcugraph and libcugraph_etl MG tests. Builds MPI communicator, adding MPI as a dependency.
docs - build the docs
and <flag> is:
-v - verbose build mode
-g - build for debug
-n - do not install after a successful build
--allgpuarch - build for all supported GPU architectures
--skip_cpp_tests - do not build the SG test binaries as part of the libcugraph target
-h - print this text
-v - verbose build mode
-g - build for debug
-n - do not install after a successful build
--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
-h - print this text

default action (no args) is to build and install 'libcugraph' then 'libcugraph_etl' then 'pylibcugraph' then 'cugraph' then 'docs' targets

Expand All @@ -50,6 +51,7 @@ BUILD_DIRS="${LIBCUGRAPH_BUILD_DIR} ${LIBCUGRAPH_ETL_BUILD_DIR} ${CUGRAPH_BUILD_

# Set defaults for vars modified by flags to this script
VERBOSE_FLAG=""
CMAKE_VERBOSE_OPTION=""
BUILD_TYPE=Release
INSTALL_TARGET=install
BUILD_CPP_TESTS=ON
Expand Down Expand Up @@ -89,6 +91,7 @@ fi
# Process flags
if hasArg -v; then
VERBOSE_FLAG="-v"
CMAKE_VERBOSE_OPTION="--log-level=VERBOSE"
fi
if hasArg -g; then
BUILD_TYPE=Debug
Expand All @@ -106,16 +109,17 @@ if hasArg cpp-mgtests; then
BUILD_CPP_MG_TESTS=ON
fi

# If clean or uninstall given, run them prior to any other steps
# If clean or uninstall targets given, run them prior to any other steps
if hasArg uninstall; then
# uninstall libcugraph
if [[ "$INSTALL_PREFIX" != "" ]]; then
rm -rf ${INSTALL_PREFIX}/include/cugraph
rm -f ${INSTALL_PREFIX}/lib/libcugraph.so
rm -rf ${INSTALL_PREFIX}/include/cugraph_c
rm -f ${INSTALL_PREFIX}/lib/libcugraph_c.so
rm -rf ${INSTALL_PREFIX}/include/cugraph_etl
rm -f ${INSTALL_PREFIX}/lib/libcugraph_etl.so
rm -rf ${INSTALL_PREFIX}/lib/cmake/cugraph
rm -rf ${INSTALL_PREFIX}/lib/cmake/cugraph_etl
fi
# This may be redundant given the above, but can also be used in case
# there are other installed files outside of the locations above.
Expand All @@ -124,9 +128,25 @@ if hasArg uninstall; then
fi
# uninstall cugraph and pylibcugraph installed from a prior "setup.py
# 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.
pip uninstall -y cugraph pylibcugraph
fi

if hasArg uninstall_cmake_deps; then
if [[ "$INSTALL_PREFIX" != "" ]]; then
rm -rf ${INSTALL_PREFIX}/include/raft
rm -rf ${INSTALL_PREFIX}/lib/cmake/raft
rm -rf ${INSTALL_PREFIX}/include/cub
rm -rf ${INSTALL_PREFIX}/lib/cmake/cub
rm -rf ${INSTALL_PREFIX}/include/cuco
rm -rf ${INSTALL_PREFIX}/lib/cmake/cuco
rm -rf ${INSTALL_PREFIX}/include/rmm
rm -rf ${INSTALL_PREFIX}/lib/cmake/rmm
fi
fi

if hasArg clean; then
# Ignore errors for clean since missing files, etc. are not failures
set +e
Expand All @@ -141,6 +161,7 @@ if hasArg clean; then
find . -name "__pycache__" -type d -exec rm -rf {} \; > /dev/null 2>&1
find . -name "*.cpp" -type f -delete
find . -name "*.cpython*.so" -type f -delete
find . -type d -name _external_repositories -exec rm -rf {} \; > /dev/null 2>&1
popd > /dev/null
fi

Expand Down Expand Up @@ -175,8 +196,8 @@ if buildAll || hasArg libcugraph; then
-DCMAKE_CUDA_ARCHITECTURES=${CUGRAPH_CMAKE_CUDA_ARCHITECTURES} \
-DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
-DBUILD_TESTS=${BUILD_CPP_TESTS} \
-DBUILD_CUGRAPH_MG_TESTS=${BUILD_CPP_MG_TESTS}

-DBUILD_CUGRAPH_MG_TESTS=${BUILD_CPP_MG_TESTS} \
${CMAKE_VERBOSE_OPTION}
cmake --build "${LIBCUGRAPH_BUILD_DIR}" -j${PARALLEL_LEVEL} --target ${INSTALL_TARGET} ${VERBOSE_FLAG}
fi

Expand All @@ -196,7 +217,8 @@ if buildAll || hasArg libcugraph_etl; then
-DDISABLE_DEPRECATION_WARNING=${BUILD_DISABLE_DEPRECATION_WARNING} \
-DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
-DBUILD_TESTS=${BUILD_CPP_TESTS} \
-DBUILD_CUGRAPH_MG_TESTS=${BUILD_CPP_MG_TESTS} --log-level=VERBOSE \
-DBUILD_CUGRAPH_MG_TESTS=${BUILD_CPP_MG_TESTS} \
${CMAKE_VERBOSE_OPTION} \
${REPODIR}/cpp/libcugraph_etl
cmake --build "${LIBCUGRAPH_ETL_BUILD_DIR}" -j${PARALLEL_LEVEL} --target ${INSTALL_TARGET} ${VERBOSE_FLAG}
fi
Expand Down Expand Up @@ -233,7 +255,8 @@ if buildAll || hasArg docs; then
cd ${LIBCUGRAPH_BUILD_DIR}
cmake -B "${LIBCUGRAPH_BUILD_DIR}" -S "${REPODIR}/cpp" \
-DCMAKE_INSTALL_PREFIX=${INSTALL_PREFIX} \
-DCMAKE_BUILD_TYPE=${BUILD_TYPE}
-DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
${CMAKE_VERBOSE_OPTION}
fi
cd ${LIBCUGRAPH_BUILD_DIR}
cmake --build "${LIBCUGRAPH_BUILD_DIR}" -j${PARALLEL_LEVEL} --target docs_cugraph ${VERBOSE_FLAG}
Expand Down
6 changes: 5 additions & 1 deletion cpp/cmake/thirdparty/get_raft.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,11 @@ function(find_and_configure_raft)
"RAFT_COMPILE_LIBRARIES OFF"
)

message(VERBOSE "CUGRAPH: Using RAFT located in ${raft_SOURCE_DIR}")
if(raft_ADDED)
message(VERBOSE "CUGRAPH: Using RAFT located in ${raft_SOURCE_DIR}")
else()
message(VERBOSE "CUGRAPH: Using RAFT located in ${raft_DIR}")
endif()

endfunction()

Expand Down
4 changes: 3 additions & 1 deletion python/cugraph/cugraph/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2019-2021, NVIDIA CORPORATION.
# Copyright (c) 2019-2022, NVIDIA CORPORATION.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
Expand Down Expand Up @@ -109,6 +109,8 @@

from cugraph.sampling import random_walks, rw_path

from cugraph import experimental

# Versioneer
from ._version import get_versions

Expand Down
3 changes: 1 addition & 2 deletions python/cugraph/cugraph/community/ecg_wrapper.pyx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2019-2021, NVIDIA CORPORATION.
# Copyright (c) 2019-2022, NVIDIA CORPORATION.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
Expand All @@ -22,7 +22,6 @@ from cugraph.structure import graph_primtypes_wrapper
from libc.stdint cimport uintptr_t

import cudf
import rmm
import numpy as np


Expand Down
20 changes: 20 additions & 0 deletions python/cugraph/cugraph/experimental/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Copyright (c) 2022, NVIDIA CORPORATION.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from cugraph.utilities.api_tools import experimental_warning_wrapper

from cugraph.structure.property_graph import EXPERIMENTAL__PropertyGraph
PropertyGraph = experimental_warning_wrapper(EXPERIMENTAL__PropertyGraph)

from cugraph.structure.property_graph import EXPERIMENTAL__PropertySelection
PropertySelection = experimental_warning_wrapper(EXPERIMENTAL__PropertySelection)
3 changes: 1 addition & 2 deletions python/cugraph/cugraph/generators/rmat_wrapper.pyx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2021, NVIDIA CORPORATION.
# Copyright (c) 2021-2022, NVIDIA CORPORATION.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
Expand All @@ -19,7 +19,6 @@ from libcpp.utility cimport move, pair
from cython.operator cimport dereference as deref
import numpy as np

import rmm
from rmm._lib.device_buffer cimport device_buffer
import cudf

Expand Down
3 changes: 1 addition & 2 deletions python/cugraph/cugraph/sampling/random_walks_wrapper.pyx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2021, NVIDIA CORPORATION.
# Copyright (c) 2021-2022, NVIDIA CORPORATION.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
Expand All @@ -19,7 +19,6 @@ from libcpp.memory cimport unique_ptr
from cython.operator cimport dereference as deref

import cudf
import rmm

from cugraph.structure.graph_utilities cimport (populate_graph_container,
graph_container_t,
Expand Down
2 changes: 1 addition & 1 deletion python/cugraph/cugraph/structure/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2019-2021, NVIDIA CORPORATION.
# Copyright (c) 2019-2022, NVIDIA CORPORATION.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2019-2021, NVIDIA CORPORATION.
# Copyright (c) 2019-2022, NVIDIA CORPORATION.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
Expand Down Expand Up @@ -29,7 +29,6 @@ from dask.distributed import wait, default_client
from cugraph.dask.common.input_utils import DistributedDataHandler

import cudf
import rmm
import numpy as np


Expand Down
Loading