diff --git a/.dockerignore b/.dockerignore index 6d29c8e919e..c274b811f6c 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,2 +1,2 @@ # Ignore cmake builds from local machine that might have occured before attempting Docker build. Including these files will cause CMake cache conflict issues -/cpp/build \ No newline at end of file +/cpp/build diff --git a/.github/workflows/add-to-project.yml b/.github/workflows/add-to-project.yml index bd4d10bcb54..13ad5079cbc 100644 --- a/.github/workflows/add-to-project.yml +++ b/.github/workflows/add-to-project.yml @@ -4,7 +4,7 @@ on: issues: types: - opened - + pull_request_target: types: - opened diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 6b7ff14417c..3d893e0e562 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -5,11 +5,13 @@ exclude: '^thirdparty' repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.4.0 + rev: v4.5.0 hooks: - id: check-added-large-files - id: debug-statements + - id: end-of-file-fixer - id: mixed-line-ending + - id: trailing-whitespace - repo: https://github.com/psf/black rev: 22.10.0 hooks: diff --git a/benchmarks/cugraph-dgl/pytest-based/README.MD b/benchmarks/cugraph-dgl/pytest-based/README.MD index 9e73d0b90c7..ff696ffcca3 100755 --- a/benchmarks/cugraph-dgl/pytest-based/README.MD +++ b/benchmarks/cugraph-dgl/pytest-based/README.MD @@ -1,10 +1,10 @@ -## Run Benchmarks +## Run Benchmarks -#### SG +#### SG ``` pytest bench_cugraph_dgl_uniform_neighbor_sample.py -k "SG and fanout_10_25 and rmat_24_4" --benchmark-save='1_rmat_24_4.json' ``` -#### MG +#### MG ``` DASK_NUM_WORKERS=2 pytest bench_cugraph_dgl_uniform_neighbor_sample.py -k "MG and fanout_10_25 and rmat_24_16" --benchmark-save='2_rmat_24_8.json' diff --git a/benchmarks/cugraph/standalone/bulk_sampling/README.md b/benchmarks/cugraph/standalone/bulk_sampling/README.md index bb01133c52f..2d09466fb2f 100644 --- a/benchmarks/cugraph/standalone/bulk_sampling/README.md +++ b/benchmarks/cugraph/standalone/bulk_sampling/README.md @@ -16,21 +16,21 @@ Required: the samples will be written to a new folder in /home/samples that contains information about the sampling run as well as the time of the run. - + --dataset_root The folder where datasets are stored. Uses the format described in the input format section. - + --datasets Comma-separated list of datasets; can specify ogb or rmat (i.e. ogb_papers100M[2],rmat_22_16). For ogb datasets, can provide replication factor using brackets. Will attempt to read from dataset_root/. - + Optional: --fanouts Comma-separated list of fanout values (i.e. [10, 25]). The default fanout is [10, 25]. - + --batch_sizes Comma-separated list of batch sizes (i.e. 500, 1000). Defaults to "512,1024" @@ -39,7 +39,7 @@ Optional: Comma-separated list of seeds per call. Controls the number of input seed vertices processed in a single sampling call. Defaults to 524288 - + --reverse_edges Whether to reverse the edges of the input edgelist. Should be set to False for PyG and True for DGL. Defaults to False (PyG). @@ -52,8 +52,8 @@ Optional: --random_seed Seed for random number generation. Defaults to '62' - - + + ### Input Format The script expects its input data in the following format: ``` @@ -159,4 +159,4 @@ GPUs per node is currently unsupported by this script but should be possible in ### Output The results of training will be outputted to the logs directory with an `output.txt` file for each worker. -These will be overwritten upon each run. Accuracy is only reported on rank 0. \ No newline at end of file +These will be overwritten upon each run. Accuracy is only reported on rank 0. diff --git a/benchmarks/cugraph/standalone/bulk_sampling/run_sampling.sh b/benchmarks/cugraph/standalone/bulk_sampling/run_sampling.sh index 41792c0b63a..1b3085dcc9a 100644 --- a/benchmarks/cugraph/standalone/bulk_sampling/run_sampling.sh +++ b/benchmarks/cugraph/standalone/bulk_sampling/run_sampling.sh @@ -67,7 +67,7 @@ handleTimeout 120 python ${MG_UTILS_DIR}/wait_for_workers.py \ DASK_STARTUP_ERRORCODE=$LAST_EXITCODE -echo $SLURM_NODEID +echo $SLURM_NODEID if [[ $SLURM_NODEID == 0 ]]; then echo "Launching Python Script" python ${SCRIPTS_DIR}/cugraph_bulk_sampling.py \ @@ -78,7 +78,7 @@ if [[ $SLURM_NODEID == 0 ]]; then --batch_sizes $BATCH_SIZE \ --seeds_per_call_opts "524288" \ --num_epochs $NUM_EPOCHS \ - --random_seed 42 + --random_seed 42 echo "DONE" > ${SAMPLES_DIR}/status.txt fi @@ -108,4 +108,4 @@ sleep 2 if [[ $SLURM_NODEID == 0 ]]; then rm ${SAMPLES_DIR}/status.txt -fi \ No newline at end of file +fi diff --git a/benchmarks/cugraph/standalone/bulk_sampling/run_train_job.sh b/benchmarks/cugraph/standalone/bulk_sampling/run_train_job.sh index 977745a9593..27ae0dc7788 100755 --- a/benchmarks/cugraph/standalone/bulk_sampling/run_train_job.sh +++ b/benchmarks/cugraph/standalone/bulk_sampling/run_train_job.sh @@ -16,7 +16,7 @@ #SBATCH -p luna #SBATCH -J datascience_rapids_cugraphgnn-papers:bulkSamplingPyG #SBATCH -N 1 -#SBATCH -t 00:25:00 +#SBATCH -t 00:25:00 CONTAINER_IMAGE=${CONTAINER_IMAGE:="please_specify_container"} SCRIPTS_DIR=$(pwd) @@ -81,4 +81,3 @@ srun \ --fanout $FANOUT \ --replication_factor $REPLICATION_FACTOR \ --num_epochs $NUM_EPOCHS - diff --git a/benchmarks/dgl/README.md b/benchmarks/dgl/README.md index c24e6a6df18..82762588ee8 100644 --- a/benchmarks/dgl/README.md +++ b/benchmarks/dgl/README.md @@ -13,4 +13,4 @@ pytest dgl_benchmark.py::bench_dgl_pure_gpu ## For UVA Benchmarks ``` pytest dgl_benchmark.py::bench_dgl_uva -``` \ No newline at end of file +``` diff --git a/benchmarks/shared/build_cugraph_ucx/README.MD b/benchmarks/shared/build_cugraph_ucx/README.MD index b18adfd3b03..06ab37a048d 100644 --- a/benchmarks/shared/build_cugraph_ucx/README.MD +++ b/benchmarks/shared/build_cugraph_ucx/README.MD @@ -6,10 +6,10 @@ docker build -f cugraph_ucx.dockerfile . -t cugraph_ucx docker run --privileged -it --gpus=all --net=host cugraph_ucx /bin/bash #### Client Bandwidth Test -python3 test_client_bandwidth.py +python3 test_client_bandwidth.py ```bash -(base) root@exp02:/home# python3 test_client_bandwidth.py +(base) root@exp02:/home# python3 test_client_bandwidth.py 2022-12-19 13:31:30,867 - distributed.preloading - INFO - Creating preload: dask_cuda.initialize 2022-12-19 13:31:30,867 - distributed.preloading - INFO - Import preload module: dask_cuda.initialize 2022-12-19 13:31:30,891 - distributed.preloading - INFO - Creating preload: dask_cuda.initialize @@ -30,8 +30,8 @@ Bandwidth = 5.2037 gb/s #### Sampling Test python3 test_cugraph_sampling.py ```bash -test_client_bandwidth.py test_cugraph_sampling.py -(base) root@exp02:/home# python3 test_cugraph_sampling.py +test_client_bandwidth.py test_cugraph_sampling.py +(base) root@exp02:/home# python3 test_cugraph_sampling.py [1671456769.722931] [exp02:93 :0] parser.c:1989 UCX WARN unused environment variable: UCX_MEMTYPE_CACHE (maybe: UCX_MEMTYPE_CACHE?) [1671456769.722931] [exp02:93 :0] parser.c:1989 UCX WARN (set UCX_WARN_UNUSED_ENV_VARS=n to suppress this warning) 2022-12-19 13:32:56,228 - distributed.preloading - INFO - Creating preload: dask_cuda.initialize @@ -54,4 +54,4 @@ Sampling 1,000 took = 69.15879249572754 ms Sampling 10,000 took = 89.63620662689209 ms Sampling 100,000 took = 135.9888792037964 ms ----------------------------------------Completed Test---------------------------------------- -``` \ No newline at end of file +``` diff --git a/benchmarks/shared/build_cugraph_ucx/build-ucx.sh b/benchmarks/shared/build_cugraph_ucx/build-ucx.sh index 758f9b57231..df9290cdfe6 100644 --- a/benchmarks/shared/build_cugraph_ucx/build-ucx.sh +++ b/benchmarks/shared/build_cugraph_ucx/build-ucx.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright (c) 2023, NVIDIA CORPORATION. +# Copyright (c) 2023-2024, NVIDIA CORPORATION. # SPDX-License-Identifier: Apache-2.0 set -ex @@ -16,4 +16,4 @@ mkdir build-linux && cd build-linux --enable-mt --enable-numa --with-gnu-ld --with-rdmacm --with-verbs \ --with-cuda=${CUDA_HOME} \ ${CONFIGURE_ARGS} -make -j install \ No newline at end of file +make -j install diff --git a/benchmarks/shared/build_cugraph_ucx/cugraph_ucx.dockerfile b/benchmarks/shared/build_cugraph_ucx/cugraph_ucx.dockerfile index 452801d9774..f51bee4c320 100644 --- a/benchmarks/shared/build_cugraph_ucx/cugraph_ucx.dockerfile +++ b/benchmarks/shared/build_cugraph_ucx/cugraph_ucx.dockerfile @@ -55,7 +55,7 @@ RUN gpuci_mamba_retry install -y -c pytorch -c rapidsai-nightly -c rapidsai -c c tqdm -# Build ucx from source with IB support +# Build ucx from source with IB support # on 1.14.x RUN conda remove --force -y ucx ucx-proc diff --git a/ci/test.sh b/ci/test.sh index b3adc80c593..f20fc40f85a 100755 --- a/ci/test.sh +++ b/ci/test.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright (c) 2019-2023, NVIDIA CORPORATION. +# Copyright (c) 2019-2024, 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 @@ -105,7 +105,7 @@ if hasArg "--run-python-tests"; then # rmat is not tested because of MG testing pytest --cache-clear --junitxml=${CUGRAPH_ROOT}/junit-cugraph-pytests.xml -v --cov-config=.coveragerc --cov=cugraph_pyg --cov-report=xml:${WORKSPACE}/python/cugraph_pyg/cugraph-coverage.xml --cov-report term --ignore=raft --ignore=tests/mg --ignore=tests/int --ignore=tests/generators --benchmark-disable echo "Ran Python pytest for cugraph_pyg : return code was: $?, test script exit code is now: $EXITCODE" - + echo "Python pytest for cugraph-service (single-GPU only)..." cd ${CUGRAPH_ROOT}/python/cugraph-service pytest -sv --cache-clear --junitxml=${CUGRAPH_ROOT}/junit-cugraph-service-pytests.xml --benchmark-disable -k "not mg" ./tests diff --git a/cpp/cmake/thirdparty/get_nccl.cmake b/cpp/cmake/thirdparty/get_nccl.cmake index 118ae377049..bb2500c67e2 100644 --- a/cpp/cmake/thirdparty/get_nccl.cmake +++ b/cpp/cmake/thirdparty/get_nccl.cmake @@ -1,5 +1,5 @@ #============================================================================= -# Copyright (c) 2021, NVIDIA CORPORATION. +# Copyright (c) 2021-2024, NVIDIA CORPORATION. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -32,7 +32,3 @@ function(find_and_configure_nccl) endfunction() find_and_configure_nccl() - - - - diff --git a/cpp/docs/DEVELOPER_GUIDE.md b/cpp/docs/DEVELOPER_GUIDE.md index b369183a262..50d4bc63e9f 100644 --- a/cpp/docs/DEVELOPER_GUIDE.md +++ b/cpp/docs/DEVELOPER_GUIDE.md @@ -1,6 +1,6 @@ # cuGraph C++ Developer Guide -This document serves as a guide for contributors to cuGraph C++ code. Developers should also refer +This document serves as a guide for contributors to cuGraph C++ code. Developers should also refer to these additional files for further documentation of cuGraph best practices. * [Documentation Guide](TODO) for guidelines on documenting cuGraph code. @@ -9,7 +9,7 @@ to these additional files for further documentation of cuGraph best practices. # Overview -cuGraph includes a C++ library that provides GPU-accelerated graph algorithms for processing +cuGraph includes a C++ library that provides GPU-accelerated graph algorithms for processing sparse graphs. ## Lexicon @@ -27,12 +27,12 @@ and weight[i]. # Directory Structure and File Naming -External/public cuGraph APIs are grouped based on functionality into an appropriately titled -header file in `cugraph/cpp/include/`. For example, `cugraph/cpp/include/graph.hpp` -contains the definition of the (legacy) graph objects. Note the `.hpp` +External/public cuGraph APIs are grouped based on functionality into an appropriately titled +header file in `cugraph/cpp/include/`. For example, `cugraph/cpp/include/graph.hpp` +contains the definition of the (legacy) graph objects. Note the `.hpp` file extension used to indicate a C++ header file. -Header files should use the `#pragma once` include guard. +Header files should use the `#pragma once` include guard. ## File extensions @@ -50,8 +50,8 @@ algorithm APIs with a device execution policy (always `rmm::exec_policy` in cuGr ## Code and Documentation Style and Formatting -cuGraph code uses [snake_case](https://en.wikipedia.org/wiki/Snake_case) for all names except in a -few cases: unit tests and test case names may use Pascal case, aka +cuGraph code uses [snake_case](https://en.wikipedia.org/wiki/Snake_case) for all names except in a +few cases: unit tests and test case names may use Pascal case, aka [UpperCamelCase](https://en.wikipedia.org/wiki/Camel_case). We do not use [Hungarian notation](https://en.wikipedia.org/wiki/Hungarian_notation), except for the following examples: * device data variables should be prefaced by d_ if it makes the intent clearer @@ -67,7 +67,7 @@ void algorithm_function(graph_t const &g) } template -class utility_class +class utility_class { ... private: @@ -75,9 +75,9 @@ class utility_class } ``` -C++ formatting is enforced using `clang-format`. You should configure `clang-format` on your -machine to use the `cugraph/cpp/.clang-format` configuration file, and run `clang-format` on all -changed code before committing it. The easiest way to do this is to configure your editor to +C++ formatting is enforced using `clang-format`. You should configure `clang-format` on your +machine to use the `cugraph/cpp/.clang-format` configuration file, and run `clang-format` on all +changed code before committing it. The easiest way to do this is to configure your editor to "format on save". Aspects of code style not discussed in this document and not automatically enforceable are typically @@ -85,10 +85,10 @@ caught during code review, or not enforced. ### C++ Guidelines -In general, we recommend following -[C++ Core Guidelines](https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines). We also -recommend watching Sean Parent's [C++ Seasoning talk](https://www.youtube.com/watch?v=W2tWOdzgXHA), -and we try to follow his rules: "No raw loops. No raw pointers. No raw synchronization primitives." +In general, we recommend following +[C++ Core Guidelines](https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines). We also +recommend watching Sean Parent's [C++ Seasoning talk](https://www.youtube.com/watch?v=W2tWOdzgXHA), +and we try to follow his rules: "No raw loops. No raw pointers. No raw synchronization primitives." * Prefer algorithms from STL and Thrust to raw loops. * Prefer cugraph and RMM to raw pointers and raw memory allocation. @@ -99,18 +99,18 @@ Documentation is discussed in the [Documentation Guide](TODO). The following guidelines apply to organizing `#include` lines. - * Group includes by library (e.g. cuGraph, RMM, Thrust, STL). `clang-format` will respect the + * Group includes by library (e.g. cuGraph, RMM, Thrust, STL). `clang-format` will respect the groupings and sort the individual includes within a group lexicographically. * Separate groups by a blank line. - * Order the groups from "nearest" to "farthest". In other words, local includes, then includes - from other RAPIDS libraries, then includes from related libraries, like ``, then - includes from dependencies installed with cuGraph, and then standard headers (for example ``, + * Order the groups from "nearest" to "farthest". In other words, local includes, then includes + from other RAPIDS libraries, then includes from related libraries, like ``, then + includes from dependencies installed with cuGraph, and then standard headers (for example ``, ``). * Use <> instead of "" unless the header is in the same directory as the source file. * Tools like `clangd` often auto-insert includes when they can, but they usually get the grouping and brackets wrong. - * Always check that includes are only necessary for the file in which they are included. - Try to avoid excessive including especially in header files. Double check this when you remove + * Always check that includes are only necessary for the file in which they are included. + Try to avoid excessive including especially in header files. Double check this when you remove code. # cuGraph Data Structures @@ -120,14 +120,14 @@ data structures you will use when developing cuGraph code. ## Views and Ownership -Resource ownership is an essential concept in cuGraph. In short, an "owning" object owns a -resource (such as device memory). It acquires that resource during construction and releases the +Resource ownership is an essential concept in cuGraph. In short, an "owning" object owns a +resource (such as device memory). It acquires that resource during construction and releases the resource in destruction ([RAII](https://en.cppreference.com/w/cpp/language/raii)). A "non-owning" object does not own resources. Any class in cuGraph with the `*_view` suffix is non-owning. ## `rmm::device_memory_resource` -cuGraph allocates all device memory via RMM memory resources (MR). See the +cuGraph allocates all device memory via RMM memory resources (MR). See the [RMM documentation](https://github.com/rapidsai/rmm/blob/main/README.md) for details. ## Streams @@ -142,29 +142,29 @@ cuGraph code generally eschews raw pointers and direct memory allocation. Use RM use `device_memory_resource`(*)s for device memory allocation with automated lifetime management. #### `rmm::device_buffer` -Allocates a specified number of bytes of untyped, uninitialized device memory using a -`device_memory_resource`. If no resource is explicitly provided, uses -`rmm::mr::get_current_device_resource()`. +Allocates a specified number of bytes of untyped, uninitialized device memory using a +`device_memory_resource`. If no resource is explicitly provided, uses +`rmm::mr::get_current_device_resource()`. -`rmm::device_buffer` is movable and copyable on a stream. A copy performs a deep copy of the -`device_buffer`'s device memory on the specified stream, whereas a move moves ownership of the +`rmm::device_buffer` is movable and copyable on a stream. A copy performs a deep copy of the +`device_buffer`'s device memory on the specified stream, whereas a move moves ownership of the device memory from one `device_buffer` to another. ```c++ -// Allocates at least 100 bytes of uninitialized device memory +// Allocates at least 100 bytes of uninitialized device memory // using the specified resource and stream -rmm::device_buffer buff(100, stream, mr); +rmm::device_buffer buff(100, stream, mr); void * raw_data = buff.data(); // Raw pointer to underlying device memory // Deep copies `buff` into `copy` on `stream` -rmm::device_buffer copy(buff, stream); +rmm::device_buffer copy(buff, stream); // Moves contents of `buff` into `moved_to` -rmm::device_buffer moved_to(std::move(buff)); +rmm::device_buffer moved_to(std::move(buff)); custom_memory_resource *mr...; // Allocates 100 bytes from the custom_memory_resource -rmm::device_buffer custom_buff(100, mr, stream); +rmm::device_buffer custom_buff(100, mr, stream); ``` #### `rmm::device_uvector` @@ -173,7 +173,7 @@ Similar to a `rmm::device_vector`, allocates a contiguous set of elements in dev key differences: - As an optimization, elements are uninitialized and no synchronization occurs at construction. This limits the types `T` to trivially copyable types. -- All operations are stream ordered (i.e., they accept a `cuda_stream_view` specifying the stream +- All operations are stream ordered (i.e., they accept a `cuda_stream_view` specifying the stream on which the operation is performed). ## Namespaces @@ -188,12 +188,12 @@ namespace cugraph{ ### Internal -Many functions are not meant for public use, so place them in either the `detail` or an *anonymous* +Many functions are not meant for public use, so place them in either the `detail` or an *anonymous* namespace, depending on the situation. #### `detail` namespace -Functions or objects that will be used across *multiple* translation units (i.e., source files), +Functions or objects that will be used across *multiple* translation units (i.e., source files), should be exposed in an internal header file and placed in the `detail` namespace. Example: ```c++ @@ -207,7 +207,7 @@ void reusable_helper_function(...); #### Anonymous namespace -Functions or objects that will only be used in a *single* translation unit should be defined in an +Functions or objects that will only be used in a *single* translation unit should be defined in an *anonymous* namespace in the source file where it is used. Example: ```c++ @@ -217,12 +217,12 @@ void isolated_helper_function(...); } // anonymous namespace ``` -[**Anonymous namespaces should *never* be used in a header file.**](https://wiki.sei.cmu.edu/confluence/display/cplusplus/DCL59-CPP.+Do+not+define+an+unnamed+namespace+in+a+header+file) +[**Anonymous namespaces should *never* be used in a header file.**](https://wiki.sei.cmu.edu/confluence/display/cplusplus/DCL59-CPP.+Do+not+define+an+unnamed+namespace+in+a+header+file) # Error Handling -cuGraph follows conventions (and provides utilities) enforcing compile-time and run-time -conditions and detecting and handling CUDA errors. Communication of errors is always via C++ +cuGraph follows conventions (and provides utilities) enforcing compile-time and run-time +conditions and detecting and handling CUDA errors. Communication of errors is always via C++ exceptions. ## Runtime Conditions @@ -234,13 +234,13 @@ Example usage: CUGRAPH_EXPECTS(lhs.type() == rhs.type(), "Column type mismatch"); ``` -The first argument is the conditional expression expected to resolve to `true` under normal -conditions. If the conditional evaluates to `false`, then an error has occurred and an instance of `cugraph::logic_error` is thrown. The second argument to `CUGRAPH_EXPECTS` is a short description of the -error that has occurred and is used for the exception's `what()` message. +The first argument is the conditional expression expected to resolve to `true` under normal +conditions. If the conditional evaluates to `false`, then an error has occurred and an instance of `cugraph::logic_error` is thrown. The second argument to `CUGRAPH_EXPECTS` is a short description of the +error that has occurred and is used for the exception's `what()` message. -There are times where a particular code path, if reached, should indicate an error no matter what. -For example, often the `default` case of a `switch` statement represents an invalid alternative. -Use the `CUGRAPH_FAIL` macro for such errors. This is effectively the same as calling +There are times where a particular code path, if reached, should indicate an error no matter what. +For example, often the `default` case of a `switch` statement represents an invalid alternative. +Use the `CUGRAPH_FAIL` macro for such errors. This is effectively the same as calling `CUGRAPH_EXPECTS(false, reason)`. Example: @@ -250,8 +250,8 @@ CUGRAPH_FAIL("This code path should not be reached."); ### CUDA Error Checking -Use the `CUDA_TRY` macro to check for the successful completion of CUDA runtime API functions. This -macro throws a `cugraph::cuda_error` exception if the CUDA API return value is not `cudaSuccess`. The +Use the `CUDA_TRY` macro to check for the successful completion of CUDA runtime API functions. This +macro throws a `cugraph::cuda_error` exception if the CUDA API return value is not `cudaSuccess`. The thrown exception includes a description of the CUDA error code in it's `what()` message. Example: diff --git a/cpp/doxygen/main_page.md b/cpp/doxygen/main_page.md index 3ff51a5aa43..287b7650286 100644 --- a/cpp/doxygen/main_page.md +++ b/cpp/doxygen/main_page.md @@ -1,3 +1,3 @@ # libcugraph -libcugraph is a C++ GPU Accelerated Graph Algorithm library. +libcugraph is a C++ GPU Accelerated Graph Algorithm library. diff --git a/cpp/libcugraph_etl/include/hash/concurrent_unordered_map.cuh b/cpp/libcugraph_etl/include/hash/concurrent_unordered_map.cuh index ab14ff6c685..18e3a6669ad 100644 --- a/cpp/libcugraph_etl/include/hash/concurrent_unordered_map.cuh +++ b/cpp/libcugraph_etl/include/hash/concurrent_unordered_map.cuh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2023, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2017-2024, NVIDIA CORPORATION. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,7 +16,7 @@ /* * FIXME: This file is copied from cudf because CuCollections doesnt support concurrent - * insert/find for 8 byte key-value pair size. The plan is to migrate to + * insert/find for 8 byte key-value pair size. The plan is to migrate to * using the cuco when the feature is supported. At that point this file can be deleted. */ #pragma once diff --git a/cpp/src/c_api/ecg.cpp b/cpp/src/c_api/ecg.cpp index 53e034916b7..f91b86a864f 100644 --- a/cpp/src/c_api/ecg.cpp +++ b/cpp/src/c_api/ecg.cpp @@ -151,4 +151,4 @@ extern "C" cugraph_error_code_t cugraph_ecg(const cugraph_resource_handle_t* han do_expensive_check); return cugraph::c_api::run_algorithm(graph, functor, result, error); -} \ No newline at end of file +} diff --git a/cpp/src/prims/transform_e.cuh b/cpp/src/prims/transform_e.cuh index a34a5a04b49..2cb1a5358b0 100644 --- a/cpp/src/prims/transform_e.cuh +++ b/cpp/src/prims/transform_e.cuh @@ -85,7 +85,7 @@ __global__ void transform_e_packed_bool( if (local_edge_idx < num_edges) { bool compute_predicate = true; if constexpr (check_edge_mask) { - compute_predicate = (edge_mask & packed_bool_mask(lane_id) != packed_bool_empty_mask()); + compute_predicate = ((edge_mask & packed_bool_mask(lane_id)) != packed_bool_empty_mask()); } if (compute_predicate) { @@ -111,10 +111,10 @@ __global__ void transform_e_packed_bool( uint32_t new_val = __ballot_sync(raft::warp_full_mask(), predicate); if (lane_id == 0) { if constexpr (check_edge_mask) { - *(edge_partition_e_value_output.value_first() + idx) = new_val; - } else { auto old_val = *(edge_partition_e_value_output.value_first() + idx); *(edge_partition_e_value_output.value_first() + idx) = (old_val & ~edge_mask) | new_val; + } else { + *(edge_partition_e_value_output.value_first() + idx) = new_val; } } @@ -196,6 +196,9 @@ struct update_e_value_t { __device__ void operator()(typename GraphViewType::edge_type i) const { + if constexpr (check_edge_mask) { + if (!edge_partition_e_mask.get(i)) { return; } + } auto major_idx = edge_partition.major_idx_from_local_edge_idx_nocheck(i); auto major = edge_partition.major_from_major_idx_nocheck(major_idx); auto major_offset = edge_partition.major_offset_from_major_nocheck(major); diff --git a/cpp/tests/c_api/ecg_test.c b/cpp/tests/c_api/ecg_test.c index bd759ecae74..4d4dd64572f 100644 --- a/cpp/tests/c_api/ecg_test.c +++ b/cpp/tests/c_api/ecg_test.c @@ -192,4 +192,4 @@ int main(int argc, char** argv) result |= RUN_TEST(test_ecg); result |= RUN_TEST(test_ecg_no_weight); return result; -} \ No newline at end of file +} diff --git a/cpp/tests/c_api/generate_rmat_test.c b/cpp/tests/c_api/generate_rmat_test.c index 442031ff054..f1963fc1aa1 100644 --- a/cpp/tests/c_api/generate_rmat_test.c +++ b/cpp/tests/c_api/generate_rmat_test.c @@ -32,7 +32,7 @@ int test_rmat_generation() typedef float weight_t; vertex_t expected_src[] = { 17, 18, 0, 16, 1, 24, 16, 1, 6, 4, 2, 1, 14, 2, 16, 2, 5, 23, 4, 10, 4, 3, 0, 4, 11, 0, 0, 2, 24, 0}; - vertex_t expected_dst[] = { 0, 10, 23, 0, 26, 0, 2, 1, 27, 8, 1, 0, 21, 21, 0, 4, 8, 14, 10, 17, 0, 16, 0, 16, 25, 5, 8, 8, 4, 19}; + vertex_t expected_dst[] = { 0, 10, 23, 0, 26, 0, 2, 1, 27, 8, 1, 0, 21, 21, 0, 4, 8, 14, 10, 17, 0, 16, 0, 16, 25, 5, 8, 8, 4, 19}; cugraph_error_code_t ret_code = CUGRAPH_SUCCESS; cugraph_error_t* ret_error; @@ -47,7 +47,7 @@ int test_rmat_generation() ret_code = cugraph_rng_state_create(handle, 0, &rng_state, &ret_error); TEST_ASSERT(test_ret_value, ret_code == CUGRAPH_SUCCESS, "rng_state create failed."); TEST_ALWAYS_ASSERT(ret_code == CUGRAPH_SUCCESS, cugraph_error_message(ret_error)); - + ret_code = cugraph_generate_rmat_edgelist(handle, rng_state, 5, @@ -130,7 +130,7 @@ int test_rmat_list_generation() size_t num_lists = 3; vertex_t max_vertex_id[] = { 32, 16, 32 }; size_t expected_len[] = { 20, 16, 20 }; - + ret_code = cugraph_rng_state_create(handle, 0, &rng_state, &ret_error); TEST_ASSERT(test_ret_value, ret_code == CUGRAPH_SUCCESS, "rng_state create failed."); TEST_ALWAYS_ASSERT(ret_code == CUGRAPH_SUCCESS, cugraph_error_message(ret_error)); diff --git a/cpp/tests/c_api/mg_create_graph_test.c b/cpp/tests/c_api/mg_create_graph_test.c index 7156647b025..12ae730216a 100644 --- a/cpp/tests/c_api/mg_create_graph_test.c +++ b/cpp/tests/c_api/mg_create_graph_test.c @@ -187,7 +187,7 @@ int test_create_mg_graph_multiple_edge_lists(const cugraph_resource_handle_t* ha size_t vertex_count = local_num_vertices / num_local_arrays; size_t vertex_start = i * vertex_count; vertex_count = (i != (num_local_arrays - 1)) ? vertex_count : (local_num_vertices - vertex_start); - + ret_code = cugraph_type_erased_device_array_create(handle, vertex_count, vertex_tid, vertices + i, &ret_error); TEST_ASSERT(test_ret_value, ret_code == CUGRAPH_SUCCESS, "vertices create failed."); @@ -375,7 +375,7 @@ int test_create_mg_graph_multiple_edge_lists_multi_edge(const cugraph_resource_h size_t vertex_count = (local_num_vertices + num_local_arrays - 1) / num_local_arrays; size_t vertex_start = i * vertex_count; vertex_count = (i != (num_local_arrays - 1)) ? vertex_count : (local_num_vertices - vertex_start); - + ret_code = cugraph_type_erased_device_array_create(handle, vertex_count, vertex_tid, vertices + i, &ret_error); TEST_ASSERT(test_ret_value, ret_code == CUGRAPH_SUCCESS, "vertices create failed."); diff --git a/cpp/tests/c_api/mg_ecg_test.c b/cpp/tests/c_api/mg_ecg_test.c index 846be8125e0..b14ebda2959 100644 --- a/cpp/tests/c_api/mg_ecg_test.c +++ b/cpp/tests/c_api/mg_ecg_test.c @@ -178,4 +178,4 @@ int main(int argc, char** argv) free_mg_raft_handle(raft_handle); return result; -} \ No newline at end of file +} diff --git a/cpp/tests/c_api/mg_uniform_neighbor_sample_test.c b/cpp/tests/c_api/mg_uniform_neighbor_sample_test.c index 86a0a92eb01..f84ae9975fd 100644 --- a/cpp/tests/c_api/mg_uniform_neighbor_sample_test.c +++ b/cpp/tests/c_api/mg_uniform_neighbor_sample_test.c @@ -229,7 +229,7 @@ int generic_uniform_neighbor_sample_test(const cugraph_resource_handle_t* handle for (size_t i = 1 ; i < sz ; ++i) { tmp_result_offsets[i-1] = tmp_result_offsets[i] - tmp_result_offsets[i-1]; } - + cugraph_test_host_gatherv_fill(handle, tmp_result_offsets, sz-1, SIZE_T, h_result_offsets + 1); h_result_offsets[0] = 0; @@ -255,7 +255,7 @@ int generic_uniform_neighbor_sample_test(const cugraph_resource_handle_t* handle M_w[h_src[i]][h_dst[i]] = h_wgt[i]; else M_w[h_src[i]][h_dst[i]] = 1.0; - + if (h_edge_ids != NULL) M_edge_id[h_src[i]][h_dst[i]] = h_edge_ids[i]; if (h_edge_types != NULL) M_edge_type[h_src[i]][h_dst[i]] = h_edge_types[i]; } @@ -900,7 +900,7 @@ int test_uniform_neighbor_sample_alex_bug(const cugraph_resource_handle_t* handl TEST_ASSERT(test_ret_value, result_offsets_size == expected_size[rank], "incorrect number of results"); - + cugraph_sample_result_free(result); #endif diff --git a/cpp/tests/c_api/similarity_test.c b/cpp/tests/c_api/similarity_test.c index 5637a9d2b01..ac7c3b98917 100644 --- a/cpp/tests/c_api/similarity_test.c +++ b/cpp/tests/c_api/similarity_test.c @@ -415,7 +415,7 @@ int test_all_pairs_jaccard() vertex_t h_second[] = {1, 2, 3, 4, 0, 2, 3, 5, 0, 1, 3, 4, 5, 0, 1, 2, 4, 0, 2, 3, 1, 2}; weight_t h_result[] = {0.2,0.25,0.666667,0.333333,0.2,0.4,0.166667,0.5,0.25,0.4,0.2,0.25,0.25,0.666667,0.166667,0.2,0.666667,0.333333,0.25,0.666667,0.5,0.25}; - return generic_all_pairs_similarity_test(h_src, + return generic_all_pairs_similarity_test(h_src, h_dst, h_wgt, h_first, @@ -593,7 +593,7 @@ int test_all_pairs_jaccard_topk() vertex_t h_second[] = {3, 5, 0, 4, 3, 1}; weight_t h_result[] = {0.666667, 0.5, 0.666667, 0.666667, 0.666667, 0.5}; - return generic_all_pairs_similarity_test(h_src, + return generic_all_pairs_similarity_test(h_src, h_dst, h_wgt, h_first, diff --git a/cpp/tests/c_api/uniform_neighbor_sample_test.c b/cpp/tests/c_api/uniform_neighbor_sample_test.c index 92f3821e3cc..15b2e937661 100644 --- a/cpp/tests/c_api/uniform_neighbor_sample_test.c +++ b/cpp/tests/c_api/uniform_neighbor_sample_test.c @@ -333,7 +333,7 @@ int generic_uniform_neighbor_sample_test(const cugraph_resource_handle_t* handle if (renumber_results) { size_t num_vertex_ids = 2 * (h_result_offsets[label_id+1] - h_result_offsets[label_id]); vertex_t vertex_ids[num_vertex_ids]; - + for (size_t i = 0 ; (i < (h_result_offsets[label_id+1] - h_result_offsets[label_id])) && (test_ret_value == 0) ; ++i) { vertex_ids[2*i] = h_result_srcs[h_result_offsets[label_id] + i]; vertex_ids[2*i+1] = h_result_dsts[h_result_offsets[label_id] + i]; @@ -345,7 +345,7 @@ int generic_uniform_neighbor_sample_test(const cugraph_resource_handle_t* handle for (size_t i = 0 ; (i < num_vertex_ids) && (test_ret_value == 0) ; ++i) { if (vertex_ids[i] == current_v) ++current_v; - else + else TEST_ASSERT(test_ret_value, vertex_ids[i] == (current_v - 1), "vertices are not properly renumbered"); diff --git a/datasets/README.md b/datasets/README.md index a23dc644081..53f180dfdc1 100644 --- a/datasets/README.md +++ b/datasets/README.md @@ -18,11 +18,11 @@ This directory contains small public datasets in `mtx` and `csv` format used by -### Modified datasets +### Modified datasets The datasets below were added to provide input that contains self-loops, string vertex IDs, isolated vertices, and multiple edges. -| Graph | V | E | Directed | Weighted | self-loops | Isolated V | String V IDs | Multi-edges | +| Graph | V | E | Directed | Weighted | self-loops | Isolated V | String V IDs | Multi-edges | | ------------------- | ------- | ---------- | -------- | --------- | ---------- | ---------- | ------------ | ----------- | | karate_multi_edge | 34 | 160 | No | Yes | No | No | No | Yes | | dolphins_multi_edge | 62 | 325 | No | Yes | No | No | No | Yes | @@ -46,22 +46,22 @@ The datasets below were added to provide input that contains self-loops, string ### Additional datasets -Larger datasets containing self-loops can be downloaded by running the provided script from the `datasets` directory using the `--self_loops` -option: +Larger datasets containing self-loops can be downloaded by running the provided script from the `datasets` directory using the `--self_loops` +option: ``` cd /datasets ./get_test_data.sh --self_loops ``` ``` /datasets/self_loops - |-ca-AstroPh (5.3M) + |-ca-AstroPh (5.3M) |-ca-CondMat (2.8M) |-ca-GrQc (348K) |-ca-HepTh (763K) ``` These datasets are not currently used by any tests or benchmarks -| Graph | V | E | Directed | Weighted | self-loops | Isolated V | String V IDs | Multi-edges | +| Graph | V | E | Directed | Weighted | self-loops | Isolated V | String V IDs | Multi-edges | | ------------- | ------- | -------- | -------- | -------- | ---------- | ---------- | ------------ | ----------- | | ca-AstroPh | 18,772 | 198,110 | No | No | Yes | No | No | No | | ca-CondMat | 23,133 | 93,497 | No | Yes | Yes | No | No | No | @@ -77,7 +77,7 @@ These datasets are not currently used by any tests or benchmarks **ca-HepTh** : The graph "ca-HepTh" covers scientific collaborations between authors papers submitted to High Energy Physics - Theory category in the period from January 1993 to April 2003 (124 months), as described by J. Leskovec, J. Kleinberg and C. Faloutsos in 2007. -## Custom path to larger datasets directory +## Custom path to larger datasets directory Cugraph's C++ and Python analytics tests need larger datasets (>5GB uncompressed) and reference results (>125MB uncompressed). They can be downloaded by running the provided script from the `datasets` directory. ``` @@ -133,4 +133,4 @@ _NOTE: the benchmark datasets were converted to a CSV format from their original ## Reference The SuiteSparse Matrix Collection (formerly the University of Florida Sparse Matrix Collection) : https://sparse.tamu.edu/ -The Stanford Network Analysis Platform (SNAP) +The Stanford Network Analysis Platform (SNAP) diff --git a/datasets/dolphins.mtx b/datasets/dolphins.mtx index 581940502d3..4b5bc79a180 100644 --- a/datasets/dolphins.mtx +++ b/datasets/dolphins.mtx @@ -13,25 +13,25 @@ % kind: undirected graph %------------------------------------------------------------------------------- % notes: -% Network collection from M. Newman -% http://www-personal.umich.edu/~mejn/netdata/ -% -% The graph dolphins contains an undirected social network of frequent -% associations between 62 dolphins in a community living off Doubtful Sound, -% New Zealand, as compiled by Lusseau et al. (2003). Please cite -% -% D. Lusseau, K. Schneider, O. J. Boisseau, P. Haase, E. Slooten, and +% Network collection from M. Newman +% http://www-personal.umich.edu/~mejn/netdata/ +% +% The graph dolphins contains an undirected social network of frequent +% associations between 62 dolphins in a community living off Doubtful Sound, +% New Zealand, as compiled by Lusseau et al. (2003). Please cite +% +% D. Lusseau, K. Schneider, O. J. Boisseau, P. Haase, E. Slooten, and % S. M. Dawson, The bottlenose dolphin community of Doubtful Sound features -% a large proportion of long-lasting associations, Behavioral Ecology and -% Sociobiology 54, 396-405 (2003). -% -% Additional information on the network can be found in -% -% D. Lusseau, The emergent properties of a dolphin social network, -% Proc. R. Soc. London B (suppl.) 270, S186-S188 (2003). -% -% D. Lusseau, Evidence for social role in a dolphin social network, -% Preprint q-bio/0607048 (http://arxiv.org/abs/q-bio.PE/0607048) +% a large proportion of long-lasting associations, Behavioral Ecology and +% Sociobiology 54, 396-405 (2003). +% +% Additional information on the network can be found in +% +% D. Lusseau, The emergent properties of a dolphin social network, +% Proc. R. Soc. London B (suppl.) 270, S186-S188 (2003). +% +% D. Lusseau, Evidence for social role in a dolphin social network, +% Preprint q-bio/0607048 (http://arxiv.org/abs/q-bio.PE/0607048) %------------------------------------------------------------------------------- 62 62 159 11 1 diff --git a/datasets/karate.mtx b/datasets/karate.mtx index 59df7607443..9ecdff42d7e 100644 --- a/datasets/karate.mtx +++ b/datasets/karate.mtx @@ -12,14 +12,14 @@ % kind: undirected graph %------------------------------------------------------------------------------- % notes: -% Network collection from M. Newman -% http://www-personal.umich.edu/~mejn/netdata/ -% -% The graph "karate" contains the network of friendships between the 34 -% members of a karate club at a US university, as described by Wayne Zachary +% Network collection from M. Newman +% http://www-personal.umich.edu/~mejn/netdata/ +% +% The graph "karate" contains the network of friendships between the 34 +% members of a karate club at a US university, as described by Wayne Zachary % in 1977. If you use these data in your work, please cite W. W. Zachary, An % information flow model for conflict and fission in small groups, Journal of -% Anthropological Research 33, 452-473 (1977). +% Anthropological Research 33, 452-473 (1977). %------------------------------------------------------------------------------- 34 34 78 2 1 diff --git a/datasets/karate_mod.mtx b/datasets/karate_mod.mtx index 3a562406800..072d4d9185c 100644 --- a/datasets/karate_mod.mtx +++ b/datasets/karate_mod.mtx @@ -39,7 +39,7 @@ 11 6 17 6 17 7 -31 9 +31 9 33 9 34 9 34 10 diff --git a/datasets/karate_str.mtx b/datasets/karate_str.mtx index 0564d30f91d..3708a722643 100644 --- a/datasets/karate_str.mtx +++ b/datasets/karate_str.mtx @@ -11,7 +11,7 @@ cq a9 1 ca a9 1 gd a9 1 y4 a9 1 -kx a9 1 +kx a9 1 u3 a9 1 id a9 1 ts 9q 1 diff --git a/datasets/netscience.mtx b/datasets/netscience.mtx index 71a75131995..8e1c0c1077c 100644 --- a/datasets/netscience.mtx +++ b/datasets/netscience.mtx @@ -13,23 +13,23 @@ % kind: undirected weighted graph %------------------------------------------------------------------------------- % notes: -% Network collection from M. Newman -% http://www-personal.umich.edu/~mejn/netdata/ -% -% The graph netscience contains a coauthorship network of scientists -% working on network theory and experiment, as compiled by M. Newman in May -% 2006. The network was compiled from the bibliographies of two review -% articles on networks, M. E. J. Newman, SIAM Review 45, 167-256 (2003) and -% S. Boccaletti et al., Physics Reports 424, 175-308 (2006), with a few -% additional references added by hand. The version given here contains all +% Network collection from M. Newman +% http://www-personal.umich.edu/~mejn/netdata/ +% +% The graph netscience contains a coauthorship network of scientists +% working on network theory and experiment, as compiled by M. Newman in May +% 2006. The network was compiled from the bibliographies of two review +% articles on networks, M. E. J. Newman, SIAM Review 45, 167-256 (2003) and +% S. Boccaletti et al., Physics Reports 424, 175-308 (2006), with a few +% additional references added by hand. The version given here contains all % components of the network, for a total of 1589 scientists, and not just the -% largest component of 379 scientists previously published. The network is -% weighted, with weights assigned as described in M. E. J. Newman, -% Phys. Rev. E 64, 016132 (2001). -% -% If you make use of these data, please cite M. E. J. Newman, Finding -% community structure in networks using the eigenvectors of matrices, -% Preprint physics/0605087 (2006). +% largest component of 379 scientists previously published. The network is +% weighted, with weights assigned as described in M. E. J. Newman, +% Phys. Rev. E 64, 016132 (2001). +% +% If you make use of these data, please cite M. E. J. Newman, Finding +% community structure in networks using the eigenvectors of matrices, +% Preprint physics/0605087 (2006). %------------------------------------------------------------------------------- 1589 1589 2742 2 1 2.5 diff --git a/datasets/polbooks.mtx b/datasets/polbooks.mtx index 65266677b39..30479086d0a 100644 --- a/datasets/polbooks.mtx +++ b/datasets/polbooks.mtx @@ -13,24 +13,24 @@ % kind: undirected graph %------------------------------------------------------------------------------- % notes: -% Network collection from M. Newman -% http://www-personal.umich.edu/~mejn/netdata/ -% -% Books about US politics -% Compiled by Valdis Krebs -% -% Nodes represent books about US politics sold by the online bookseller -% Amazon.com. Edges represent frequent co-purchasing of books by the same -% buyers, as indicated by the "customers who bought this book also bought -% these other books" feature on Amazon. -% +% Network collection from M. Newman +% http://www-personal.umich.edu/~mejn/netdata/ +% +% Books about US politics +% Compiled by Valdis Krebs +% +% Nodes represent books about US politics sold by the online bookseller +% Amazon.com. Edges represent frequent co-purchasing of books by the same +% buyers, as indicated by the "customers who bought this book also bought +% these other books" feature on Amazon. +% % Nodes have been given values "l", "n", or "c" to indicate whether they are -% "liberal", "neutral", or "conservative". These alignments were assigned -% separately by Mark Newman based on a reading of the descriptions and -% reviews of the books posted on Amazon. -% -% These data should be cited as V. Krebs, unpublished, -% http://www.orgnet.com/. +% "liberal", "neutral", or "conservative". These alignments were assigned +% separately by Mark Newman based on a reading of the descriptions and +% reviews of the books posted on Amazon. +% +% These data should be cited as V. Krebs, unpublished, +% http://www.orgnet.com/. %------------------------------------------------------------------------------- 105 105 441 2 1 diff --git a/datasets/small_line.csv b/datasets/small_line.csv index 68751f432a2..55494314212 100644 --- a/datasets/small_line.csv +++ b/datasets/small_line.csv @@ -6,4 +6,4 @@ 5 6 1.0 6 7 1.0 7 8 1.0 -8 9 1.0 \ No newline at end of file +8 9 1.0 diff --git a/datasets/toy_graph.csv b/datasets/toy_graph.csv index 02069f5e153..cb07d7b1ff9 100644 --- a/datasets/toy_graph.csv +++ b/datasets/toy_graph.csv @@ -13,4 +13,4 @@ 1 2 3.1 3 2 4.1 5 3 7.2 -5 4 3.2 \ No newline at end of file +5 4 3.2 diff --git a/datasets/toy_graph_undirected.csv b/datasets/toy_graph_undirected.csv index dec4a956c85..cafd02ae285 100644 --- a/datasets/toy_graph_undirected.csv +++ b/datasets/toy_graph_undirected.csv @@ -5,4 +5,4 @@ 2 1 3.1 2 3 4.1 3 5 7.2 -4 5 3.2 \ No newline at end of file +4 5 3.2 diff --git a/docs/cugraph/Makefile b/docs/cugraph/Makefile index f92d0be6910..ac16367ef52 100644 --- a/docs/cugraph/Makefile +++ b/docs/cugraph/Makefile @@ -23,4 +23,4 @@ clean: # Catch-all target: route all unknown targets to Sphinx using the new # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). %: Makefile - @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) \ No newline at end of file + @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) diff --git a/docs/cugraph/README.md b/docs/cugraph/README.md index 734867af965..970a03a040c 100644 --- a/docs/cugraph/README.md +++ b/docs/cugraph/README.md @@ -5,7 +5,7 @@ All prerequisite for building docs are in the cugraph development conda environm ## Steps to follow: -In order to build the docs, we need the conda dev environment from cugraph and we need to build cugraph from source. +In order to build the docs, we need the conda dev environment from cugraph and we need to build cugraph from source. 1. Create a conda env and build cugraph from source. The dependencies to build rapids from source are installed in that conda environment, and then rapids is built and installed into the same environment. diff --git a/docs/cugraph/source/_static/references.css b/docs/cugraph/source/_static/references.css index 225cf13ba94..d1f647233a8 100644 --- a/docs/cugraph/source/_static/references.css +++ b/docs/cugraph/source/_static/references.css @@ -20,4 +20,4 @@ dl.citation > dt.label > span::before { /* Add closing bracket */ dl.citation > dt.label > span::after { content: "]"; -} \ No newline at end of file +} diff --git a/docs/cugraph/source/api_docs/cugraph-ops/c_cpp/index.rst b/docs/cugraph/source/api_docs/cugraph-ops/c_cpp/index.rst index 5545bebe975..39dae955ef3 100644 --- a/docs/cugraph/source/api_docs/cugraph-ops/c_cpp/index.rst +++ b/docs/cugraph/source/api_docs/cugraph-ops/c_cpp/index.rst @@ -1,3 +1,2 @@ cugraph-ops C++ API Reference ============================= - diff --git a/docs/cugraph/source/api_docs/cugraph-ops/index.rst b/docs/cugraph/source/api_docs/cugraph-ops/index.rst index fdfd5baab96..0f6a6c937d3 100644 --- a/docs/cugraph/source/api_docs/cugraph-ops/index.rst +++ b/docs/cugraph/source/api_docs/cugraph-ops/index.rst @@ -8,4 +8,4 @@ This page provides a list of all publicly accessible modules, methods and classe :caption: API Documentation python/index - c_cpp/index \ No newline at end of file + c_cpp/index diff --git a/docs/cugraph/source/api_docs/cugraph-ops/python/index.rst b/docs/cugraph/source/api_docs/cugraph-ops/python/index.rst index 082c7741f23..fb25f2fa005 100644 --- a/docs/cugraph/source/api_docs/cugraph-ops/python/index.rst +++ b/docs/cugraph/source/api_docs/cugraph-ops/python/index.rst @@ -1,5 +1,5 @@ cugraph-ops Python API reference -================================ +================================ This page provides a list of all publicly accessible modules, methods and classes through `pylibcugraphops.*` namespace. diff --git a/docs/cugraph/source/api_docs/cugraph-pyg/cugraph_pyg.rst b/docs/cugraph/source/api_docs/cugraph-pyg/cugraph_pyg.rst index f7d7f5f2262..a150d4db9fe 100644 --- a/docs/cugraph/source/api_docs/cugraph-pyg/cugraph_pyg.rst +++ b/docs/cugraph/source/api_docs/cugraph-pyg/cugraph_pyg.rst @@ -11,4 +11,3 @@ cugraph-pyg .. cugraph_pyg.data.cugraph_store.EXPERIMENTAL__CuGraphStore .. cugraph_pyg.sampler.cugraph_sampler.EXPERIMENTAL__CuGraphSampler - diff --git a/docs/cugraph/source/api_docs/cugraph/components.rst b/docs/cugraph/source/api_docs/cugraph/components.rst index 560aa1f8ca0..e61291fccf0 100644 --- a/docs/cugraph/source/api_docs/cugraph/components.rst +++ b/docs/cugraph/source/api_docs/cugraph/components.rst @@ -20,4 +20,3 @@ Connected Components (MG) :toctree: ../api/cugraph/ cugraph.dask.components.connectivity.weakly_connected_components - diff --git a/docs/cugraph/source/api_docs/cugraph/dask-cugraph.rst b/docs/cugraph/source/api_docs/cugraph/dask-cugraph.rst index a2d49789053..d9ba3f3a792 100644 --- a/docs/cugraph/source/api_docs/cugraph/dask-cugraph.rst +++ b/docs/cugraph/source/api_docs/cugraph/dask-cugraph.rst @@ -48,12 +48,12 @@ Example ) input_data.to_csv(input_data_path, index=False) - # helper function to set the reader chunk size to automatically get one partition per GPU + # helper function to set the reader chunk size to automatically get one partition per GPU chunksize = dask_cugraph.get_chunksize(input_data_path) # multi-GPU CSV reader e_list = dask_cudf.read_csv( - input_data_path, + input_data_path, chunksize=chunksize, names=['src', 'dst'], dtype=['int32', 'int32'], diff --git a/docs/cugraph/source/api_docs/cugraph/generators.rst b/docs/cugraph/source/api_docs/cugraph/generators.rst index 4f93d943e6c..f5180a172cd 100644 --- a/docs/cugraph/source/api_docs/cugraph/generators.rst +++ b/docs/cugraph/source/api_docs/cugraph/generators.rst @@ -11,4 +11,3 @@ RMAT :toctree: ../api/cugraph/ cugraph.generators.rmat - diff --git a/docs/cugraph/source/api_docs/cugraph/graph_implementation.rst b/docs/cugraph/source/api_docs/cugraph/graph_implementation.rst index 91c16c24248..ae14306ce27 100644 --- a/docs/cugraph/source/api_docs/cugraph/graph_implementation.rst +++ b/docs/cugraph/source/api_docs/cugraph/graph_implementation.rst @@ -31,4 +31,4 @@ Graph Implementation edges nodes neighbors - vertex_column_size \ No newline at end of file + vertex_column_size diff --git a/docs/cugraph/source/api_docs/cugraph/helper_functions.rst b/docs/cugraph/source/api_docs/cugraph/helper_functions.rst index 02cb599ae55..e7091c50c44 100644 --- a/docs/cugraph/source/api_docs/cugraph/helper_functions.rst +++ b/docs/cugraph/source/api_docs/cugraph/helper_functions.rst @@ -20,4 +20,3 @@ Methods cugraph.dask.comms.comms.get_handle cugraph.dask.comms.comms.get_worker_id cugraph.dask.common.read_utils.get_chunksize - diff --git a/docs/cugraph/source/api_docs/cugraph/layout.rst b/docs/cugraph/source/api_docs/cugraph/layout.rst index ed97caf549f..d416676a62e 100644 --- a/docs/cugraph/source/api_docs/cugraph/layout.rst +++ b/docs/cugraph/source/api_docs/cugraph/layout.rst @@ -10,4 +10,3 @@ Force Atlas 2 :toctree: ../api/cugraph/ cugraph.force_atlas2 - diff --git a/docs/cugraph/source/api_docs/cugraph/link_analysis.rst b/docs/cugraph/source/api_docs/cugraph/link_analysis.rst index 48b5ec1176f..698880c1b9e 100644 --- a/docs/cugraph/source/api_docs/cugraph/link_analysis.rst +++ b/docs/cugraph/source/api_docs/cugraph/link_analysis.rst @@ -32,4 +32,3 @@ Pagerank (MG) :toctree: ../api/cugraph/ cugraph.dask.link_analysis.pagerank.pagerank - diff --git a/docs/cugraph/source/api_docs/cugraph/tree.rst b/docs/cugraph/source/api_docs/cugraph/tree.rst index 5ba2242ebb6..d8a89046aa3 100644 --- a/docs/cugraph/source/api_docs/cugraph/tree.rst +++ b/docs/cugraph/source/api_docs/cugraph/tree.rst @@ -18,4 +18,3 @@ Maximum Spanning Tree :toctree: ../api/cugraph/ cugraph.tree.minimum_spanning_tree.maximum_spanning_tree - diff --git a/docs/cugraph/source/api_docs/cugraph_c/centrality.rst b/docs/cugraph/source/api_docs/cugraph_c/centrality.rst index f34e26ad76e..3bea608fd5a 100644 --- a/docs/cugraph/source/api_docs/cugraph_c/centrality.rst +++ b/docs/cugraph/source/api_docs/cugraph_c/centrality.rst @@ -48,4 +48,3 @@ Centrality Support Functions :project: libcugraph :members: :content-only: - diff --git a/docs/cugraph/source/api_docs/cugraph_c/community.rst b/docs/cugraph/source/api_docs/cugraph_c/community.rst index d55325720c4..6b500a972a7 100644 --- a/docs/cugraph/source/api_docs/cugraph_c/community.rst +++ b/docs/cugraph/source/api_docs/cugraph_c/community.rst @@ -54,4 +54,3 @@ Community Support Functions :project: libcugraph :members: :content-only: - diff --git a/docs/cugraph/source/api_docs/cugraph_c/labeling.rst b/docs/cugraph/source/api_docs/cugraph_c/labeling.rst index 4ca598c0a06..2b709ebd343 100644 --- a/docs/cugraph/source/api_docs/cugraph_c/labeling.rst +++ b/docs/cugraph/source/api_docs/cugraph_c/labeling.rst @@ -17,4 +17,4 @@ Labeling Support Functions .. doxygengroup:: labeling :project: libcugraph :members: - :content-only: \ No newline at end of file + :content-only: diff --git a/docs/cugraph/source/api_docs/cugraph_c/similarity.rst b/docs/cugraph/source/api_docs/cugraph_c/similarity.rst index 200ba695781..75735925e4d 100644 --- a/docs/cugraph/source/api_docs/cugraph_c/similarity.rst +++ b/docs/cugraph/source/api_docs/cugraph_c/similarity.rst @@ -22,4 +22,4 @@ Similarty Support Functions .. doxygengroup:: similarity :project: libcugraph :members: - :content-only: \ No newline at end of file + :content-only: diff --git a/docs/cugraph/source/api_docs/cugraph_c/traversal.rst b/docs/cugraph/source/api_docs/cugraph_c/traversal.rst index 1578951e05f..bde30f4fa6e 100644 --- a/docs/cugraph/source/api_docs/cugraph_c/traversal.rst +++ b/docs/cugraph/source/api_docs/cugraph_c/traversal.rst @@ -27,4 +27,4 @@ Traversal Support Functions .. doxygengroup:: traversal :project: libcugraph :members: - :content-only: \ No newline at end of file + :content-only: diff --git a/docs/cugraph/source/api_docs/index.rst b/docs/cugraph/source/api_docs/index.rst index 74ca98bb98d..1b907165a39 100644 --- a/docs/cugraph/source/api_docs/index.rst +++ b/docs/cugraph/source/api_docs/index.rst @@ -35,5 +35,3 @@ Additional Graph Packages API Documentation :caption: Additional Graph Packages API Documentation service/index.rst - - diff --git a/docs/cugraph/source/api_docs/service/index.rst b/docs/cugraph/source/api_docs/service/index.rst index a58cf207456..ca251e475d4 100644 --- a/docs/cugraph/source/api_docs/service/index.rst +++ b/docs/cugraph/source/api_docs/service/index.rst @@ -7,4 +7,4 @@ cugraph-service API Reference :caption: cugraph-service API Documentation cugraph_service_client - cugraph_service_server \ No newline at end of file + cugraph_service_server diff --git a/docs/cugraph/source/basics/cugraph_cascading.md b/docs/cugraph/source/basics/cugraph_cascading.md index 7795e9e007a..bad3d7fa6a8 100644 --- a/docs/cugraph/source/basics/cugraph_cascading.md +++ b/docs/cugraph/source/basics/cugraph_cascading.md @@ -3,7 +3,7 @@ BLUF: cuGraph does not support method cascading -[Method Cascading](https://en.wikipedia.org/wiki/Method_cascading) is a popular, and useful, functional programming concept and is a great way to make code more readable. Python supports method cascading ... _for the most part_. There are a number of Python built-in classes that do not support cascading. +[Method Cascading](https://en.wikipedia.org/wiki/Method_cascading) is a popular, and useful, functional programming concept and is a great way to make code more readable. Python supports method cascading ... _for the most part_. There are a number of Python built-in classes that do not support cascading. An example, from cuDF, is a sequence of method calls for loading data and then finding the largest values from a subset of the data (yes there are other ways this could be done): @@ -11,13 +11,13 @@ An example, from cuDF, is a sequence of method calls for loading data and then gdf = cudf.from_pandas(df).query(‘val > 200’).nlargest(‘va’3) ``` -cuGraph does not support method cascading for two main reasons: (1) the object-oriented nature of the Graph data object leverages in-place methods, and (2) the fact that algorithms operate on graphs rather than graphs running algorithms. +cuGraph does not support method cascading for two main reasons: (1) the object-oriented nature of the Graph data object leverages in-place methods, and (2) the fact that algorithms operate on graphs rather than graphs running algorithms. ## Graph Data Objects -cuGraph follows an object-oriented design for the Graph objects. Users create a Graph and can then add data to object, but every add method call returns `None`. +cuGraph follows an object-oriented design for the Graph objects. Users create a Graph and can then add data to object, but every add method call returns `None`. _Why Inplace methods?_
-cuGraph focuses on the big graph problems where there are 10s of millions to trillions of edges (Giga bytes to Terabytes of data). At that scale, creating a copy of the data becomes memory inefficient. +cuGraph focuses on the big graph problems where there are 10s of millions to trillions of edges (Giga bytes to Terabytes of data). At that scale, creating a copy of the data becomes memory inefficient. _Why not return `self` rather than `None`?_
It would be simple to modify the methods to return `self` rather than `None`, however it opens the methods to misinterpretation. Consider the following code: diff --git a/docs/cugraph/source/basics/cugraph_intro.md b/docs/cugraph/source/basics/cugraph_intro.md index 10d14f8a0d7..7ad2825604a 100644 --- a/docs/cugraph/source/basics/cugraph_intro.md +++ b/docs/cugraph/source/basics/cugraph_intro.md @@ -1,51 +1,51 @@ # cuGraph Introduction -The Data Scientist has a collection of techniques within their -proverbial toolbox. Data engineering, statistical analysis, and -machine learning are among the most commonly known. However, there -are numerous cases where the focus of the analysis is on the -relationship between data elements. In those cases, the data is best -represented as a graph. Graph analysis, also called network analysis, -is a collection of algorithms for answering questions posed against +The Data Scientist has a collection of techniques within their +proverbial toolbox. Data engineering, statistical analysis, and +machine learning are among the most commonly known. However, there +are numerous cases where the focus of the analysis is on the +relationship between data elements. In those cases, the data is best +represented as a graph. Graph analysis, also called network analysis, +is a collection of algorithms for answering questions posed against graph data. Graph analysis is not new. -The first graph problem was posed by Euler in 1736, the [Seven Bridges of -Konigsberg](https://en.wikipedia.org/wiki/Seven_Bridges_of_K%C3%B6nigsberg), -and laid the foundation for the mathematical field of graph theory. -The application of graph analysis covers a wide variety of fields, including +The first graph problem was posed by Euler in 1736, the [Seven Bridges of +Konigsberg](https://en.wikipedia.org/wiki/Seven_Bridges_of_K%C3%B6nigsberg), +and laid the foundation for the mathematical field of graph theory. +The application of graph analysis covers a wide variety of fields, including marketing, biology, physics, computer science, sociology, and cyber to name a few. -RAPIDS cuGraph is a library of graph algorithms that seamlessly integrates -into the RAPIDS data science ecosystem and allows the data scientist to easily -call graph algorithms using data stored in a GPU DataFrame, NetworkX Graphs, or even -CuPy or SciPy sparse Matrix. +RAPIDS cuGraph is a library of graph algorithms that seamlessly integrates +into the RAPIDS data science ecosystem and allows the data scientist to easily +call graph algorithms using data stored in a GPU DataFrame, NetworkX Graphs, or even +CuPy or SciPy sparse Matrix. ## Vision -The vision of RAPIDS cuGraph is to ___make graph analysis ubiquitous to the -point that users just think in terms of analysis and not technologies or -frameworks___. This is a goal that many of us on the cuGraph team have been -working on for almost twenty years. Many of the early attempts focused on -solving one problem or using one technique. Those early attempts worked for -the initial goal but tended to break as the scope changed (e.g., shifting -to solving a dynamic graph problem with a static graph solution). The limiting -factors usually came down to compute power, ease-of-use, or choosing a data -structure that was not suited for all problems. NVIDIA GPUs, CUDA, and RAPIDS -have totally changed the paradigm and the goal of an accelerated unified graph +The vision of RAPIDS cuGraph is to ___make graph analysis ubiquitous to the +point that users just think in terms of analysis and not technologies or +frameworks___. This is a goal that many of us on the cuGraph team have been +working on for almost twenty years. Many of the early attempts focused on +solving one problem or using one technique. Those early attempts worked for +the initial goal but tended to break as the scope changed (e.g., shifting +to solving a dynamic graph problem with a static graph solution). The limiting +factors usually came down to compute power, ease-of-use, or choosing a data +structure that was not suited for all problems. NVIDIA GPUs, CUDA, and RAPIDS +have totally changed the paradigm and the goal of an accelerated unified graph analytic library is now possible. -The compute power of the latest NVIDIA GPUs (RAPIDS supports Pascal and later -GPU architectures) make graph analytics 1000x faster on average over NetworkX. -Moreover, the internal memory speed within a GPU allows cuGraph to rapidly -switch the data structure to best suit the needs of the analytic rather than -being restricted to a single data structure. cuGraph is working with several -frameworks for both static and dynamic graph data structures so that we always -have a solution to any graph problem. Since Python has emerged as the de facto -language for data science, allowing interactivity and the ability to run graph -analytics in Python makes cuGraph familiar and approachable. RAPIDS wraps all -the graph analytic goodness mentioned above with the ability to perform -high-speed ETL, statistics, and machine learning. To make things even better, -RAPIDS and DASK allows cuGraph to scale to multiple GPUs to support +The compute power of the latest NVIDIA GPUs (RAPIDS supports Pascal and later +GPU architectures) make graph analytics 1000x faster on average over NetworkX. +Moreover, the internal memory speed within a GPU allows cuGraph to rapidly +switch the data structure to best suit the needs of the analytic rather than +being restricted to a single data structure. cuGraph is working with several +frameworks for both static and dynamic graph data structures so that we always +have a solution to any graph problem. Since Python has emerged as the de facto +language for data science, allowing interactivity and the ability to run graph +analytics in Python makes cuGraph familiar and approachable. RAPIDS wraps all +the graph analytic goodness mentioned above with the ability to perform +high-speed ETL, statistics, and machine learning. To make things even better, +RAPIDS and DASK allows cuGraph to scale to multiple GPUs to support multi-billion edge graphs. @@ -65,9 +65,4 @@ possible. However, each field has its own argot (jargon) for describing the graph (or network). In our documentation, we try to be consistent. In Python documentation we will mostly use the terms __Node__ and __Edge__ to better match NetworkX preferred term use, as well as other Python-based tools. At -the CUDA/C layer, we favor the mathematical terms of __Vertex__ and __Edge__. - - - - - \ No newline at end of file +the CUDA/C layer, we favor the mathematical terms of __Vertex__ and __Edge__. diff --git a/docs/cugraph/source/basics/nx_transition.rst b/docs/cugraph/source/basics/nx_transition.rst index 3d116162c09..9849865814d 100644 --- a/docs/cugraph/source/basics/nx_transition.rst +++ b/docs/cugraph/source/basics/nx_transition.rst @@ -2,7 +2,7 @@ NetworkX Compatibility and Transition ************************************** -*Note: this is a work in progress and will be updatred and changed as we better flesh out +*Note: this is a work in progress and will be updatred and changed as we better flesh out compatibility issues* One of the goals of RAPIDS cuGraph is to mimic the NetworkX API to simplify @@ -13,7 +13,7 @@ and then the construction of a graph object; that is all before the execution of a graph algorithm. RAPIDS and cuGraph allow a portion or the complete analytic workflow to be accelerated. To achieve the maximum amount of acceleration, we encourage fully replacing existing code with cuGraph. -But sometimes it is easier to replace just a portion. +But sometimes it is easier to replace just a portion. Last Update ########### @@ -23,7 +23,7 @@ Release: 0.16 Information on `NetworkX `_ -This transition guide in an expansion of the Medium Blog on `NetworkX Compatibility +This transition guide in an expansion of the Medium Blog on `NetworkX Compatibility `_ @@ -33,7 +33,7 @@ Easy Path – Use NetworkX Graph Objects, Accelerated Algorithms Rather than updating all of your existing code, simply update the calls to graph algorithms by replacing the module name. This allows all the complicated ETL code to be unchanged while still seeing significate performance -improvements. +improvements. In the following example, the cuGraph module is being imported as “cnx”. While module can be assigned any name can be used, we picked cnx to reduce @@ -44,10 +44,10 @@ changes. :width: 600 It is that easy. All algorithms in cuGraph support a NetworkX graph object as -input and match the NetworkX API list of arguments. +input and match the NetworkX API list of arguments. Currently, cuGraph accepts both NetworkX Graph and DiGraph objects. We will be -adding support for Bipartite graph and Multigraph over the next few releases. +adding support for Bipartite graph and Multigraph over the next few releases. | @@ -58,7 +58,7 @@ Differences in Algorithms Since cuGraph currently does not support attribute rich graphs, those algorithms that return simple scores (centrality, clustering, etc.) best match the NetworkX process. Algorithms that return a subgraph will do so without -any additional attributes on the nodes or edges. +any additional attributes on the nodes or edges. Algorithms that exactly match ***************************** @@ -142,8 +142,8 @@ Algorithms where the results are different ****************************************** -For example, the NetworkX traversal algorithms typically return a generator -rather than a dictionary. +For example, the NetworkX traversal algorithms typically return a generator +rather than a dictionary. +----------------------------+-------------------------------------------------+ @@ -154,7 +154,7 @@ rather than a dictionary. | | (on roadmap to update) | +----------------------------+-------------------------------------------------+ | Jaccard coefficient | Currently we only do a 1-hop computation rather | -| | than an all-pairs. Fix is on roadmap | +| | than an all-pairs. Fix is on roadmap | +----------------------------+-------------------------------------------------+ | Breadth First Search (BFS) | Returns a Pandas DataFrame with: | | | [vertex][distance][predecessor] | @@ -185,14 +185,13 @@ code for building a NetworkX Graph:: ) -The code block is perfectly fine for NetworkX. However, the process of iterating over the dataframe and adding one node at a time is problematic for GPUs and something that we try and avoid. cuGraph stores data in columns (i.e. arrays). Resizing an array requires allocating a new array one element larger, copying the data, and adding the new value. That is not very efficient. +The code block is perfectly fine for NetworkX. However, the process of iterating over the dataframe and adding one node at a time is problematic for GPUs and something that we try and avoid. cuGraph stores data in columns (i.e. arrays). Resizing an array requires allocating a new array one element larger, copying the data, and adding the new value. That is not very efficient. -If your code follows the above model of inserting one element at a time, the we suggest either rewriting that code or using it as is within NetworkX and just accelerating the algorithms with cuGraph. +If your code follows the above model of inserting one element at a time, the we suggest either rewriting that code or using it as is within NetworkX and just accelerating the algorithms with cuGraph. Now, if your code bulk loads the data from Pandas, then RAPIDS can accelerate that process by orders of magnitude. .. image:: ../images/Nx_Cg_2.png :width: 600 -The above cuGraph code will create cuGraph.Graph object and not a NetworkX.Graph object. - +The above cuGraph code will create cuGraph.Graph object and not a NetworkX.Graph object. diff --git a/docs/cugraph/source/dev_resources/API.rst b/docs/cugraph/source/dev_resources/API.rst index 409e307fd9f..e32315d2fb9 100644 --- a/docs/cugraph/source/dev_resources/API.rst +++ b/docs/cugraph/source/dev_resources/API.rst @@ -2,4 +2,4 @@ API === -https://docs.rapids.ai/api/cugraph/nightly/api_docs/index.html \ No newline at end of file +https://docs.rapids.ai/api/cugraph/nightly/api_docs/index.html diff --git a/docs/cugraph/source/dev_resources/index.rst b/docs/cugraph/source/dev_resources/index.rst index 8568772b35c..fc2c4f4780f 100644 --- a/docs/cugraph/source/dev_resources/index.rst +++ b/docs/cugraph/source/dev_resources/index.rst @@ -7,4 +7,4 @@ Developer Resources :maxdepth: 3 https://docs.rapids.ai/maintainers - API.rst \ No newline at end of file + API.rst diff --git a/docs/cugraph/source/graph_support/DGL_support.md b/docs/cugraph/source/graph_support/DGL_support.md index fc1f1b45bde..dc4f66180ac 100644 --- a/docs/cugraph/source/graph_support/DGL_support.md +++ b/docs/cugraph/source/graph_support/DGL_support.md @@ -2,7 +2,7 @@ ## Description -[RAPIDS](https://rapids.ai) cugraph_dgl provides a duck-typed version of the [DGLGraph](https://docs.dgl.ai/api/python/dgl.DGLGraph.html#dgl.DGLGraph) class, which uses cugraph for storing graph structure and node/edge feature data. Using cugraph as the backend allows DGL users to access a collection of GPU accelerated algorithms for graph analytics, such as centrality computation and community detection. +[RAPIDS](https://rapids.ai) cugraph_dgl provides a duck-typed version of the [DGLGraph](https://docs.dgl.ai/api/python/dgl.DGLGraph.html#dgl.DGLGraph) class, which uses cugraph for storing graph structure and node/edge feature data. Using cugraph as the backend allows DGL users to access a collection of GPU accelerated algorithms for graph analytics, such as centrality computation and community detection. ## Conda @@ -22,7 +22,7 @@ mamba env create -n cugraph_dgl_dev --file conda/cugraph_dgl_dev_11.6.yml ### Install in editable mode ``` -pip install -e . +pip install -e . ``` ### Run tests @@ -43,12 +43,12 @@ sampler = dgl.dataloading.NeighborSampler( train_dataloader = dgl.dataloading.DataLoader( cugraph_g, -train_idx, -sampler, -device=device, +train_idx, +sampler, +device=device, batch_size=1024, shuffle=True, -drop_last=False, +drop_last=False, num_workers=0) ``` diff --git a/docs/cugraph/source/graph_support/PyG_support.md b/docs/cugraph/source/graph_support/PyG_support.md index 42d4d1c5506..b57ce7fcc6f 100644 --- a/docs/cugraph/source/graph_support/PyG_support.md +++ b/docs/cugraph/source/graph_support/PyG_support.md @@ -1,3 +1,3 @@ # cugraph_pyg -[RAPIDS](https://rapids.ai) cugraph_pyg enables the ability to use cugraph graph storage and sampling with PyTorch Geometric (PyG). PyG users will have access to cuGraph through the PyG GraphStore, FeatureStore, and Sampler interfaces. \ No newline at end of file +[RAPIDS](https://rapids.ai) cugraph_pyg enables the ability to use cugraph graph storage and sampling with PyTorch Geometric (PyG). PyG users will have access to cuGraph through the PyG GraphStore, FeatureStore, and Sampler interfaces. diff --git a/docs/cugraph/source/graph_support/algorithms.md b/docs/cugraph/source/graph_support/algorithms.md index a1b80e92751..8a5158f2f56 100644 --- a/docs/cugraph/source/graph_support/algorithms.md +++ b/docs/cugraph/source/graph_support/algorithms.md @@ -92,4 +92,4 @@ Copyright (c) 2019 - 2023, 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. -___ \ No newline at end of file +___ diff --git a/docs/cugraph/source/graph_support/algorithms/Similarity.md b/docs/cugraph/source/graph_support/algorithms/Similarity.md index 18c0a94d519..96adc25ea69 100644 --- a/docs/cugraph/source/graph_support/algorithms/Similarity.md +++ b/docs/cugraph/source/graph_support/algorithms/Similarity.md @@ -5,8 +5,8 @@ The RAPIDS cuGraph Similarity folder contain a collection of Jupyter Notebooks t Results of Similarity algorithms are often used to answer questions like: * Could two vertices be duplicates or aliases of the same actor? * Can we predict missing edges based of the similarity between two nodes? -* Are multiple similar communities within the graph? -* Can I create recommendations based on the similarity between vertices in the graph. +* Are multiple similar communities within the graph? +* Can I create recommendations based on the similarity between vertices in the graph. Manipulation of the data before or after the graph analytic is not covered here. Extended, more problem focused, notebooks are being created and available https://github.com/rapidsai/notebooks-extended @@ -35,4 +35,4 @@ Copyright (c) 2019 - 2023, 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. -___ \ No newline at end of file +___ diff --git a/docs/cugraph/source/graph_support/algorithms/betweenness_centrality.md b/docs/cugraph/source/graph_support/algorithms/betweenness_centrality.md index 7dc692684aa..89e5e0bdb92 100644 --- a/docs/cugraph/source/graph_support/algorithms/betweenness_centrality.md +++ b/docs/cugraph/source/graph_support/algorithms/betweenness_centrality.md @@ -39,4 +39,4 @@ Copyright (c) 2023, 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. -___ \ No newline at end of file +___ diff --git a/docs/cugraph/source/graph_support/algorithms/degree_centrality.md b/docs/cugraph/source/graph_support/algorithms/degree_centrality.md index 64fe694e4c1..9253c665fb0 100644 --- a/docs/cugraph/source/graph_support/algorithms/degree_centrality.md +++ b/docs/cugraph/source/graph_support/algorithms/degree_centrality.md @@ -11,7 +11,7 @@ Degree centrality of a vertex 𝑣 is the sum of the edges incident on that node * When you need a really quick identifcation of important nodes on very simply structured data. * In cases like collaboration networks where all links have equal importance. * In many biologic and transportation networks, shear number of connections is important to itentify critical nodes whether they be proteins or airports. -* In huge graphs, Degree centrality is a the quickest +* In huge graphs, Degree centrality is a the quickest ## When not to use Degree Centrality * When weights, edge direction or edge types matter @@ -29,4 +29,4 @@ Copyright (c) 2023, 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. -___ \ No newline at end of file +___ diff --git a/docs/cugraph/source/graph_support/algorithms/eigenvector_centrality.md b/docs/cugraph/source/graph_support/algorithms/eigenvector_centrality.md index 5217dc497db..8a9c7c7c767 100644 --- a/docs/cugraph/source/graph_support/algorithms/eigenvector_centrality.md +++ b/docs/cugraph/source/graph_support/algorithms/eigenvector_centrality.md @@ -18,11 +18,11 @@ Where M(v) is the adjacency list for the set of vertices(v) and λ is a constant ## When to use Eigenvector Centrality * When the quality and quantity of edges matters, in other words, connections to other high-degree nodes is important -* To calculate influence in nuanced networks like social and financial networks. +* To calculate influence in nuanced networks like social and financial networks. ## When not to use Eigenvector Centrality * in graphs with many disconnected groups -* in graphs containing many distinct and different communities +* in graphs containing many distinct and different communities * in networks with negative weights * in huge networks eigenvector centrality can become computationally infeasible in single threaded systems. @@ -39,4 +39,3 @@ Licensed under the Apache License, Version 2.0 (the "License"); you may not use 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. ___ - diff --git a/docs/cugraph/source/graph_support/algorithms/jaccard_similarity.md b/docs/cugraph/source/graph_support/algorithms/jaccard_similarity.md index c9ffc76d182..dde98d71ea3 100644 --- a/docs/cugraph/source/graph_support/algorithms/jaccard_similarity.md +++ b/docs/cugraph/source/graph_support/algorithms/jaccard_similarity.md @@ -1,6 +1,6 @@ # Jaccard Similarity -The Jaccard similarity between two sets is defined as the ratio of the volume of their intersection divided by the volume of their union. +The Jaccard similarity between two sets is defined as the ratio of the volume of their intersection divided by the volume of their union. The Jaccard Similarity can then be defined as @@ -31,4 +31,4 @@ Copyright (c) 2023, 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. -___ \ No newline at end of file +___ diff --git a/docs/cugraph/source/graph_support/algorithms/katz_centrality.md b/docs/cugraph/source/graph_support/algorithms/katz_centrality.md index 3bfe4d40c05..69b5d6b27b9 100644 --- a/docs/cugraph/source/graph_support/algorithms/katz_centrality.md +++ b/docs/cugraph/source/graph_support/algorithms/katz_centrality.md @@ -25,4 +25,4 @@ Copyright (c) 2023, 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. -___ \ No newline at end of file +___ diff --git a/docs/cugraph/source/graph_support/algorithms/overlap_similarity.md b/docs/cugraph/source/graph_support/algorithms/overlap_similarity.md index 026d713fbd6..d9f9f681ea2 100644 --- a/docs/cugraph/source/graph_support/algorithms/overlap_similarity.md +++ b/docs/cugraph/source/graph_support/algorithms/overlap_similarity.md @@ -15,7 +15,7 @@ $overlap(A,B) = \frac{|A \cap B|}{min(|A|,|B|)}$ ## When not to use Overlap Similarity * You are trying to compare graphs of extremely different sizes * In overly sparse or dense graph can overlap similarity can miss relationships or give fals positives respectively. -* In directed graphs, there are better algorithms to use. +* In directed graphs, there are better algorithms to use. ## How computationally expensive is it? @@ -29,4 +29,4 @@ Copyright (c) 2023, 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. -___ \ No newline at end of file +___ diff --git a/docs/cugraph/source/graph_support/algorithms/sorensen_coefficient.md b/docs/cugraph/source/graph_support/algorithms/sorensen_coefficient.md index 01b6709de5b..67d981815cf 100644 --- a/docs/cugraph/source/graph_support/algorithms/sorensen_coefficient.md +++ b/docs/cugraph/source/graph_support/algorithms/sorensen_coefficient.md @@ -23,7 +23,7 @@ In graphs, the sets refer to the set of connected nodes or neighborhood of nodes ## How computationally expensive is it? While cuGraph's parallelism mitigates run cost, [Big O notation](https://en.wikipedia.org/wiki/Big_O_notation) is still the standard to compare algorithm execution time. -The cost to run O(n * m) where n is the number of nodes in the graph and m is the number of groups to test. +The cost to run O(n * m) where n is the number of nodes in the graph and m is the number of groups to test. ___ Copyright (c) 2023, NVIDIA CORPORATION. @@ -31,4 +31,4 @@ Copyright (c) 2023, 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. -___ \ No newline at end of file +___ diff --git a/docs/cugraph/source/graph_support/compatibility.rst b/docs/cugraph/source/graph_support/compatibility.rst index be0cc21c2dd..ddb3f1d5fe5 100644 --- a/docs/cugraph/source/graph_support/compatibility.rst +++ b/docs/cugraph/source/graph_support/compatibility.rst @@ -5,4 +5,4 @@ Compatibility .. toctree:: :maxdepth: 3 -Compatibility document coming soon \ No newline at end of file +Compatibility document coming soon diff --git a/docs/cugraph/source/graph_support/cugraph_service.rst b/docs/cugraph/source/graph_support/cugraph_service.rst index 620b22d1e0b..658f9e731df 100644 --- a/docs/cugraph/source/graph_support/cugraph_service.rst +++ b/docs/cugraph/source/graph_support/cugraph_service.rst @@ -5,5 +5,5 @@ CuGraph Service .. toctree:: :maxdepth: 3 - -Cugraph Service for remote access to a server-based cuGraph(https://github.com/rapidsai/cugraph/blob/branch-23.04/python/cugraph-service/README.md) \ No newline at end of file + +Cugraph Service for remote access to a server-based cuGraph(https://github.com/rapidsai/cugraph/blob/branch-23.04/python/cugraph-service/README.md) diff --git a/docs/cugraph/source/graph_support/cugraphops_support.rst b/docs/cugraph/source/graph_support/cugraphops_support.rst index 08ae3b218c7..fd79564f849 100644 --- a/docs/cugraph/source/graph_support/cugraphops_support.rst +++ b/docs/cugraph/source/graph_support/cugraphops_support.rst @@ -7,4 +7,4 @@ cugraph-ops aims to be a low-level, framework agnostic library providing commonl .. toctree:: :maxdepth: 3 - https://github.com/rapidsai/cugraph-ops/blob/branch-23.04/README.md \ No newline at end of file + https://github.com/rapidsai/cugraph-ops/blob/branch-23.04/README.md diff --git a/docs/cugraph/source/graph_support/datastores.rst b/docs/cugraph/source/graph_support/datastores.rst index f921100774c..50d8461e7fe 100644 --- a/docs/cugraph/source/graph_support/datastores.rst +++ b/docs/cugraph/source/graph_support/datastores.rst @@ -6,4 +6,3 @@ Data Stores property_graph.md knowledge_stores.md feature_stores.md - diff --git a/docs/cugraph/source/graph_support/feature_stores.md b/docs/cugraph/source/graph_support/feature_stores.md index f40cab72ee0..ef9358c4cf8 100644 --- a/docs/cugraph/source/graph_support/feature_stores.md +++ b/docs/cugraph/source/graph_support/feature_stores.md @@ -1,3 +1,3 @@ # Feature Store -Coming Soon \ No newline at end of file +Coming Soon diff --git a/docs/cugraph/source/graph_support/gnn_support.rst b/docs/cugraph/source/graph_support/gnn_support.rst index 3c92dc36098..639b657c64d 100644 --- a/docs/cugraph/source/graph_support/gnn_support.rst +++ b/docs/cugraph/source/graph_support/gnn_support.rst @@ -5,8 +5,8 @@ Graph Neural Network Support .. toctree:: :maxdepth: 2 - + PyG_support.md DGL_support.md cugraphops_support.rst - wholegraph_support.md \ No newline at end of file + wholegraph_support.md diff --git a/docs/cugraph/source/graph_support/graph_algorithms.rst b/docs/cugraph/source/graph_support/graph_algorithms.rst index a8ba01aa915..38dd8ccc25b 100644 --- a/docs/cugraph/source/graph_support/graph_algorithms.rst +++ b/docs/cugraph/source/graph_support/graph_algorithms.rst @@ -4,5 +4,5 @@ Algorithms .. toctree:: :maxdepth: 3 - - algorithms.md \ No newline at end of file + + algorithms.md diff --git a/docs/cugraph/source/graph_support/index.rst b/docs/cugraph/source/graph_support/index.rst index 9526fae7eb2..67aba74288b 100644 --- a/docs/cugraph/source/graph_support/index.rst +++ b/docs/cugraph/source/graph_support/index.rst @@ -10,4 +10,4 @@ Graph Support compatibility.rst gnn_support.rst datastores.rst - cugraph_service.rst \ No newline at end of file + cugraph_service.rst diff --git a/docs/cugraph/source/graph_support/knowledge_stores.md b/docs/cugraph/source/graph_support/knowledge_stores.md index 4d6028a598c..1749eb2b4c1 100644 --- a/docs/cugraph/source/graph_support/knowledge_stores.md +++ b/docs/cugraph/source/graph_support/knowledge_stores.md @@ -1,3 +1,3 @@ # Knowledge Store -Coming Soon \ No newline at end of file +Coming Soon diff --git a/docs/cugraph/source/graph_support/property_graph.md b/docs/cugraph/source/graph_support/property_graph.md index 614910b79bc..ef07be79ba0 100644 --- a/docs/cugraph/source/graph_support/property_graph.md +++ b/docs/cugraph/source/graph_support/property_graph.md @@ -16,8 +16,8 @@ Property Graph enables: This is an example of using the cuGraph Property Graph in a two stage analysis. ``` -import cudf -import cugraph +import cudf +import cugraph from cugraph.experimental import PropertyGraph # Import a built-in dataset @@ -29,22 +29,22 @@ graph = cugraph.Graph(directed=False) G = karate.get_graph(create_using=graph,fetch=True) df = G.edgelist.edgelist_df -pG = PropertyGraph() +pG = PropertyGraph() pG. add_edge_data(df, vertex_col_names=("src", "dst")) -# Run Louvain to get the partition number for each vertex. -# Set resolution accordingly to identify two primary partitions. +# Run Louvain to get the partition number for each vertex. +# Set resolution accordingly to identify two primary partitions. (partition_info, _) = cugraph.louvain(pG.extract_subgraph(create_using=graph), resolution=0.6) -# Add the partition numbers back to the Property Graph as vertex properties +# Add the partition numbers back to the Property Graph as vertex properties pG.add_vertex_data(partition_info, vertex_col_name="vertex") -# Use the partition properties to extract a Graph for each partition. +# Use the partition properties to extract a Graph for each partition. G0 = pG.extract_subgraph(selection=pG.select_vertices("partition == 0")) G1 = pG.extract_subgraph(selection=pG. select_vertices("partition == 1")) -# Run pagerank on each graph, print results. -pageranks0 = cugraph.pagerank(G0) -pageranks1 = cugraph.pagerank(G1) +# Run pagerank on each graph, print results. +pageranks0 = cugraph.pagerank(G0) +pageranks1 = cugraph.pagerank(G1) print(pageranks0.sort_values (by="pagerank", ascending=False).head(3)) print(pageranks1.sort_values (by="pagerank", ascending=False).head(3)) -``` \ No newline at end of file +``` diff --git a/docs/cugraph/source/graph_support/wholegraph_support.md b/docs/cugraph/source/graph_support/wholegraph_support.md index fa26700a648..d1c5eaf7254 100644 --- a/docs/cugraph/source/graph_support/wholegraph_support.md +++ b/docs/cugraph/source/graph_support/wholegraph_support.md @@ -1,4 +1,4 @@ # WholeGraph [RAPIDS](https://rapids.ai) [WholeGraph](https://github.com/rapidsai/wholegraph) is designed to help train large-scale Graph Neural Networks(GNN). -Please see [WholeGraph Introduction](https://github.com/rapidsai/wholegraph/blob/main/README.md) for more details \ No newline at end of file +Please see [WholeGraph Introduction](https://github.com/rapidsai/wholegraph/blob/main/README.md) for more details diff --git a/docs/cugraph/source/index.rst b/docs/cugraph/source/index.rst index 955eb6d54db..b18a79d3396 100644 --- a/docs/cugraph/source/index.rst +++ b/docs/cugraph/source/index.rst @@ -18,7 +18,7 @@ RAPIDS Graph documentation - :abbr:`cugraph-service (Graph-as-a-service provides both Client and Server packages)` * - :abbr:`pylibcugraph (light-weight Python wrapper with no guard rails)` - :abbr:`cugraph-dgl (Accelerated extensions for use with the DGL framework)` - - + - * - :abbr:`libcugraph (C++ API)` - :abbr:`cugraph-pyg (Accelerated extensions for use with the PyG framework)` - @@ -33,7 +33,7 @@ Introduction ~~~~~~~~~~~~ cuGraph is a library of graph algorithms that seamlessly integrates into the RAPIDS data science ecosystem and allows the data scientist to easily call -graph algorithms using data stored in GPU DataFrames, NetworkX Graphs, or +graph algorithms using data stored in GPU DataFrames, NetworkX Graphs, or even CuPy or SciPy sparse Matrices. Note: We are redoing all of our documents, please be patient as we update diff --git a/docs/cugraph/source/installation/getting_cugraph.md b/docs/cugraph/source/installation/getting_cugraph.md index 0695c690a3b..4d601bf3217 100644 --- a/docs/cugraph/source/installation/getting_cugraph.md +++ b/docs/cugraph/source/installation/getting_cugraph.md @@ -1,7 +1,7 @@ # Getting cuGraph Packages -Start by reading the [RAPIDS Instalation guide](https://docs.rapids.ai/install) +Start by reading the [RAPIDS Instalation guide](https://docs.rapids.ai/install) and checkout the [RAPIDS install selector](https://rapids.ai/start.html) for a pick list of install options. @@ -65,4 +65,3 @@ Also available: * nx-cugraph-cu12
- diff --git a/docs/cugraph/source/installation/index.rst b/docs/cugraph/source/installation/index.rst index 27858b77012..8ad12c5895b 100644 --- a/docs/cugraph/source/installation/index.rst +++ b/docs/cugraph/source/installation/index.rst @@ -5,6 +5,6 @@ Installation .. toctree:: :maxdepth: 3 - + getting_cugraph source_build diff --git a/docs/cugraph/source/references/cugraph_ref.md b/docs/cugraph/source/references/cugraph_ref.md index a646d6da243..845436a60f2 100644 --- a/docs/cugraph/source/references/cugraph_ref.md +++ b/docs/cugraph/source/references/cugraph_ref.md @@ -43,4 +43,3 @@

- diff --git a/docs/cugraph/source/references/datasets.md b/docs/cugraph/source/references/datasets.md index 3d45dec188a..35234de87c6 100644 --- a/docs/cugraph/source/references/datasets.md +++ b/docs/cugraph/source/references/datasets.md @@ -4,18 +4,18 @@ karate - W. W. Zachary, *An information flow model for conflict and fission in small groups*, Journal of Anthropological Research 33, 452-473 (1977). dolphins - D. Lusseau, K. Schneider, O. J. Boisseau, P. Haase, E. Slooten, and S. M. Dawson, - *The bottlenose dolphin community of Doubtful Sound features a large proportion of long-lasting associations*, + *The bottlenose dolphin community of Doubtful Sound features a large proportion of long-lasting associations*, Behavioral Ecology and Sociobiology 54, 396-405 (2003). netscience - M. E. J. Newman, - *Finding community structure in networks using the eigenvectors of matrices*, + *Finding community structure in networks using the eigenvectors of matrices*, Preprint physics/0605087 (2006). email-Eu-core - Hao Yin, Austin R. Benson, Jure Leskovec, and David F. Gleich. - *Local Higher-order Graph Clustering.* + *Local Higher-order Graph Clustering.* In Proceedings of the 23rd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining. 2017. - - J. Leskovec, J. Kleinberg and C. Faloutsos. - *Graph Evolution: Densification and Shrinking Diameters*. - ACM Transactions on Knowledge Discovery from Data (ACM TKDD), 1(1), 2007. http://www.cs.cmu.edu/~jure/pubs/powergrowth-tkdd.pdf + - J. Leskovec, J. Kleinberg and C. Faloutsos. + *Graph Evolution: Densification and Shrinking Diameters*. + ACM Transactions on Knowledge Discovery from Data (ACM TKDD), 1(1), 2007. http://www.cs.cmu.edu/~jure/pubs/powergrowth-tkdd.pdf polbooks - - V. Krebs, unpublished, http://www.orgnet.com/. \ No newline at end of file + - V. Krebs, unpublished, http://www.orgnet.com/. diff --git a/docs/cugraph/source/references/index.rst b/docs/cugraph/source/references/index.rst index d7a173a8330..9ea51a08356 100644 --- a/docs/cugraph/source/references/index.rst +++ b/docs/cugraph/source/references/index.rst @@ -5,7 +5,7 @@ References .. toctree:: :maxdepth: 3 - + cugraph_ref.md datasets.md licenses.md diff --git a/docs/cugraph/source/references/licenses.md b/docs/cugraph/source/references/licenses.md index dfc950023cf..b95905d9f2f 100644 --- a/docs/cugraph/source/references/licenses.md +++ b/docs/cugraph/source/references/licenses.md @@ -1,7 +1,7 @@ # License Most of the Graph code is open-sourced and developed under the Apache 2.0 licnese. -The cugraph-ops code is closed sourced and developed under a NVIDIA copyright +The cugraph-ops code is closed sourced and developed under a NVIDIA copyright diff --git a/docs/cugraph/source/releases/index.rst b/docs/cugraph/source/releases/index.rst index 7bd4f6dfa31..cbd22324b9b 100644 --- a/docs/cugraph/source/releases/index.rst +++ b/docs/cugraph/source/releases/index.rst @@ -2,4 +2,4 @@ Releases ======== -https://github.com/rapidsai/cugraph/blob/main/CHANGELOG.md \ No newline at end of file +https://github.com/rapidsai/cugraph/blob/main/CHANGELOG.md diff --git a/docs/cugraph/source/tutorials/community_resources.md b/docs/cugraph/source/tutorials/community_resources.md index 572f85a015b..1c4362393d1 100644 --- a/docs/cugraph/source/tutorials/community_resources.md +++ b/docs/cugraph/source/tutorials/community_resources.md @@ -1,2 +1,2 @@ # Commmunity Resources -[Rapids Community Repository](https://github.com/rapidsai-community/notebooks-contrib) \ No newline at end of file +[Rapids Community Repository](https://github.com/rapidsai-community/notebooks-contrib) diff --git a/docs/cugraph/source/tutorials/cugraph_blogs.rst b/docs/cugraph/source/tutorials/cugraph_blogs.rst index 368dbcce4f8..373e846f6c3 100644 --- a/docs/cugraph/source/tutorials/cugraph_blogs.rst +++ b/docs/cugraph/source/tutorials/cugraph_blogs.rst @@ -3,7 +3,7 @@ cuGraph Blogs and Presentations ************************************************ The RAPIDS team blogs at https://medium.com/rapids-ai, and many of -these blog posts provide deeper dives into features from cuGraph. +these blog posts provide deeper dives into features from cuGraph. Here, we've selected just a few that are of particular interest to cuGraph users: diff --git a/docs/cugraph/source/tutorials/cugraph_notebooks.md b/docs/cugraph/source/tutorials/cugraph_notebooks.md index d4251d4c9b2..559ba36e97e 100644 --- a/docs/cugraph/source/tutorials/cugraph_notebooks.md +++ b/docs/cugraph/source/tutorials/cugraph_notebooks.md @@ -53,7 +53,7 @@ Running the example in these notebooks requires: * The latest version of RAPIDS with cuGraph. * Download via Docker, Conda (See [__Getting Started__](https://rapids.ai/start.html)) - + * cuGraph is dependent on the latest version of cuDF. Please install all components of RAPIDS * Python 3.8+ * A system with an NVIDIA GPU: Pascal architecture or better @@ -66,7 +66,7 @@ Copyright (c) 2019-2023, NVIDIA CORPORATION. All rights reserved. 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 +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. diff --git a/docs/cugraph/source/tutorials/how_to_guides.md b/docs/cugraph/source/tutorials/how_to_guides.md index 42da6ed21ca..80be5b4ab5b 100644 --- a/docs/cugraph/source/tutorials/how_to_guides.md +++ b/docs/cugraph/source/tutorials/how_to_guides.md @@ -1,9 +1,9 @@ # How To Guides -- Basic use of cuGraph, on the page -- Property graph with analytic flow -- GNN – model building -- cuGraph Service – client/server setup and use (ucx) -- MNMG Graph – dask, rmm basics and examples -- Pylibcugraph – why and how -- Cugraph for C, C++ users -- Use of nvidia-smi with cugraph \ No newline at end of file +- Basic use of cuGraph, on the page +- Property graph with analytic flow +- GNN – model building +- cuGraph Service – client/server setup and use (ucx) +- MNMG Graph – dask, rmm basics and examples +- Pylibcugraph – why and how +- Cugraph for C, C++ users +- Use of nvidia-smi with cugraph diff --git a/docs/cugraph/source/wholegraph/basics/wholememory_implementation_details.md b/docs/cugraph/source/wholegraph/basics/wholememory_implementation_details.md index a5541109c4f..634539cd27e 100644 --- a/docs/cugraph/source/wholegraph/basics/wholememory_implementation_details.md +++ b/docs/cugraph/source/wholegraph/basics/wholememory_implementation_details.md @@ -18,7 +18,7 @@ partition data into these GPU devices. The partition method guarantees that each GPU can access one continuous part of the entire memory. Here "can access" means can directly access from CUDA kernels, but the memory doesn't have to be physically on that GPU. For example,it can be on host memory or other GPU's device memory that can be access using P2P. -In that case the stored data has its own granularity that shouldn't be split. Data granularity can be specified while +In that case the stored data has its own granularity that shouldn't be split. Data granularity can be specified while creating WholeMemory. Then each data granularity can be considered as a block of data. The follow figure shows the layout of 15 data block over 4 GPUs. diff --git a/docs/cugraph/source/wholegraph/index.rst b/docs/cugraph/source/wholegraph/index.rst index 2a69544b4c9..bb2281b1351 100644 --- a/docs/cugraph/source/wholegraph/index.rst +++ b/docs/cugraph/source/wholegraph/index.rst @@ -11,4 +11,3 @@ RAPIDS WholeGraph has following package: basics/index installation/index - diff --git a/docs/cugraph/source/wholegraph/installation/getting_wholegraph.md b/docs/cugraph/source/wholegraph/installation/getting_wholegraph.md index 5b2072b0523..57314dcd426 100644 --- a/docs/cugraph/source/wholegraph/installation/getting_wholegraph.md +++ b/docs/cugraph/source/wholegraph/installation/getting_wholegraph.md @@ -1,7 +1,7 @@ # Getting the WholeGraph Packages -Start by reading the [RAPIDS Instalation guide](https://docs.rapids.ai/install) +Start by reading the [RAPIDS Instalation guide](https://docs.rapids.ai/install) and checkout the [RAPIDS install selector](https://rapids.ai/start.html) for a pick list of install options. diff --git a/notebooks/README.md b/notebooks/README.md index 3f1cdbaf2a1..31660b21569 100644 --- a/notebooks/README.md +++ b/notebooks/README.md @@ -54,7 +54,7 @@ Running the example in these notebooks requires: * The latest version of RAPIDS with cuGraph. * Download via Docker, Conda (See [__Getting Started__](https://rapids.ai/start.html)) - + * cuGraph is dependent on the latest version of cuDF. Please install all components of RAPIDS * Python 3.8+ * A system with an NVIDIA GPU: Pascal architecture or better @@ -124,7 +124,7 @@ Copyright (c) 2019-2023, NVIDIA CORPORATION. All rights reserved. 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 +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. @@ -133,4 +133,3 @@ Unless required by applicable law or agreed to in writing, software distributed ![RAPIDS](img/rapids_logo.png) - diff --git a/notebooks/algorithms/README.md b/notebooks/algorithms/README.md index 7965970c7d9..2aa35b52b0f 100644 --- a/notebooks/algorithms/README.md +++ b/notebooks/algorithms/README.md @@ -58,7 +58,7 @@ Copyright (c) 2019-2022, NVIDIA CORPORATION. All rights reserved. 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 +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. diff --git a/notebooks/algorithms/centrality/README.md b/notebooks/algorithms/centrality/README.md index f15ed7bdc04..be838b1c76a 100644 --- a/notebooks/algorithms/centrality/README.md +++ b/notebooks/algorithms/centrality/README.md @@ -34,7 +34,7 @@ Copyright (c) 2019-2022, NVIDIA CORPORATION. All rights reserved. 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 +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. diff --git a/notebooks/algorithms/community/README.md b/notebooks/algorithms/community/README.md index 748f27c0ffe..222dab4ffe3 100644 --- a/notebooks/algorithms/community/README.md +++ b/notebooks/algorithms/community/README.md @@ -36,7 +36,7 @@ Copyright (c) 2019-2022, NVIDIA CORPORATION. All rights reserved. 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 +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. diff --git a/notebooks/algorithms/components/README.md b/notebooks/algorithms/components/README.md index e14e886a7e2..f3c6f925e36 100644 --- a/notebooks/algorithms/components/README.md +++ b/notebooks/algorithms/components/README.md @@ -27,7 +27,7 @@ Copyright (c) 2019-2022, NVIDIA CORPORATION. All rights reserved. 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 +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. diff --git a/notebooks/algorithms/cores/README.md b/notebooks/algorithms/cores/README.md index e36677ffe32..0e2b1e56702 100644 --- a/notebooks/algorithms/cores/README.md +++ b/notebooks/algorithms/cores/README.md @@ -27,7 +27,7 @@ Copyright (c) 2019-2022, NVIDIA CORPORATION. All rights reserved. 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 +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. diff --git a/notebooks/algorithms/link_analysis/README.md b/notebooks/algorithms/link_analysis/README.md index 17d4b8ab6d1..3ed23e02a62 100644 --- a/notebooks/algorithms/link_analysis/README.md +++ b/notebooks/algorithms/link_analysis/README.md @@ -4,7 +4,7 @@ cuGraph Link Analysis notebooks contain Jupyter Notebooks that demonstrate algorithms to rank the importance of individual vertices within the graph. A good comparison of the two algorithms can be found [here](https://www.ijert.org/research/comparative-analysis-of-pagerank-and-hits-algorithms-IJERTV1IS8530.pdf). -In general, Pagerank is more popular because it is more efficient and takes less query time. +In general, Pagerank is more popular because it is more efficient and takes less query time. Manipulation of the data before or after the graph analytic is not covered here. Extended, more problem focused, notebooks are being created and available https://github.com/rapidsai/notebooks-extended @@ -29,7 +29,7 @@ Copyright (c) 2019-2022, NVIDIA CORPORATION. All rights reserved. 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 +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. diff --git a/notebooks/algorithms/link_prediction/README.md b/notebooks/algorithms/link_prediction/README.md index e3391e4d0cf..4030a2880f7 100644 --- a/notebooks/algorithms/link_prediction/README.md +++ b/notebooks/algorithms/link_prediction/README.md @@ -1,7 +1,7 @@ # Vertex Similarity ---- -In this folder we will explore and compare the various vertex similarity metrics available in cuGraph. [Vertex similarity](https://en.wikipedia.org/wiki/Similarity_(network_science)), as the name implies, is a measure how similar two vertices are. +In this folder we will explore and compare the various vertex similarity metrics available in cuGraph. [Vertex similarity](https://en.wikipedia.org/wiki/Similarity_(network_science)), as the name implies, is a measure how similar two vertices are. |Algorithm |Notebooks Containing |Description | | --------------- | ------------------------------------------------------------ | ------------------------------------------------------------ | @@ -34,7 +34,7 @@ Copyright (c) 2019-2022, NVIDIA CORPORATION. All rights reserved. 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 +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. diff --git a/notebooks/algorithms/sampling/README.md b/notebooks/algorithms/sampling/README.md index 9c60adcb9e3..6b7c5b82ba6 100644 --- a/notebooks/algorithms/sampling/README.md +++ b/notebooks/algorithms/sampling/README.md @@ -29,7 +29,7 @@ Copyright (c) 2021-2022, NVIDIA CORPORATION. All rights reserved. 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 +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. diff --git a/notebooks/algorithms/structure/README.md b/notebooks/algorithms/structure/README.md index b209ddba71c..ea649037089 100644 --- a/notebooks/algorithms/structure/README.md +++ b/notebooks/algorithms/structure/README.md @@ -27,7 +27,7 @@ Copyright (c) 2019-2022, NVIDIA CORPORATION. All rights reserved. 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 +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. diff --git a/notebooks/algorithms/traversal/README.md b/notebooks/algorithms/traversal/README.md index 4d4f37a0f8c..c8478831f66 100644 --- a/notebooks/algorithms/traversal/README.md +++ b/notebooks/algorithms/traversal/README.md @@ -25,7 +25,7 @@ Copyright (c) 2019-2022, NVIDIA CORPORATION. All rights reserved. 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 +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. diff --git a/notebooks/modules/README.md b/notebooks/modules/README.md index 29cb47784c7..0cf7ccb61e7 100644 --- a/notebooks/modules/README.md +++ b/notebooks/modules/README.md @@ -1,3 +1,3 @@ # This folde contains partial notebooks -The code here is meant to be used to build other notebooks \ No newline at end of file +The code here is meant to be used to build other notebooks diff --git a/print_env.sh b/print_env.sh index 6f2d33b0eb8..43abd1c7ea7 100644 --- a/print_env.sh +++ b/print_env.sh @@ -1,7 +1,8 @@ #!/usr/bin/env bash +# Copyright (c) 2019-2024, NVIDIA CORPORATION. # Reports relevant environment information useful for diagnosing and # debugging cuGraph issues. -# Usage: +# Usage: # "./print_env.sh" - prints to stdout # "./print_env.sh > env.txt" - prints to file "env.txt" @@ -14,16 +15,16 @@ git submodule status --recursive else echo "Not inside a git repository" fi -echo +echo echo "***OS Information***" cat /etc/*-release uname -a -echo +echo echo "***GPU Information***" nvidia-smi -echo +echo echo "***CPU***" lscpu @@ -31,15 +32,15 @@ echo echo "***CMake***" which cmake && cmake --version -echo +echo echo "***g++***" which g++ && g++ --version -echo +echo echo "***nvcc***" which nvcc && nvcc --version -echo +echo echo "***Python***" which python && python -c "import sys; print('Python {0}.{1}.{2}'.format(sys.version_info[0], sys.version_info[1], sys.version_info[2]))" diff --git a/python/cugraph-dgl/README.md b/python/cugraph-dgl/README.md index 6de476ae500..ac4cb2f6253 100644 --- a/python/cugraph-dgl/README.md +++ b/python/cugraph-dgl/README.md @@ -2,7 +2,7 @@ ## Description -[RAPIDS](https://rapids.ai) cugraph_dgl provides a duck-typed version of the [DGLGraph](https://docs.dgl.ai/api/python/dgl.DGLGraph.html#dgl.DGLGraph) class, which uses cugraph for storing graph structure and node/edge feature data. Using cugraph as the backend allows DGL users to access a collection of GPU accelerated algorithms for graph analytics, such as centrality computation and community detection. +[RAPIDS](https://rapids.ai) cugraph_dgl provides a duck-typed version of the [DGLGraph](https://docs.dgl.ai/api/python/dgl.DGLGraph.html#dgl.DGLGraph) class, which uses cugraph for storing graph structure and node/edge feature data. Using cugraph as the backend allows DGL users to access a collection of GPU accelerated algorithms for graph analytics, such as centrality computation and community detection. ## Conda @@ -22,7 +22,7 @@ mamba env create -n cugraph_dgl_dev --file conda/cugraph_dgl_dev_11.6.yml ### Install in editable mode ``` -pip install -e . +pip install -e . ``` ### Run tests @@ -42,15 +42,13 @@ sampler = dgl.dataloading.NeighborSampler( [15, 10, 5], prefetch_node_feats=['feat'], prefetch_labels=['label']) train_dataloader = dgl.dataloading.DataLoader( -- dgl_g, +- dgl_g, + cugraph_g, -train_idx, -sampler, -device=device, +train_idx, +sampler, +device=device, batch_size=1024, shuffle=True, -drop_last=False, +drop_last=False, num_workers=0) ``` - - diff --git a/python/cugraph/cugraph/dask/structure/replication.pyx b/python/cugraph/cugraph/dask/structure/replication.pyx index 64f43663517..04e14cb012f 100644 --- a/python/cugraph/cugraph/dask/structure/replication.pyx +++ b/python/cugraph/cugraph/dask/structure/replication.pyx @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2022, NVIDIA CORPORATION. +# Copyright (c) 2020-2024, 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 @@ -141,4 +141,4 @@ cdef comms_bcast(uintptr_t handle, elif dtype == np.float64: c_utils.comms_bcast(( handle)[0], value_ptr, count) else: - raise TypeError("Unsupported broadcast type") \ No newline at end of file + raise TypeError("Unsupported broadcast type") diff --git a/python/cugraph/cugraph/datasets/metadata/cit-patents.yaml b/python/cugraph/cugraph/datasets/metadata/cit-patents.yaml index d5c4cf195bd..37d288e6339 100644 --- a/python/cugraph/cugraph/datasets/metadata/cit-patents.yaml +++ b/python/cugraph/cugraph/datasets/metadata/cit-patents.yaml @@ -3,7 +3,7 @@ file_type: .csv description: A citation graph that includes all citations made by patents granted between 1975 and 1999, totaling 16,522,438 citations. author: NBER refs: - J. Leskovec, J. Kleinberg and C. Faloutsos. Graphs over Time Densification Laws, Shrinking Diameters and Possible Explanations. + J. Leskovec, J. Kleinberg and C. Faloutsos. Graphs over Time Densification Laws, Shrinking Diameters and Possible Explanations. ACM SIGKDD International Conference on Knowledge Discovery and Data Mining (KDD), 2005. delim: " " header: None @@ -19,4 +19,4 @@ is_multigraph: false is_symmetric: false number_of_edges: 16518948 number_of_nodes: 3774768 -url: https://data.rapids.ai/cugraph/datasets/cit-Patents.csv \ No newline at end of file +url: https://data.rapids.ai/cugraph/datasets/cit-Patents.csv diff --git a/python/cugraph/cugraph/datasets/metadata/dining_prefs.yaml b/python/cugraph/cugraph/datasets/metadata/dining_prefs.yaml index e7ec85d7a1f..3f70a886b59 100644 --- a/python/cugraph/cugraph/datasets/metadata/dining_prefs.yaml +++ b/python/cugraph/cugraph/datasets/metadata/dining_prefs.yaml @@ -20,4 +20,4 @@ is_multigraph: false is_symmetric: true number_of_edges: 42 number_of_nodes: 26 -url: https://data.rapids.ai/cugraph/datasets/dining_prefs.csv \ No newline at end of file +url: https://data.rapids.ai/cugraph/datasets/dining_prefs.csv diff --git a/python/cugraph/cugraph/datasets/metadata/dolphins.yaml b/python/cugraph/cugraph/datasets/metadata/dolphins.yaml index bc7cb6cd486..70c178bc5a2 100644 --- a/python/cugraph/cugraph/datasets/metadata/dolphins.yaml +++ b/python/cugraph/cugraph/datasets/metadata/dolphins.yaml @@ -1,6 +1,6 @@ name: dolphins file_type: .csv -description: An undirected social network of frequent associations between 62 dolphins in a community living off Doubtful Sound, New Zealand, as compiled by Lusseau et al. (2003). +description: An undirected social network of frequent associations between 62 dolphins in a community living off Doubtful Sound, New Zealand, as compiled by Lusseau et al. (2003). author: - D. Lusseau - K. Schneider diff --git a/python/cugraph/cugraph/datasets/metadata/europe_osm.yaml b/python/cugraph/cugraph/datasets/metadata/europe_osm.yaml index fe0e42a4b86..1443f8d5cdd 100644 --- a/python/cugraph/cugraph/datasets/metadata/europe_osm.yaml +++ b/python/cugraph/cugraph/datasets/metadata/europe_osm.yaml @@ -18,4 +18,4 @@ is_multigraph: false is_symmetric: true number_of_edges: 54054660 number_of_nodes: 50912018 -url: https://data.rapids.ai/cugraph/datasets/europe_osm.csv \ No newline at end of file +url: https://data.rapids.ai/cugraph/datasets/europe_osm.csv diff --git a/python/cugraph/cugraph/datasets/metadata/hollywood.yaml b/python/cugraph/cugraph/datasets/metadata/hollywood.yaml index 2f09cf7679b..9a8ef56532b 100644 --- a/python/cugraph/cugraph/datasets/metadata/hollywood.yaml +++ b/python/cugraph/cugraph/datasets/metadata/hollywood.yaml @@ -23,4 +23,4 @@ is_multigraph: false is_symmetric: true number_of_edges: 57515616 number_of_nodes: 1139905 -url: https://data.rapids.ai/cugraph/datasets/hollywood.csv \ No newline at end of file +url: https://data.rapids.ai/cugraph/datasets/hollywood.csv diff --git a/python/cugraph/cugraph/datasets/metadata/soc-livejournal1.yaml b/python/cugraph/cugraph/datasets/metadata/soc-livejournal1.yaml index fafc68acb9b..af0cbd4f047 100644 --- a/python/cugraph/cugraph/datasets/metadata/soc-livejournal1.yaml +++ b/python/cugraph/cugraph/datasets/metadata/soc-livejournal1.yaml @@ -3,7 +3,7 @@ file_type: .csv description: A graph of the LiveJournal social network. author: L. Backstrom, D. Huttenlocher, J. Kleinberg, X. Lan refs: - L. Backstrom, D. Huttenlocher, J. Kleinberg, X. Lan. Group Formation in + L. Backstrom, D. Huttenlocher, J. Kleinberg, X. Lan. Group Formation in Large Social Networks Membership, Growth, and Evolution. KDD, 2006. delim: " " header: None @@ -19,4 +19,4 @@ is_multigraph: false is_symmetric: false number_of_edges: 68993773 number_of_nodes: 4847571 -url: https://data.rapids.ai/cugraph/datasets/soc-LiveJournal1.csv \ No newline at end of file +url: https://data.rapids.ai/cugraph/datasets/soc-LiveJournal1.csv diff --git a/python/cugraph/cugraph/datasets/metadata/soc-twitter-2010.yaml b/python/cugraph/cugraph/datasets/metadata/soc-twitter-2010.yaml index df5df5735af..184d69a8da1 100644 --- a/python/cugraph/cugraph/datasets/metadata/soc-twitter-2010.yaml +++ b/python/cugraph/cugraph/datasets/metadata/soc-twitter-2010.yaml @@ -3,8 +3,8 @@ file_type: .csv description: A network of follower relationships from a snapshot of Twitter in 2010, where an edge from i to j indicates that j is a follower of i. author: H. Kwak, C. Lee, H. Park, S. Moon refs: - J. Yang, J. Leskovec. Temporal Variation in Online Media. ACM Intl. - Conf. on Web Search and Data Mining (WSDM '11), 2011. + J. Yang, J. Leskovec. Temporal Variation in Online Media. ACM Intl. + Conf. on Web Search and Data Mining (WSDM '11), 2011. delim: " " header: None col_names: @@ -19,4 +19,4 @@ is_multigraph: false is_symmetric: false number_of_edges: 530051354 number_of_nodes: 21297772 -url: https://data.rapids.ai/cugraph/datasets/soc-twitter-2010.csv \ No newline at end of file +url: https://data.rapids.ai/cugraph/datasets/soc-twitter-2010.csv diff --git a/python/cugraph/cugraph/structure/graph_classes.py b/python/cugraph/cugraph/structure/graph_classes.py index 03efcba0307..f48895c90b9 100644 --- a/python/cugraph/cugraph/structure/graph_classes.py +++ b/python/cugraph/cugraph/structure/graph_classes.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021-2023, NVIDIA CORPORATION. +# Copyright (c) 2021-2024, 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 @@ -426,7 +426,7 @@ def from_pandas_edgelist( ... edge_attr='2', renumber=False) """ - if not isinstance(pdf, pd.core.frame.DataFrame): + if not isinstance(pdf, pd.DataFrame): raise TypeError("pdf input is not a Pandas DataFrame") gdf = cudf.DataFrame.from_pandas(pdf) @@ -450,7 +450,7 @@ def from_pandas_adjacency(self, pdf): pdf : pandas.DataFrame A DataFrame that contains adjacency information """ - if not isinstance(pdf, pd.core.frame.DataFrame): + if not isinstance(pdf, pd.DataFrame): raise TypeError("pdf input is not a Pandas DataFrame") np_array = pdf.to_numpy() diff --git a/python/cugraph/cugraph/structure/graph_utilities.pxd b/python/cugraph/cugraph/structure/graph_utilities.pxd index 5085aa42216..39e2cdbbff5 100644 --- a/python/cugraph/cugraph/structure/graph_utilities.pxd +++ b/python/cugraph/cugraph/structure/graph_utilities.pxd @@ -1,4 +1,4 @@ -# Copyright (c) 2019-2023, NVIDIA CORPORATION. +# Copyright (c) 2019-2024, 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 @@ -29,4 +29,3 @@ from pylibraft.common.handle cimport handle_t cdef extern from "" namespace "std" nogil: cdef device_buffer move(device_buffer) cdef unique_ptr[device_buffer] move(unique_ptr[device_buffer]) - diff --git a/python/cugraph/cugraph/structure/hypergraph.py b/python/cugraph/cugraph/structure/hypergraph.py index 4add74d6061..add68cb6dac 100644 --- a/python/cugraph/cugraph/structure/hypergraph.py +++ b/python/cugraph/cugraph/structure/hypergraph.py @@ -185,7 +185,7 @@ def hypergraph( events.reset_index(drop=True, inplace=True) if EVENTID not in events.columns: - events[EVENTID] = cudf.core.index.RangeIndex(len(events)) + events[EVENTID] = cudf.RangeIndex(len(events)) events[EVENTID] = _prepend_str(events[EVENTID], EVENTID + DELIM) events[NODETYPE] = ( @@ -596,6 +596,4 @@ def _prepend_str(col, val): # Make an empty categorical string dtype def _empty_cat_dt(): - return cudf.core.dtypes.CategoricalDtype( - categories=np.array([], dtype="str"), ordered=False - ) + return cudf.CategoricalDtype(categories=np.array([], dtype="str"), ordered=False) diff --git a/python/cugraph/cugraph/tests/utils/test_dataset.py b/python/cugraph/cugraph/tests/utils/test_dataset.py index 39f7ed8850b..9331cefcfda 100644 --- a/python/cugraph/cugraph/tests/utils/test_dataset.py +++ b/python/cugraph/cugraph/tests/utils/test_dataset.py @@ -171,14 +171,14 @@ def test_reader(dataset): E = dataset.get_edgelist(download=True) assert E is not None - assert isinstance(E, cudf.core.dataframe.DataFrame) + assert isinstance(E, cudf.DataFrame) dataset.unload() # using pandas E_pd = dataset.get_edgelist(download=True, reader="pandas") assert E_pd is not None - assert isinstance(E_pd, pandas.core.frame.DataFrame) + assert isinstance(E_pd, pandas.DataFrame) dataset.unload() with pytest.raises(ValueError): diff --git a/python/pylibcugraph/pylibcugraph/_cugraph_c/README.md b/python/pylibcugraph/pylibcugraph/_cugraph_c/README.md index cb0c6edff2b..7aa1b2e5680 100644 --- a/python/pylibcugraph/pylibcugraph/_cugraph_c/README.md +++ b/python/pylibcugraph/pylibcugraph/_cugraph_c/README.md @@ -2,4 +2,4 @@ This directory contains cython `.pxd` files which describe the cugraph C library to cython. The contents here are simply a mapping of the cugraph_c C APIs to -cython for use in the cython code in the parent directory. \ No newline at end of file +cython for use in the cython code in the parent directory. diff --git a/python/pylibcugraph/pylibcugraph/_cugraph_c/algorithms.pxd b/python/pylibcugraph/pylibcugraph/_cugraph_c/algorithms.pxd index 29c6d79e08d..b0e7ffaf82d 100644 --- a/python/pylibcugraph/pylibcugraph/_cugraph_c/algorithms.pxd +++ b/python/pylibcugraph/pylibcugraph/_cugraph_c/algorithms.pxd @@ -1,4 +1,4 @@ -# Copyright (c) 2022-2023, NVIDIA CORPORATION. +# Copyright (c) 2022-2024, 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 @@ -135,7 +135,7 @@ cdef extern from "cugraph_c/algorithms.h": cugraph_random_walk_result_get_path_sizes( cugraph_random_walk_result_t* result ) - + cdef size_t \ cugraph_random_walk_result_get_max_path_length( cugraph_random_walk_result_t* result @@ -187,17 +187,17 @@ cdef extern from "cugraph_c/algorithms.h": cugraph_sample_result_get_destinations( const cugraph_sample_result_t* result ) - + cdef cugraph_type_erased_device_array_view_t* \ cugraph_sample_result_get_majors( const cugraph_sample_result_t* result ) - + cdef cugraph_type_erased_device_array_view_t* \ cugraph_sample_result_get_minors( const cugraph_sample_result_t* result ) - + cdef cugraph_type_erased_device_array_view_t* \ cugraph_sample_result_get_major_offsets( const cugraph_sample_result_t* result @@ -207,27 +207,27 @@ cdef extern from "cugraph_c/algorithms.h": cugraph_sample_result_get_index( const cugraph_sample_result_t* result ) - + cdef cugraph_type_erased_device_array_view_t* \ cugraph_sample_result_get_edge_weight( const cugraph_sample_result_t* result ) - + cdef cugraph_type_erased_device_array_view_t* \ cugraph_sample_result_get_edge_id( const cugraph_sample_result_t* result ) - + cdef cugraph_type_erased_device_array_view_t* \ cugraph_sample_result_get_edge_type( const cugraph_sample_result_t* result ) - + cdef cugraph_type_erased_device_array_view_t* \ cugraph_sample_result_get_hop( const cugraph_sample_result_t* result ) - + cdef cugraph_type_erased_device_array_view_t* \ cugraph_sample_result_get_label_hop_offsets( const cugraph_sample_result_t* result @@ -237,7 +237,7 @@ cdef extern from "cugraph_c/algorithms.h": cugraph_sample_result_get_start_labels( const cugraph_sample_result_t* result ) - + # Deprecated cdef cugraph_type_erased_device_array_view_t* \ cugraph_sample_result_get_offsets( @@ -264,15 +264,15 @@ cdef extern from "cugraph_c/algorithms.h": cugraph_sample_result_t** result, cugraph_error_t** error ) - + ctypedef struct cugraph_sampling_options_t: pass - + ctypedef enum cugraph_prior_sources_behavior_t: DEFAULT=0 CARRY_OVER EXCLUDE - + ctypedef enum cugraph_compression_type_t: COO=0 CSR @@ -285,7 +285,7 @@ cdef extern from "cugraph_c/algorithms.h": cugraph_sampling_options_t** options, cugraph_error_t** error, ) - + cdef void \ cugraph_sampling_set_renumber_results( cugraph_sampling_options_t* options, @@ -297,7 +297,7 @@ cdef extern from "cugraph_c/algorithms.h": cugraph_sampling_options_t* options, bool_t value, ) - + cdef void \ cugraph_sampling_set_return_hops( cugraph_sampling_options_t* options, @@ -315,19 +315,19 @@ cdef extern from "cugraph_c/algorithms.h": cugraph_sampling_options_t* options, bool_t value, ) - + cdef void \ cugraph_sampling_set_compress_per_hop( cugraph_sampling_options_t* options, bool_t value, ) - + cdef void \ cugraph_sampling_set_compression_type( cugraph_sampling_options_t* options, cugraph_compression_type_t value, ) - + cdef void \ cugraph_sampling_options_free( cugraph_sampling_options_t* options, @@ -343,7 +343,7 @@ cdef extern from "cugraph_c/algorithms.h": cugraph_random_walk_result_t** result, cugraph_error_t** error ) - + # biased random walks cdef cugraph_error_code_t \ cugraph_based_random_walks( diff --git a/python/pylibcugraph/pylibcugraph/_cugraph_c/centrality_algorithms.pxd b/python/pylibcugraph/pylibcugraph/_cugraph_c/centrality_algorithms.pxd index 532df624c99..6e9a5432974 100644 --- a/python/pylibcugraph/pylibcugraph/_cugraph_c/centrality_algorithms.pxd +++ b/python/pylibcugraph/pylibcugraph/_cugraph_c/centrality_algorithms.pxd @@ -1,4 +1,4 @@ -# Copyright (c) 2022-2023, NVIDIA CORPORATION. +# Copyright (c) 2022-2024, 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 @@ -212,7 +212,7 @@ cdef extern from "cugraph_c/centrality_algorithms.h": cugraph_centrality_result_t** result, cugraph_error_t** error ) - + ########################################################################### # edge betweenness centrality @@ -223,7 +223,7 @@ cdef extern from "cugraph_c/centrality_algorithms.h": cugraph_edge_centrality_result_get_src_vertices( cugraph_edge_centrality_result_t* result ) - + cdef cugraph_type_erased_device_array_view_t* \ cugraph_edge_centrality_result_get_dst_vertices( cugraph_edge_centrality_result_t* result @@ -233,17 +233,17 @@ cdef extern from "cugraph_c/centrality_algorithms.h": cugraph_edge_centrality_result_get_edge_ids( cugraph_edge_centrality_result_t* result ) - + cdef cugraph_type_erased_device_array_view_t* \ cugraph_edge_centrality_result_get_values( cugraph_edge_centrality_result_t* result ) - + cdef void \ cugraph_edge_centrality_result_free( cugraph_edge_centrality_result_t* result ) - + cdef cugraph_error_code_t \ cugraph_edge_betweenness_centrality( const cugraph_resource_handle_t* handle, diff --git a/python/pylibcugraph/pylibcugraph/_cugraph_c/community_algorithms.pxd b/python/pylibcugraph/pylibcugraph/_cugraph_c/community_algorithms.pxd index b7729bfba06..0e9529146cc 100644 --- a/python/pylibcugraph/pylibcugraph/_cugraph_c/community_algorithms.pxd +++ b/python/pylibcugraph/pylibcugraph/_cugraph_c/community_algorithms.pxd @@ -48,17 +48,17 @@ cdef extern from "cugraph_c/community_algorithms.h": cugraph_triangle_count_result_get_vertices( cugraph_triangle_count_result_t* result ) - + cdef cugraph_type_erased_device_array_view_t* \ cugraph_triangle_count_result_get_counts( cugraph_triangle_count_result_t* result ) - + cdef void \ cugraph_triangle_count_result_free( cugraph_triangle_count_result_t* result ) - + cdef cugraph_error_code_t \ cugraph_triangle_count( const cugraph_resource_handle_t* handle, @@ -83,7 +83,7 @@ cdef extern from "cugraph_c/community_algorithms.h": cugraph_hierarchical_clustering_result_get_clusters( cugraph_hierarchical_clustering_result_t* result ) - + cdef double cugraph_hierarchical_clustering_result_get_modularity( cugraph_hierarchical_clustering_result_t* result ) @@ -104,7 +104,7 @@ cdef extern from "cugraph_c/community_algorithms.h": cugraph_hierarchical_clustering_result_t** result, cugraph_error_t** error ) - + # extract_ego cdef cugraph_error_code_t \ cugraph_extract_ego( @@ -116,7 +116,7 @@ cdef extern from "cugraph_c/community_algorithms.h": cugraph_induced_subgraph_result_t** result, cugraph_error_t** error ) - + # leiden ctypedef struct cugraph_hierarchical_clustering_result_t: pass @@ -130,7 +130,7 @@ cdef extern from "cugraph_c/community_algorithms.h": cugraph_hierarchical_clustering_result_get_clusters( cugraph_hierarchical_clustering_result_t* result ) - + cdef double cugraph_hierarchical_clustering_result_get_modularity( cugraph_hierarchical_clustering_result_t* result ) @@ -180,12 +180,12 @@ cdef extern from "cugraph_c/community_algorithms.h": cugraph_hierarchical_clustering_result_t** result, cugraph_error_t** error ) - + ########################################################################### # Clustering ctypedef struct cugraph_clustering_result_t: pass - + cdef cugraph_type_erased_device_array_view_t* \ cugraph_clustering_result_get_vertices( cugraph_clustering_result_t* result @@ -195,7 +195,7 @@ cdef extern from "cugraph_c/community_algorithms.h": cugraph_clustering_result_get_clusters( cugraph_clustering_result_t* result ) - + cdef void \ cugraph_clustering_result_free( cugraph_clustering_result_t* result @@ -216,7 +216,7 @@ cdef extern from "cugraph_c/community_algorithms.h": cugraph_clustering_result_t** result, cugraph_error_t** error ) - + # Spectral modularity maximization cdef cugraph_error_code_t \ cugraph_spectral_modularity_maximization( @@ -232,7 +232,7 @@ cdef extern from "cugraph_c/community_algorithms.h": cugraph_clustering_result_t** result, cugraph_error_t** error ) - + # Analyze clustering modularity cdef cugraph_error_code_t \ cugraph_analyze_clustering_modularity( @@ -244,7 +244,7 @@ cdef extern from "cugraph_c/community_algorithms.h": double* score, cugraph_error_t** error ) - + # Analyze clustering edge cut cdef cugraph_error_code_t \ cugraph_analyze_clustering_edge_cut( @@ -256,7 +256,7 @@ cdef extern from "cugraph_c/community_algorithms.h": double* score, cugraph_error_t** error ) - + # Analyze clustering ratio cut cdef cugraph_error_code_t \ cugraph_analyze_clustering_ratio_cut( diff --git a/python/pylibcugraph/pylibcugraph/_cugraph_c/core_algorithms.pxd b/python/pylibcugraph/pylibcugraph/_cugraph_c/core_algorithms.pxd index 4d3509e8b7f..ed25faa33f4 100644 --- a/python/pylibcugraph/pylibcugraph/_cugraph_c/core_algorithms.pxd +++ b/python/pylibcugraph/pylibcugraph/_cugraph_c/core_algorithms.pxd @@ -1,4 +1,4 @@ -# Copyright (c) 2022, NVIDIA CORPORATION. +# Copyright (c) 2022-2024, 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 @@ -36,7 +36,7 @@ cdef extern from "cugraph_c/core_algorithms.h": # core number ctypedef struct cugraph_core_result_t: pass - + cdef cugraph_type_erased_device_array_view_t* \ cugraph_core_result_get_vertices( cugraph_core_result_t* result @@ -46,7 +46,7 @@ cdef extern from "cugraph_c/core_algorithms.h": cugraph_core_result_get_core_numbers( cugraph_core_result_t* result ) - + cdef void \ cugraph_core_result_free( cugraph_core_result_t* result @@ -66,7 +66,7 @@ cdef extern from "cugraph_c/core_algorithms.h": cugraph_core_result_t** result, cugraph_error_t** error ) - + ########################################################################### # k-core ctypedef struct cugraph_k_core_result_t: @@ -76,22 +76,22 @@ cdef extern from "cugraph_c/core_algorithms.h": cugraph_k_core_result_get_src_vertices( cugraph_k_core_result_t* result ) - + cdef cugraph_type_erased_device_array_view_t* \ cugraph_k_core_result_get_dst_vertices( cugraph_k_core_result_t* result ) - + cdef cugraph_type_erased_device_array_view_t* \ cugraph_k_core_result_get_weights( cugraph_k_core_result_t* result ) - + cdef void \ cugraph_k_core_result_free( cugraph_k_core_result_t* result ) - + cdef cugraph_error_code_t \ cugraph_core_result_create( const cugraph_resource_handle_t* handle, @@ -100,7 +100,7 @@ cdef extern from "cugraph_c/core_algorithms.h": cugraph_core_result_t** core_result, cugraph_error_t** error ) - + cdef cugraph_error_code_t \ cugraph_k_core( const cugraph_resource_handle_t* handle, diff --git a/python/pylibcugraph/pylibcugraph/_cugraph_c/graph.pxd b/python/pylibcugraph/pylibcugraph/_cugraph_c/graph.pxd index 28a9f5a3be5..4247bcc1b2a 100644 --- a/python/pylibcugraph/pylibcugraph/_cugraph_c/graph.pxd +++ b/python/pylibcugraph/pylibcugraph/_cugraph_c/graph.pxd @@ -1,4 +1,4 @@ -# Copyright (c) 2022-2023, NVIDIA CORPORATION. +# Copyright (c) 2022-2024, 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 @@ -51,7 +51,7 @@ cdef extern from "cugraph_c/graph.h": bool_t check, cugraph_graph_t** graph, cugraph_error_t** error) - + # Supports isolated vertices cdef cugraph_error_code_t \ cugraph_graph_create_sg( @@ -76,7 +76,7 @@ cdef extern from "cugraph_c/graph.h": cugraph_sg_graph_free( cugraph_graph_t* graph ) - + # FIXME: Might want to delete 'cugraph_sg_graph_free' and replace # 'cugraph_mg_graph_free' by 'cugraph_graph_free' cdef void \ @@ -105,7 +105,7 @@ cdef extern from "cugraph_c/graph.h": cugraph_mg_graph_free( cugraph_graph_t* graph ) - + cdef cugraph_error_code_t \ cugraph_sg_graph_create_from_csr( const cugraph_resource_handle_t* handle, @@ -121,7 +121,7 @@ cdef extern from "cugraph_c/graph.h": cugraph_graph_t** graph, cugraph_error_t** error ) - + cdef cugraph_error_code_t \ cugraph_graph_create_sg_from_csr( const cugraph_resource_handle_t* handle, @@ -137,12 +137,12 @@ cdef extern from "cugraph_c/graph.h": cugraph_graph_t** graph, cugraph_error_t** error ) - + cdef void \ cugraph_sg_graph_free( cugraph_graph_t* graph ) - + cdef cugraph_error_code_t \ cugraph_mg_graph_create( const cugraph_resource_handle_t* handle, @@ -158,7 +158,7 @@ cdef extern from "cugraph_c/graph.h": cugraph_graph_t** graph, cugraph_error_t** error ) - + cdef cugraph_error_code_t \ cugraph_graph_create_mg( const cugraph_resource_handle_t* handle, @@ -176,7 +176,7 @@ cdef extern from "cugraph_c/graph.h": bool_t do_expensive_check, cugraph_graph_t** graph, cugraph_error_t** error) - + cdef void \ cugraph_mg_graph_free( cugraph_graph_t* graph diff --git a/python/pylibcugraph/pylibcugraph/_cugraph_c/graph_functions.pxd b/python/pylibcugraph/pylibcugraph/_cugraph_c/graph_functions.pxd index 8b3a629956c..90bc041e5f0 100644 --- a/python/pylibcugraph/pylibcugraph/_cugraph_c/graph_functions.pxd +++ b/python/pylibcugraph/pylibcugraph/_cugraph_c/graph_functions.pxd @@ -1,4 +1,4 @@ -# Copyright (c) 2022-2023, NVIDIA CORPORATION. +# Copyright (c) 2022-2024, 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 @@ -42,7 +42,7 @@ cdef extern from "cugraph_c/graph_functions.h": #""" ctypedef struct cugraph_vertex_pairs_t: pass - + from pylibcugraph._cugraph_c.error cimport ( cugraph_error_code_t, @@ -61,22 +61,22 @@ cdef extern from "cugraph_c/graph_functions.h": # vertex_pairs ctypedef struct cugraph_vertex_pairs_t: pass - + cdef cugraph_type_erased_device_array_view_t* \ cugraph_vertex_pairs_get_first( cugraph_vertex_pairs_t* vertex_pairs ) - + cdef cugraph_type_erased_device_array_view_t* \ cugraph_vertex_pairs_get_second( cugraph_vertex_pairs_t* vertex_pairs ) - + cdef void \ cugraph_vertex_pairs_free( cugraph_vertex_pairs_t* vertex_pairs ) - + cdef cugraph_error_code_t \ cugraph_create_vertex_pairs( const cugraph_resource_handle_t* handle, @@ -86,21 +86,21 @@ cdef extern from "cugraph_c/graph_functions.h": cugraph_vertex_pairs_t** vertex_pairs, cugraph_error_t** error ) - + cdef cugraph_type_erased_device_array_view_t* \ cugraph_vertex_pairs_get_first( cugraph_vertex_pairs_t* vertex_pairs ) - + cdef cugraph_type_erased_device_array_view_t* \ cugraph_vertex_pairs_get_second( cugraph_vertex_pairs_t* vertex_pairs ) - + cdef void cugraph_vertex_pairs_free( cugraph_vertex_pairs_t* vertex_pairs ) - + cdef cugraph_error_code_t cugraph_two_hop_neighbors( const cugraph_resource_handle_t* handle, const cugraph_graph_t* graph, @@ -117,7 +117,7 @@ cdef extern from "cugraph_c/graph_functions.h": cugraph_vertex_pairs_t** result, cugraph_error_t** error ) - + ########################################################################### # induced_subgraph ctypedef struct cugraph_induced_subgraph_result_t: @@ -127,37 +127,37 @@ cdef extern from "cugraph_c/graph_functions.h": cugraph_induced_subgraph_get_sources( cugraph_induced_subgraph_result_t* induced_subgraph ) - + cdef cugraph_type_erased_device_array_view_t* \ cugraph_induced_subgraph_get_destinations( cugraph_induced_subgraph_result_t* induced_subgraph ) - + cdef cugraph_type_erased_device_array_view_t* \ cugraph_induced_subgraph_get_edge_weights( cugraph_induced_subgraph_result_t* induced_subgraph ) - + cdef cugraph_type_erased_device_array_view_t* \ cugraph_induced_subgraph_get_edge_ids( cugraph_induced_subgraph_result_t* induced_subgraph ) - + cdef cugraph_type_erased_device_array_view_t* \ cugraph_induced_subgraph_get_edge_type_ids( cugraph_induced_subgraph_result_t* induced_subgraph ) - + cdef cugraph_type_erased_device_array_view_t* \ cugraph_induced_subgraph_get_subgraph_offsets( cugraph_induced_subgraph_result_t* induced_subgraph ) - + cdef void \ cugraph_induced_subgraph_result_free( cugraph_induced_subgraph_result_t* induced_subgraph ) - + cdef cugraph_error_code_t \ cugraph_extract_induced_subgraph( const cugraph_resource_handle_t* handle, diff --git a/python/pylibcugraph/pylibcugraph/_cugraph_c/labeling_algorithms.pxd b/python/pylibcugraph/pylibcugraph/_cugraph_c/labeling_algorithms.pxd index 7c911235a54..53c4c382d58 100644 --- a/python/pylibcugraph/pylibcugraph/_cugraph_c/labeling_algorithms.pxd +++ b/python/pylibcugraph/pylibcugraph/_cugraph_c/labeling_algorithms.pxd @@ -1,4 +1,4 @@ -# Copyright (c) 2022, NVIDIA CORPORATION. +# Copyright (c) 2022-2024, 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 @@ -41,17 +41,17 @@ cdef extern from "cugraph_c/labeling_algorithms.h": cugraph_labeling_result_get_vertices( cugraph_labeling_result_t* result ) - + cdef cugraph_type_erased_device_array_view_t* \ cugraph_labeling_result_get_labels( cugraph_labeling_result_t* result ) - + cdef void \ cugraph_labeling_result_free( cugraph_labeling_result_t* result ) - + cdef cugraph_error_code_t \ cugraph_weakly_connected_components( const cugraph_resource_handle_t* handle, @@ -60,4 +60,3 @@ cdef extern from "cugraph_c/labeling_algorithms.h": cugraph_labeling_result_t** result, cugraph_error_t** error ) - \ No newline at end of file diff --git a/python/pylibcugraph/pylibcugraph/_cugraph_c/resource_handle.pxd b/python/pylibcugraph/pylibcugraph/_cugraph_c/resource_handle.pxd index e9e74723e06..f3f43d55dff 100644 --- a/python/pylibcugraph/pylibcugraph/_cugraph_c/resource_handle.pxd +++ b/python/pylibcugraph/pylibcugraph/_cugraph_c/resource_handle.pxd @@ -1,4 +1,4 @@ -# Copyright (c) 2022-2023, NVIDIA CORPORATION. +# Copyright (c) 2022-2024, 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 @@ -29,7 +29,7 @@ cdef extern from "cugraph_c/resource_handle.h": FLOAT32 FLOAT64 SIZE_T - + ctypedef data_type_id_t cugraph_data_type_id_t ctypedef int8_t byte_t diff --git a/python/pylibcugraph/pylibcugraph/_cugraph_c/similarity_algorithms.pxd b/python/pylibcugraph/pylibcugraph/_cugraph_c/similarity_algorithms.pxd index 0d98bb8e14a..406094f18d5 100644 --- a/python/pylibcugraph/pylibcugraph/_cugraph_c/similarity_algorithms.pxd +++ b/python/pylibcugraph/pylibcugraph/_cugraph_c/similarity_algorithms.pxd @@ -1,4 +1,4 @@ -# Copyright (c) 2022, NVIDIA CORPORATION. +# Copyright (c) 2022-2024, 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 @@ -45,12 +45,12 @@ cdef extern from "cugraph_c/similarity_algorithms.h": cugraph_similarity_result_get_similarity( cugraph_similarity_result_t* result ) - + cdef void \ cugraph_similarity_result_free( cugraph_similarity_result_t* result ) - + ########################################################################### # jaccard coefficients cdef cugraph_error_code_t \ diff --git a/python/pylibcugraph/pylibcugraph/analyze_clustering_modularity.pyx b/python/pylibcugraph/pylibcugraph/analyze_clustering_modularity.pyx index 2e7c1d2f649..907d08bef67 100644 --- a/python/pylibcugraph/pylibcugraph/analyze_clustering_modularity.pyx +++ b/python/pylibcugraph/pylibcugraph/analyze_clustering_modularity.pyx @@ -1,4 +1,4 @@ -# Copyright (c) 2023, NVIDIA CORPORATION. +# Copyright (c) 2023-2024, 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 @@ -133,7 +133,7 @@ def analyze_clustering_modularity(ResourceHandle resource_handle, &score, &error_ptr) assert_success(error_code, error_ptr, "cugraph_analyze_clustering_modularity") - + if vertex is not None: cugraph_type_erased_device_array_view_free(vertex_view_ptr) if cluster is not None: diff --git a/python/pylibcugraph/pylibcugraph/balanced_cut_clustering.pyx b/python/pylibcugraph/pylibcugraph/balanced_cut_clustering.pyx index a1a5c8182eb..e0ec2f77233 100644 --- a/python/pylibcugraph/pylibcugraph/balanced_cut_clustering.pyx +++ b/python/pylibcugraph/pylibcugraph/balanced_cut_clustering.pyx @@ -1,4 +1,4 @@ -# Copyright (c) 2023, NVIDIA CORPORATION. +# Copyright (c) 2023-2024, 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 @@ -90,7 +90,7 @@ def balanced_cut_clustering(ResourceHandle resource_handle, kmean_max_iter: size_t Specifies the maximum number of iterations for the k-means solver. - + do_expensive_check : bool_t If True, performs more extensive tests on the inputs to ensure validitity, at the expense of increased run time. diff --git a/python/pylibcugraph/pylibcugraph/betweenness_centrality.pyx b/python/pylibcugraph/pylibcugraph/betweenness_centrality.pyx index 5087314c725..85df88b9001 100644 --- a/python/pylibcugraph/pylibcugraph/betweenness_centrality.pyx +++ b/python/pylibcugraph/pylibcugraph/betweenness_centrality.pyx @@ -1,4 +1,4 @@ -# Copyright (c) 2023, NVIDIA CORPORATION. +# Copyright (c) 2023-2024, 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 @@ -93,7 +93,7 @@ def betweenness_centrality(ResourceHandle resource_handle, Using None defaults to a hash of process id, time, and hostname If k is either None or list or cudf objects: random_state parameter is ignored. - + normalized : bool_t Normalization will ensure that values are in [0, 1]. @@ -102,7 +102,7 @@ def betweenness_centrality(ResourceHandle resource_handle, do_expensive_check : bool_t A flag to run expensive checks for input arguments if True. - + Returns ------- @@ -113,7 +113,7 @@ def betweenness_centrality(ResourceHandle resource_handle, if isinstance(k, int): # randomly select vertices - + #'select_random_vertices' internally creates a # 'pylibcugraph.random.CuGraphRandomState' vertex_list = select_random_vertices( @@ -150,7 +150,7 @@ def betweenness_centrality(ResourceHandle resource_handle, cugraph_centrality_result_get_vertices(result_ptr) cdef cugraph_type_erased_device_array_view_t* values_ptr = \ cugraph_centrality_result_get_values(result_ptr) - + cupy_vertices = copy_to_cupy_array(c_resource_handle_ptr, vertices_ptr) cupy_values = copy_to_cupy_array(c_resource_handle_ptr, values_ptr) diff --git a/python/pylibcugraph/pylibcugraph/bfs.pyx b/python/pylibcugraph/pylibcugraph/bfs.pyx index 3034dcc8cb1..e65e94a8020 100644 --- a/python/pylibcugraph/pylibcugraph/bfs.pyx +++ b/python/pylibcugraph/pylibcugraph/bfs.pyx @@ -1,4 +1,4 @@ -# Copyright (c) 2022-2023, NVIDIA CORPORATION. +# Copyright (c) 2022-2024, 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 @@ -52,8 +52,8 @@ from pylibcugraph.graphs cimport ( _GPUGraph, ) -def bfs(ResourceHandle handle, _GPUGraph graph, - sources, bool_t direction_optimizing, int32_t depth_limit, +def bfs(ResourceHandle handle, _GPUGraph graph, + sources, bool_t direction_optimizing, int32_t depth_limit, bool_t compute_predecessors, bool_t do_expensive_check): """ Performs a Breadth-first search starting from the provided sources. @@ -110,10 +110,10 @@ def bfs(ResourceHandle handle, _GPUGraph graph, >>> weights = G.edgelist.edgelist_df['weights'] >>> >>> sg = SGGraph( - >>> resource_handle = handle, - >>> graph_properties = GraphProperties(is_multigraph=G.is_multigraph()), - >>> src_array = srcs, - >>> dst_array = dsts, + >>> resource_handle = handle, + >>> graph_properties = GraphProperties(is_multigraph=G.is_multigraph()), + >>> src_array = srcs, + >>> dst_array = dsts, >>> weight_array = weights, >>> store_transposed=False, >>> renumber=False, @@ -121,7 +121,7 @@ def bfs(ResourceHandle handle, _GPUGraph graph, >>> ) >>> >>> res = pylibcugraph_bfs( - >>> handle, + >>> handle, >>> sg, >>> cudf.Series([0], dtype='int32'), >>> False, @@ -164,7 +164,7 @@ def bfs(ResourceHandle handle, _GPUGraph graph, cai_sources_ptr, len(sources), get_c_type_from_numpy_type(sources.dtype)) - + cdef cugraph_paths_result_t* result_ptr error_code = cugraph_bfs( @@ -186,7 +186,7 @@ def bfs(ResourceHandle handle, _GPUGraph graph, cdef cugraph_type_erased_device_array_view_t* predecessors_ptr = \ cugraph_paths_result_get_predecessors(result_ptr) - + cdef cugraph_type_erased_device_array_view_t* vertices_ptr = \ cugraph_paths_result_get_vertices(result_ptr) @@ -194,7 +194,7 @@ def bfs(ResourceHandle handle, _GPUGraph graph, cupy_distances = copy_to_cupy_array(c_resource_handle_ptr, distances_ptr) cupy_predecessors = copy_to_cupy_array(c_resource_handle_ptr, predecessors_ptr) cupy_vertices = copy_to_cupy_array(c_resource_handle_ptr, vertices_ptr) - + # deallocate the no-longer needed result struct cugraph_paths_result_free(result_ptr) diff --git a/python/pylibcugraph/pylibcugraph/components/_connectivity.pyx b/python/pylibcugraph/pylibcugraph/components/_connectivity.pyx index 02e7549d1c5..9f5b84f260d 100644 --- a/python/pylibcugraph/pylibcugraph/components/_connectivity.pyx +++ b/python/pylibcugraph/pylibcugraph/components/_connectivity.pyx @@ -1,4 +1,4 @@ -# Copyright (c) 2021-2022, NVIDIA CORPORATION. +# Copyright (c) 2021-2024, 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 @@ -128,4 +128,3 @@ def strongly_connected_components(offsets, indices, weights, num_verts, num_edge cdef cugraph_cc_t connect_type=CUGRAPH_STRONG connected_components(g, connect_type, c_labels) - diff --git a/python/pylibcugraph/pylibcugraph/core_number.pyx b/python/pylibcugraph/pylibcugraph/core_number.pyx index 7d0c42f7dd0..50ce5bfe965 100644 --- a/python/pylibcugraph/pylibcugraph/core_number.pyx +++ b/python/pylibcugraph/pylibcugraph/core_number.pyx @@ -1,4 +1,4 @@ -# Copyright (c) 2022, NVIDIA CORPORATION. +# Copyright (c) 2022-2024, 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 @@ -31,7 +31,7 @@ from pylibcugraph._cugraph_c.array cimport ( from pylibcugraph._cugraph_c.graph cimport ( cugraph_graph_t, ) -from pylibcugraph._cugraph_c.core_algorithms cimport ( +from pylibcugraph._cugraph_c.core_algorithms cimport ( cugraph_core_result_t, cugraph_core_number, cugraph_k_core_degree_type_t, @@ -63,17 +63,17 @@ def core_number(ResourceHandle resource_handle, resource_handle: ResourceHandle Handle to the underlying device and host resource needed for referencing data and running algorithms. - + graph : SGGraph or MGGraph The input graph, for either Single or Multi-GPU operations. - + degree_type: str This option determines if the core number computation should be based on input, output, or both directed edges, with valid values being "incoming", "outgoing", and "bidirectional" respectively. This option is currently ignored in this release, and setting it will result in a warning. - + do_expensive_check: bool If True, performs more extensive tests on the inputs to ensure validity, at the expense of increased run time. diff --git a/python/pylibcugraph/pylibcugraph/ecg.pyx b/python/pylibcugraph/pylibcugraph/ecg.pyx index 9e414fccb0f..4e5407348e3 100644 --- a/python/pylibcugraph/pylibcugraph/ecg.pyx +++ b/python/pylibcugraph/pylibcugraph/ecg.pyx @@ -73,7 +73,7 @@ def ecg(ResourceHandle resource_handle, graph : SGGraph The input graph. - + min_weight : double, optional (default=0.5) The minimum value to assign as an edgeweight in the ECG algorithm. It should be a value in the range [0,1] usually left as the default @@ -83,7 +83,7 @@ def ecg(ResourceHandle resource_handle, The number of graph permutations to use for the ensemble. The default value is 16, larger values may produce higher quality partitions for some graphs. - + do_expensive_check : bool_t If True, performs more extensive tests on the inputs to ensure validitity, at the expense of increased run time. diff --git a/python/pylibcugraph/pylibcugraph/edge_betweenness_centrality.pyx b/python/pylibcugraph/pylibcugraph/edge_betweenness_centrality.pyx index e1dae1ff10a..75a950eaa34 100644 --- a/python/pylibcugraph/pylibcugraph/edge_betweenness_centrality.pyx +++ b/python/pylibcugraph/pylibcugraph/edge_betweenness_centrality.pyx @@ -1,4 +1,4 @@ -# Copyright (c) 2023, NVIDIA CORPORATION. +# Copyright (c) 2023-2024, 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 @@ -92,13 +92,13 @@ def edge_betweenness_centrality(ResourceHandle resource_handle, Using None defaults to a hash of process id, time, and hostname If k is either None or list or cudf objects: random_state parameter is ignored. - + normalized : bool_t Normalization will ensure that values are in [0, 1]. do_expensive_check : bool_t A flag to run expensive checks for input arguments if True. - + Returns ------- A tuple of device arrays corresponding to the sources, destinations, edge @@ -140,7 +140,7 @@ def edge_betweenness_centrality(ResourceHandle resource_handle, if isinstance(k, int): # randomly select vertices - + #'select_random_vertices' internally creates a # 'pylibcugraph.random.CuGraphRandomState' vertex_list = select_random_vertices( @@ -179,14 +179,14 @@ def edge_betweenness_centrality(ResourceHandle resource_handle, cugraph_edge_centrality_result_get_dst_vertices(result_ptr) cdef cugraph_type_erased_device_array_view_t* values_ptr = \ cugraph_edge_centrality_result_get_values(result_ptr) - + if graph.edge_id_view_ptr is NULL and graph.edge_id_view_ptr_ptr is NULL: cupy_edge_ids = None else: edge_ids_ptr = cugraph_edge_centrality_result_get_edge_ids(result_ptr) cupy_edge_ids = copy_to_cupy_array(c_resource_handle_ptr, edge_ids_ptr) - - + + cupy_src_vertices = copy_to_cupy_array(c_resource_handle_ptr, src_ptr) cupy_dst_vertices = copy_to_cupy_array(c_resource_handle_ptr, dst_ptr) cupy_values = copy_to_cupy_array(c_resource_handle_ptr, values_ptr) diff --git a/python/pylibcugraph/pylibcugraph/egonet.pyx b/python/pylibcugraph/pylibcugraph/egonet.pyx index e7237cc3ba4..070ea1fdd85 100644 --- a/python/pylibcugraph/pylibcugraph/egonet.pyx +++ b/python/pylibcugraph/pylibcugraph/egonet.pyx @@ -1,4 +1,4 @@ -# Copyright (c) 2022-2023, NVIDIA CORPORATION. +# Copyright (c) 2022-2024, 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 @@ -153,10 +153,10 @@ def ego_graph(ResourceHandle resource_handle, # for perfomance improvement cupy_sources = copy_to_cupy_array( c_resource_handle_ptr, sources_ptr) - + cupy_destinations = copy_to_cupy_array( c_resource_handle_ptr, destinations_ptr) - + if edge_weights_ptr is not NULL: cupy_edge_weights = copy_to_cupy_array( c_resource_handle_ptr, edge_weights_ptr) diff --git a/python/pylibcugraph/pylibcugraph/eigenvector_centrality.pyx b/python/pylibcugraph/pylibcugraph/eigenvector_centrality.pyx index 568f072ee3d..baa69eb2e30 100644 --- a/python/pylibcugraph/pylibcugraph/eigenvector_centrality.pyx +++ b/python/pylibcugraph/pylibcugraph/eigenvector_centrality.pyx @@ -1,4 +1,4 @@ -# Copyright (c) 2022-2023, NVIDIA CORPORATION. +# Copyright (c) 2022-2024, 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 @@ -127,7 +127,7 @@ def eigenvector_centrality(ResourceHandle resource_handle, cugraph_centrality_result_get_vertices(result_ptr) cdef cugraph_type_erased_device_array_view_t* values_ptr = \ cugraph_centrality_result_get_values(result_ptr) - + cupy_vertices = copy_to_cupy_array(c_resource_handle_ptr, vertices_ptr) cupy_values = copy_to_cupy_array(c_resource_handle_ptr, values_ptr) diff --git a/python/pylibcugraph/pylibcugraph/generate_rmat_edgelist.pyx b/python/pylibcugraph/pylibcugraph/generate_rmat_edgelist.pyx index d09d60ff15b..f38ad21d3b0 100644 --- a/python/pylibcugraph/pylibcugraph/generate_rmat_edgelist.pyx +++ b/python/pylibcugraph/pylibcugraph/generate_rmat_edgelist.pyx @@ -1,4 +1,4 @@ -# Copyright (c) 2023, NVIDIA CORPORATION. +# Copyright (c) 2023-2024, 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 @@ -82,19 +82,19 @@ def generate_rmat_edgelist(ResourceHandle resource_handle, resource_handle : ResourceHandle Handle to the underlying device resources needed for referencing data and running algorithms. - + random_state : int , optional Random state to use when generating samples. Optional argument, defaults to a hash of process id, time, and hostname. (See pylibcugraph.random.CuGraphRandomState) - + scale : size_t Scale factor to set the number of vertices in the graph Vertex IDs have values in [0, V), where V = 1 << 'scale' - + num_edges : size_t Number of edges to generate - + a : double Probability of the edge being in the first partition The Graph 500 spec sets this value to 0.57 @@ -106,39 +106,39 @@ def generate_rmat_edgelist(ResourceHandle resource_handle, c : double Probability of the edge being in the third partition The Graph 500 spec sets this value to 0.19 - + clip_and_flip : bool Flag controlling whether to generate edges only in the lower triangular part (including the diagonal) of the graph adjacency matrix (if set to 'true') or not (if set to 'false). - + scramble_vertex_ids : bool Flag controlling whether to scramble vertex ID bits (if set to `true`) or not (if set to `false`); scrambling vertex ID bits breaks correlation between vertex ID values and vertex degrees. - + include_edge_weights : bool Flag controlling whether to generate edges with weights (if set to 'true') or not (if set to 'false'). minimum_weight : double Minimum weight value to generate (if 'include_edge_weights' is 'true') - + maximum_weight : double Maximum weight value to generate (if 'include_edge_weights' is 'true') - + dtype : string The type of weight to generate ("FLOAT32" or "FLOAT64"), ignored unless include_weights is true - + include_edge_ids : bool Flag controlling whether to generate edges with ids (if set to 'true') or not (if set to 'false'). - + include_edge_types : bool Flag controlling whether to generate edges with types (if set to 'true') or not (if set to 'false'). - + min_edge_type_value : int Minimum edge type to generate if 'include_edge_types' is 'true' otherwise, this parameter is ignored. @@ -146,7 +146,7 @@ def generate_rmat_edgelist(ResourceHandle resource_handle, max_edge_type_value : int Maximum edge type to generate if 'include_edge_types' is 'true' otherwise, this paramter is ignored. - + multi_gpu : bool Flag if the COO is being created on multiple GPUs @@ -188,7 +188,7 @@ def generate_rmat_edgelist(ResourceHandle resource_handle, cdef cugraph_type_erased_device_array_view_t* \ destinations_view_ptr = cugraph_coo_get_destinations(result_coo_ptr) - + cdef cugraph_type_erased_device_array_view_t* edge_weights_view_ptr cupy_edge_weights = None @@ -209,13 +209,13 @@ def generate_rmat_edgelist(ResourceHandle resource_handle, edge_weights_view_ptr = cugraph_coo_get_edge_weights(result_coo_ptr) cupy_edge_weights = copy_to_cupy_array(c_resource_handle_ptr, edge_weights_view_ptr) - + if include_edge_ids: error_code = cugraph_generate_edge_ids(c_resource_handle_ptr, result_coo_ptr, multi_gpu, &error_ptr) - + assert_success(error_code, error_ptr, "generate_edge_ids") edge_ids_view_ptr = cugraph_coo_get_edge_id(result_coo_ptr) @@ -228,7 +228,7 @@ def generate_rmat_edgelist(ResourceHandle resource_handle, min_edge_type_value, max_edge_type_value, &error_ptr) - + assert_success(error_code, error_ptr, "generate_edge_types") edge_type_view_ptr = cugraph_coo_get_edge_type(result_coo_ptr) @@ -236,10 +236,10 @@ def generate_rmat_edgelist(ResourceHandle resource_handle, - - + + cupy_sources = copy_to_cupy_array(c_resource_handle_ptr, sources_view_ptr) - cupy_destinations = copy_to_cupy_array(c_resource_handle_ptr, destinations_view_ptr) + cupy_destinations = copy_to_cupy_array(c_resource_handle_ptr, destinations_view_ptr) cugraph_coo_free(result_coo_ptr) diff --git a/python/pylibcugraph/pylibcugraph/generate_rmat_edgelists.pyx b/python/pylibcugraph/pylibcugraph/generate_rmat_edgelists.pyx index d5a89f8a222..32af0c13fc0 100644 --- a/python/pylibcugraph/pylibcugraph/generate_rmat_edgelists.pyx +++ b/python/pylibcugraph/pylibcugraph/generate_rmat_edgelists.pyx @@ -1,4 +1,4 @@ -# Copyright (c) 2023, NVIDIA CORPORATION. +# Copyright (c) 2023-2024, 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 @@ -88,24 +88,24 @@ def generate_rmat_edgelists(ResourceHandle resource_handle, resource_handle : ResourceHandle Handle to the underlying device resources needed for referencing data and running algorithms. - + random_state : int , optional Random state to use when generating samples. Optional argument, defaults to a hash of process id, time, and hostname. (See pylibcugraph.random.CuGraphRandomState) - + n_edgelists : size_t Number of edge lists (graphs) to generate - + min_scale : size_t Scale factor to set the minimum number of vertices in the graph max_scale : size_t Scale factor to set the maximum number of vertices in the graph - + edge_factor : size_t Average number of edges per vertex to generate - + size_distribution : int Distribution of the graph sizes, impacts the scale parameter of the R-MAT generator. @@ -115,39 +115,39 @@ def generate_rmat_edgelists(ResourceHandle resource_handle, Edges distribution for each graph, impacts how R-MAT parameters a,b,c,d, are set. '0' for POWER_LAW distribution and '1' for UNIFORM distribution - + clip_and_flip : bool Flag controlling whether to generate edges only in the lower triangular part (including the diagonal) of the graph adjacency matrix (if set to 'true') or not (if set to 'false') - + scramble_vertex_ids : bool Flag controlling whether to scramble vertex ID bits (if set to `true`) or not (if set to `false`); scrambling vertex ID bits breaks correlation between vertex ID values and vertex degrees. - + include_edge_weights : bool Flag controlling whether to generate edges with weights (if set to 'true') or not (if set to 'false'). minimum_weight : double Minimum weight value to generate (if 'include_edge_weights' is 'true') - + maximum_weight : double Maximum weight value to generate (if 'include_edge_weights' is 'true') - + dtype : string The type of weight to generate ("FLOAT32" or "FLOAT64"), ignored unless include_weights is true - + include_edge_ids : bool Flag controlling whether to generate edges with ids (if set to 'true') or not (if set to 'false'). - + include_edge_types : bool Flag controlling whether to generate edges with types (if set to 'true') or not (if set to 'false'). - + min_edge_type_value : int Minimum edge type to generate if 'include_edge_types' is 'true' otherwise, this parameter is ignored. @@ -178,12 +178,12 @@ def generate_rmat_edgelists(ResourceHandle resource_handle, cdef cugraph_generator_distribution_t size_distribution_ cdef cugraph_generator_distribution_t edge_distribution_ - + if size_distribution == 0: size_distribution_ = cugraph_generator_distribution_t.POWER_LAW else: size_distribution_ = cugraph_generator_distribution_t.UNIFORM - + if edge_distribution == 0: edge_distribution_ = cugraph_generator_distribution_t.POWER_LAW else: @@ -237,7 +237,7 @@ def generate_rmat_edgelists(ResourceHandle resource_handle, edge_weights_view_ptr = cugraph_coo_get_edge_weights(result_coo_ptr) cupy_edge_weights = copy_to_cupy_array(c_resource_handle_ptr, edge_weights_view_ptr) - + if include_edge_ids: @@ -245,7 +245,7 @@ def generate_rmat_edgelists(ResourceHandle resource_handle, result_coo_ptr, multi_gpu, &error_ptr) - + assert_success(error_code, error_ptr, "generate_edge_ids") edge_ids_view_ptr = cugraph_coo_get_edge_id(result_coo_ptr) @@ -258,7 +258,7 @@ def generate_rmat_edgelists(ResourceHandle resource_handle, min_edge_type_value, max_edge_type_value, &error_ptr) - + assert_success(error_code, error_ptr, "generate_edge_types") edge_type_view_ptr = cugraph_coo_get_edge_type(result_coo_ptr) diff --git a/python/pylibcugraph/pylibcugraph/graphs.pxd b/python/pylibcugraph/pylibcugraph/graphs.pxd index dac69e0ad04..f9dd690e46f 100644 --- a/python/pylibcugraph/pylibcugraph/graphs.pxd +++ b/python/pylibcugraph/pylibcugraph/graphs.pxd @@ -1,4 +1,4 @@ -# Copyright (c) 2022-2023, NVIDIA CORPORATION. +# Copyright (c) 2022-2024, 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 @@ -26,12 +26,11 @@ cdef class _GPUGraph: cdef cugraph_graph_t* c_graph_ptr cdef cugraph_type_erased_device_array_view_t* edge_id_view_ptr cdef cugraph_type_erased_device_array_view_t** edge_id_view_ptr_ptr - cdef cugraph_type_erased_device_array_view_t* weights_view_ptr - cdef cugraph_type_erased_device_array_view_t** weights_view_ptr_ptr + cdef cugraph_type_erased_device_array_view_t* weights_view_ptr + cdef cugraph_type_erased_device_array_view_t** weights_view_ptr_ptr cdef class SGGraph(_GPUGraph): pass cdef class MGGraph(_GPUGraph): pass - diff --git a/python/pylibcugraph/pylibcugraph/hits.pyx b/python/pylibcugraph/pylibcugraph/hits.pyx index 4524a4f70df..3204ac2ba57 100644 --- a/python/pylibcugraph/pylibcugraph/hits.pyx +++ b/python/pylibcugraph/pylibcugraph/hits.pyx @@ -1,4 +1,4 @@ -# Copyright (c) 2022-2023, NVIDIA CORPORATION. +# Copyright (c) 2022-2024, 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 @@ -78,7 +78,7 @@ def hits(ResourceHandle resource_handle, graph : SGGraph or MGGraph The input graph, for either Single or Multi-GPU operations. - + tol : float, optional (default=1.0e-5) Set the tolerance the approximation, this parameter should be a small magnitude value. This parameter is not currently supported. @@ -104,7 +104,7 @@ def hits(ResourceHandle resource_handle, A tuple of device arrays, where the third item in the tuple is a device array containing the vertex identifiers, the first and second items are device arrays containing respectively the hubs and authorities values for the corresponding - vertices + vertices Examples -------- @@ -118,13 +118,13 @@ def hits(ResourceHandle resource_handle, cdef cugraph_type_erased_device_array_view_t* initial_hubs_guess_vertices_view_ptr = NULL cdef cugraph_type_erased_device_array_view_t* initial_hubs_guess_values_view_ptr = NULL - # FIXME: Add check ensuring that both initial_hubs_guess_vertices + # FIXME: Add check ensuring that both initial_hubs_guess_vertices # and initial_hubs_guess_values are passed when calling only pylibcugraph HITS. # This is already True for cugraph HITS - - if initial_hubs_guess_vertices is not None: + + if initial_hubs_guess_vertices is not None: assert_CAI_type(initial_hubs_guess_vertices, "initial_hubs_guess_vertices") - + cai_initial_hubs_guess_vertices_ptr = \ initial_hubs_guess_vertices.__cuda_array_interface__["data"][0] @@ -133,7 +133,7 @@ def hits(ResourceHandle resource_handle, cai_initial_hubs_guess_vertices_ptr, len(initial_hubs_guess_vertices), get_c_type_from_numpy_type(initial_hubs_guess_vertices.dtype)) - + if initial_hubs_guess_values is not None: assert_CAI_type(initial_hubs_guess_values, "initial_hubs_guess_values") @@ -179,13 +179,13 @@ def hits(ResourceHandle resource_handle, cupy_hubs = copy_to_cupy_array(c_resource_handle_ptr, hubs_ptr) cupy_authorities = copy_to_cupy_array(c_resource_handle_ptr, authorities_ptr) - + cugraph_hits_result_free(result_ptr) if initial_hubs_guess_vertices is not None: cugraph_type_erased_device_array_view_free( initial_hubs_guess_vertices_view_ptr) - + if initial_hubs_guess_values is not None: cugraph_type_erased_device_array_view_free( initial_hubs_guess_values_view_ptr) diff --git a/python/pylibcugraph/pylibcugraph/induced_subgraph.pyx b/python/pylibcugraph/pylibcugraph/induced_subgraph.pyx index 99b89ec2a58..6fd6d7b9af3 100644 --- a/python/pylibcugraph/pylibcugraph/induced_subgraph.pyx +++ b/python/pylibcugraph/pylibcugraph/induced_subgraph.pyx @@ -1,4 +1,4 @@ -# Copyright (c) 2023, NVIDIA CORPORATION. +# Copyright (c) 2023-2024, 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 @@ -69,10 +69,10 @@ def induced_subgraph(ResourceHandle resource_handle, graph : SGGraph or MGGraph The input graph. - + subgraph_vertices : cupy array array of vertices to include in extracted subgraph. - + subgraph_offsets : cupy array array of subgraph offsets into subgraph_vertices. diff --git a/python/pylibcugraph/pylibcugraph/internal_types/sampling_result.pyx b/python/pylibcugraph/pylibcugraph/internal_types/sampling_result.pyx index 9f98b4f37b0..f588237942b 100644 --- a/python/pylibcugraph/pylibcugraph/internal_types/sampling_result.pyx +++ b/python/pylibcugraph/pylibcugraph/internal_types/sampling_result.pyx @@ -1,4 +1,4 @@ -# Copyright (c) 2022-2023, NVIDIA CORPORATION. +# Copyright (c) 2022-2024, 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 @@ -68,13 +68,13 @@ cdef class SamplingResult: if self.c_sample_result_ptr is NULL: raise ValueError("pointer not set, must call set_ptr() with a " "non-NULL value first.") - + cdef cugraph_type_erased_device_array_view_t* device_array_view_ptr = ( cugraph_sample_result_get_major_offsets(self.c_sample_result_ptr) ) if device_array_view_ptr is NULL: return None - + return create_cupy_array_view_for_device_ptr(device_array_view_ptr, self) @@ -87,7 +87,7 @@ cdef class SamplingResult: ) if device_array_view_ptr is NULL: return None - + return create_cupy_array_view_for_device_ptr(device_array_view_ptr, self) @@ -100,7 +100,7 @@ cdef class SamplingResult: ) if device_array_view_ptr is NULL: return None - + return create_cupy_array_view_for_device_ptr(device_array_view_ptr, self) @@ -114,7 +114,7 @@ cdef class SamplingResult: ) if device_array_view_ptr is NULL: return None - + return create_cupy_array_view_for_device_ptr(device_array_view_ptr, self) @@ -128,7 +128,7 @@ cdef class SamplingResult: ) if device_array_view_ptr is NULL: return None - + return create_cupy_array_view_for_device_ptr(device_array_view_ptr, self) @@ -149,7 +149,7 @@ cdef class SamplingResult: def get_indices(self): # Deprecated return self.get_edge_weights() - + def get_edge_ids(self): if self.c_sample_result_ptr is NULL: raise ValueError("pointer not set, must call set_ptr() with a " @@ -177,7 +177,7 @@ cdef class SamplingResult: return create_cupy_array_view_for_device_ptr(device_array_view_ptr, self) - + def get_batch_ids(self): if self.c_sample_result_ptr is NULL: raise ValueError("pointer not set, must call set_ptr() with a " @@ -187,7 +187,7 @@ cdef class SamplingResult: ) if device_array_view_ptr is NULL: return None - + return create_cupy_array_view_for_device_ptr(device_array_view_ptr, self) @@ -200,7 +200,7 @@ cdef class SamplingResult: ) if device_array_view_ptr is NULL: return None - + return create_cupy_array_view_for_device_ptr(device_array_view_ptr, self) @@ -214,7 +214,7 @@ cdef class SamplingResult: ) if device_array_view_ptr is NULL: return None - + return create_cupy_array_view_for_device_ptr(device_array_view_ptr, self) @@ -228,7 +228,7 @@ cdef class SamplingResult: ) if device_array_view_ptr is NULL: return None - + return create_cupy_array_view_for_device_ptr(device_array_view_ptr, self) @@ -241,7 +241,7 @@ cdef class SamplingResult: ) if device_array_view_ptr is NULL: return None - + return create_cupy_array_view_for_device_ptr(device_array_view_ptr, self) @@ -254,6 +254,6 @@ cdef class SamplingResult: ) if device_array_view_ptr is NULL: return None - + return create_cupy_array_view_for_device_ptr(device_array_view_ptr, - self) \ No newline at end of file + self) diff --git a/python/pylibcugraph/pylibcugraph/jaccard_coefficients.pyx b/python/pylibcugraph/pylibcugraph/jaccard_coefficients.pyx index 59e94aeb615..9611f2ad884 100644 --- a/python/pylibcugraph/pylibcugraph/jaccard_coefficients.pyx +++ b/python/pylibcugraph/pylibcugraph/jaccard_coefficients.pyx @@ -1,4 +1,4 @@ -# Copyright (c) 2022-2023, NVIDIA CORPORATION. +# Copyright (c) 2022-2024, 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 @@ -67,7 +67,7 @@ def jaccard_coefficients(ResourceHandle resource_handle, bool_t do_expensive_check): """ Compute the Jaccard coefficients for the specified vertex_pairs. - + Note that Jaccard similarity must run on a symmetric graph. Parameters @@ -78,13 +78,13 @@ def jaccard_coefficients(ResourceHandle resource_handle, graph : SGGraph or MGGraph The input graph, for either Single or Multi-GPU operations. - + first : Source of the vertex pair. - + second : Destination of the vertex pair. - + use_weight : bool, optional If set to True, the compute weighted jaccard_coefficients( the input graph must be weighted in that case). diff --git a/python/pylibcugraph/pylibcugraph/k_core.pyx b/python/pylibcugraph/pylibcugraph/k_core.pyx index c47cfef7a7a..6e37ee778e9 100644 --- a/python/pylibcugraph/pylibcugraph/k_core.pyx +++ b/python/pylibcugraph/pylibcugraph/k_core.pyx @@ -1,4 +1,4 @@ -# Copyright (c) 2022-2023, NVIDIA CORPORATION. +# Copyright (c) 2022-2024, 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 @@ -31,7 +31,7 @@ from pylibcugraph._cugraph_c.array cimport ( from pylibcugraph._cugraph_c.graph cimport ( cugraph_graph_t, ) -from pylibcugraph._cugraph_c.core_algorithms cimport ( +from pylibcugraph._cugraph_c.core_algorithms cimport ( cugraph_core_result_t, cugraph_k_core_result_t, cugraph_core_result_create, @@ -72,21 +72,21 @@ def k_core(ResourceHandle resource_handle, resource_handle: ResourceHandle Handle to the underlying device and host resource needed for referencing data and running algorithms. - + graph : SGGraph or MGGraph The input graph, for either Single or Multi-GPU operations. - + k : size_t (default=None) Order of the core. This value must not be negative. If set to None the main core is returned. - + degree_type: str This option determines if the core number computation should be based on input, output, or both directed edges, with valid values being "incoming", "outgoing", and "bidirectional" respectively. This option is currently ignored in this release, and setting it will result in a warning. - + core_result : device array type Precomputed core number of the nodes of the graph G If set to None, the core numbers of the nodes are calculated @@ -125,12 +125,12 @@ def k_core(ResourceHandle resource_handle, vertices_view_ptr = \ create_cugraph_type_erased_device_array_view_from_py_obj( core_result["vertex"]) - + cdef cugraph_type_erased_device_array_view_t* \ core_numbers_view_ptr = \ create_cugraph_type_erased_device_array_view_from_py_obj( core_result["values"]) - + # Create a core_number result error_code = cugraph_core_result_create(c_resource_handle_ptr, vertices_view_ptr, diff --git a/python/pylibcugraph/pylibcugraph/k_truss_subgraph.pyx b/python/pylibcugraph/pylibcugraph/k_truss_subgraph.pyx index 2c22c618249..6e4cd2e282a 100644 --- a/python/pylibcugraph/pylibcugraph/k_truss_subgraph.pyx +++ b/python/pylibcugraph/pylibcugraph/k_truss_subgraph.pyx @@ -1,4 +1,4 @@ -# Copyright (c) 2023, NVIDIA CORPORATION. +# Copyright (c) 2023-2024, 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 @@ -90,7 +90,7 @@ def k_truss_subgraph(ResourceHandle resource_handle, >>> weights = cupy.asarray( ... [0.1, 0.1, 2.1, 2.1, 1.1, 1.1, 7.2, 7.2, 2.1, 2.1, ... 1.1, 1.1, 7.2, 7.2, 3.2, 3.2, 6.1, 6.1] - ... ,dtype=numpy.float32) + ... ,dtype=numpy.float32) >>> k = 2 >>> resource_handle = pylibcugraph.ResourceHandle() >>> graph_props = pylibcugraph.GraphProperties( @@ -141,7 +141,7 @@ def k_truss_subgraph(ResourceHandle resource_handle, # for perfomance improvement cupy_sources = copy_to_cupy_array( c_resource_handle_ptr, sources_ptr) - + cupy_destinations = copy_to_cupy_array( c_resource_handle_ptr, destinations_ptr) @@ -150,7 +150,7 @@ def k_truss_subgraph(ResourceHandle resource_handle, c_resource_handle_ptr, edge_weights_ptr) else: cupy_edge_weights = None - + # FIXME: Should we keep the offsets array or just drop it from the final # solution? cupy_subgraph_offsets = copy_to_cupy_array( diff --git a/python/pylibcugraph/pylibcugraph/katz_centrality.pyx b/python/pylibcugraph/pylibcugraph/katz_centrality.pyx index fc78ca89e87..1716a4fc9bf 100644 --- a/python/pylibcugraph/pylibcugraph/katz_centrality.pyx +++ b/python/pylibcugraph/pylibcugraph/katz_centrality.pyx @@ -1,4 +1,4 @@ -# Copyright (c) 2022-2023, NVIDIA CORPORATION. +# Copyright (c) 2022-2024, 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 @@ -95,7 +95,7 @@ def katz_centrality(ResourceHandle resource_handle, do_expensive_check : bool_t A flag to run expensive checks for input arguments if True. - + Returns ------- @@ -112,9 +112,9 @@ def katz_centrality(ResourceHandle resource_handle, cdef cugraph_error_code_t error_code cdef cugraph_error_t* error_ptr - cdef uintptr_t cai_betas_ptr + cdef uintptr_t cai_betas_ptr cdef cugraph_type_erased_device_array_view_t* betas_ptr - + if betas is not None: cai_betas_ptr = betas.__cuda_array_interface__["data"][0] betas_ptr = \ @@ -143,7 +143,7 @@ def katz_centrality(ResourceHandle resource_handle, cugraph_centrality_result_get_vertices(result_ptr) cdef cugraph_type_erased_device_array_view_t* values_ptr = \ cugraph_centrality_result_get_values(result_ptr) - + cupy_vertices = copy_to_cupy_array(c_resource_handle_ptr, vertices_ptr) cupy_values = copy_to_cupy_array(c_resource_handle_ptr, values_ptr) diff --git a/python/pylibcugraph/pylibcugraph/node2vec.pyx b/python/pylibcugraph/pylibcugraph/node2vec.pyx index 5d83fc46c3c..b2f2948affe 100644 --- a/python/pylibcugraph/pylibcugraph/node2vec.pyx +++ b/python/pylibcugraph/pylibcugraph/node2vec.pyx @@ -1,4 +1,4 @@ -# Copyright (c) 2022-2023, NVIDIA CORPORATION. +# Copyright (c) 2022-2024, 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 @@ -172,7 +172,7 @@ def node2vec(ResourceHandle resource_handle, cupy_weights = copy_to_cupy_array(c_resource_handle_ptr, weights_ptr) cupy_path_sizes = copy_to_cupy_array(c_resource_handle_ptr, path_sizes_ptr) - + cugraph_random_walk_result_free(result_ptr) cugraph_type_erased_device_array_view_free(seed_view_ptr) diff --git a/python/pylibcugraph/pylibcugraph/overlap_coefficients.pyx b/python/pylibcugraph/pylibcugraph/overlap_coefficients.pyx index 28360121c64..36f414e71ad 100644 --- a/python/pylibcugraph/pylibcugraph/overlap_coefficients.pyx +++ b/python/pylibcugraph/pylibcugraph/overlap_coefficients.pyx @@ -1,4 +1,4 @@ -# Copyright (c) 2022-2023, NVIDIA CORPORATION. +# Copyright (c) 2022-2024, 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 @@ -65,7 +65,7 @@ def overlap_coefficients(ResourceHandle resource_handle, bool_t do_expensive_check): """ Compute the Overlap coefficients for the specified vertex_pairs. - + Note that Overlap similarity must run on a symmetric graph. @@ -77,13 +77,13 @@ def overlap_coefficients(ResourceHandle resource_handle, graph : SGGraph or MGGraph The input graph, for either Single or Multi-GPU operations. - + first : Source of the vertex pair. - + second : Destination of the vertex pair. - + use_weight : bool, optional If set to True, the compute weighted jaccard_coefficients( the input graph must be weighted in that case). diff --git a/python/pylibcugraph/pylibcugraph/random.pyx b/python/pylibcugraph/pylibcugraph/random.pyx index 4e53d4aaa76..918f9924ea4 100644 --- a/python/pylibcugraph/pylibcugraph/random.pyx +++ b/python/pylibcugraph/pylibcugraph/random.pyx @@ -1,4 +1,4 @@ -# Copyright (c) 2023, NVIDIA CORPORATION. +# Copyright (c) 2023-2024, 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 @@ -72,12 +72,12 @@ cdef class CuGraphRandomState: cdef cugraph_resource_handle_t* c_resource_handle_ptr = \ resource_handle.c_resource_handle_ptr - + cdef cugraph_rng_state_t* new_rng_state_ptr if seed is None: seed = generate_default_seed() - + # reinterpret as unsigned seed &= (2**64 - 1) @@ -85,12 +85,12 @@ cdef class CuGraphRandomState: c_resource_handle_ptr, seed, &new_rng_state_ptr, - &error_ptr + &error_ptr ) assert_success(error_code, error_ptr, "cugraph_rng_state_create") - + self.rng_state_ptr = new_rng_state_ptr - + def __dealloc__(self): """ Destroys this CuGraphRandomState instance. Properly calls diff --git a/python/pylibcugraph/pylibcugraph/replicate_edgelist.pyx b/python/pylibcugraph/pylibcugraph/replicate_edgelist.pyx index 3763d4bc69d..8d4964a314f 100644 --- a/python/pylibcugraph/pylibcugraph/replicate_edgelist.pyx +++ b/python/pylibcugraph/pylibcugraph/replicate_edgelist.pyx @@ -1,4 +1,4 @@ -# Copyright (c) 2022-2023, NVIDIA CORPORATION. +# Copyright (c) 2022-2024, 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 @@ -62,13 +62,13 @@ def replicate_edgelist(ResourceHandle resource_handle, resource_handle : ResourceHandle Handle to the underlying device resources needed for referencing data and running algorithms. - + src_array : device array type, optional Device array containing the vertex identifiers of the source of each directed edge. The order of the array corresponds to the ordering of the dst_array, where the ith item in src_array and the ith item in dst_array define the ith edge of the graph. - + dst_array : device array type, optional Device array containing the vertex identifiers of the destination of each directed edge. The order of the array corresponds to the ordering @@ -80,13 +80,13 @@ def replicate_edgelist(ResourceHandle resource_handle, order of the array corresponds to the ordering of the src_array and dst_array arrays, where the ith item in weight_array is the weight value of the ith edge of the graph. - + edge_id_array : device array type, optional Device array containing the edge id values of each directed edge. The order of the array corresponds to the ordering of the src_array and dst_array arrays, where the ith item in edge_id_array is the id value of the ith edge of the graph. - + edge_type_id_array : device array type, optional Device array containing the edge type id values of each directed edge. The order of the array corresponds to the ordering of the src_array and @@ -112,17 +112,17 @@ def replicate_edgelist(ResourceHandle resource_handle, cdef cugraph_type_erased_device_array_view_t* srcs_view_ptr = \ create_cugraph_type_erased_device_array_view_from_py_obj(src_array) - + cdef cugraph_type_erased_device_array_view_t* dsts_view_ptr = \ create_cugraph_type_erased_device_array_view_from_py_obj(dst_array) - + cdef cugraph_type_erased_device_array_view_t* weights_view_ptr = \ create_cugraph_type_erased_device_array_view_from_py_obj(weight_array) cdef cugraph_type_erased_device_array_view_t* edge_ids_view_ptr = \ create_cugraph_type_erased_device_array_view_from_py_obj(edge_id_array) - + cdef cugraph_type_erased_device_array_view_t* edge_type_ids_view_ptr = \ create_cugraph_type_erased_device_array_view_from_py_obj(edge_type_id_array) @@ -172,11 +172,11 @@ def replicate_edgelist(ResourceHandle resource_handle, if weight_array is not None: cupy_edge_weights = copy_to_cupy_array( c_resource_handle_ptr, edge_weights_ptr) - + if edge_id_array is not None: cupy_edge_ids = copy_to_cupy_array( c_resource_handle_ptr, edge_ids_ptr) - + if edge_type_id_array is not None: cupy_edge_type_ids = copy_to_cupy_array( c_resource_handle_ptr, edge_type_ids_ptr) diff --git a/python/pylibcugraph/pylibcugraph/select_random_vertices.pyx b/python/pylibcugraph/pylibcugraph/select_random_vertices.pyx index 7964f101058..9aa8ff4c01e 100644 --- a/python/pylibcugraph/pylibcugraph/select_random_vertices.pyx +++ b/python/pylibcugraph/pylibcugraph/select_random_vertices.pyx @@ -1,4 +1,4 @@ -# Copyright (c) 2023, NVIDIA CORPORATION. +# Copyright (c) 2023-2024, 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 @@ -76,12 +76,12 @@ def select_random_vertices(ResourceHandle resource_handle, graph : SGGraph or MGGraph The input graph, for either Single or Multi-GPU operations. - + random_state : int , optional Random state to use when generating samples. Optional argument, defaults to a hash of process id, time, and hostname. (See pylibcugraph.random.CuGraphRandomState) - + num_vertices : size_t , optional Number of vertices to sample. Optional argument, defaults to the total number of vertices. @@ -116,7 +116,7 @@ def select_random_vertices(ResourceHandle resource_handle, vertices_view_ptr = \ cugraph_type_erased_device_array_view( vertices_ptr) - - cupy_vertices = copy_to_cupy_array(c_resource_handle_ptr, vertices_view_ptr) + + cupy_vertices = copy_to_cupy_array(c_resource_handle_ptr, vertices_view_ptr) return cupy_vertices diff --git a/python/pylibcugraph/pylibcugraph/sorensen_coefficients.pyx b/python/pylibcugraph/pylibcugraph/sorensen_coefficients.pyx index 983a635012f..39814b8ad88 100644 --- a/python/pylibcugraph/pylibcugraph/sorensen_coefficients.pyx +++ b/python/pylibcugraph/pylibcugraph/sorensen_coefficients.pyx @@ -1,4 +1,4 @@ -# Copyright (c) 2022-2023, NVIDIA CORPORATION. +# Copyright (c) 2022-2024, 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 @@ -65,7 +65,7 @@ def sorensen_coefficients(ResourceHandle resource_handle, bool_t do_expensive_check): """ Compute the Sorensen coefficients for the specified vertex_pairs. - + Note that Sorensen similarity must run on a symmetric graph. Parameters @@ -76,13 +76,13 @@ def sorensen_coefficients(ResourceHandle resource_handle, graph : SGGraph or MGGraph The input graph, for either Single or Multi-GPU operations. - + first : Source of the vertex pair. - + second : Destination of the vertex pair. - + use_weight : bool, optional If set to True, the compute weighted jaccard_coefficients( the input graph must be weighted in that case). diff --git a/python/pylibcugraph/pylibcugraph/spectral_modularity_maximization.pyx b/python/pylibcugraph/pylibcugraph/spectral_modularity_maximization.pyx index fa01714744d..a2c93e025a8 100644 --- a/python/pylibcugraph/pylibcugraph/spectral_modularity_maximization.pyx +++ b/python/pylibcugraph/pylibcugraph/spectral_modularity_maximization.pyx @@ -1,4 +1,4 @@ -# Copyright (c) 2023, NVIDIA CORPORATION. +# Copyright (c) 2023-2024, 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 @@ -90,7 +90,7 @@ def spectral_modularity_maximization(ResourceHandle resource_handle, kmean_max_iter: size_t Specifies the maximum number of iterations for the k-means solver. - + do_expensive_check : bool_t If True, performs more extensive tests on the inputs to ensure validitity, at the expense of increased run time. diff --git a/python/pylibcugraph/pylibcugraph/testing/type_utils.pyx b/python/pylibcugraph/pylibcugraph/testing/type_utils.pyx index 6defb4c6b43..a79893e8e9f 100644 --- a/python/pylibcugraph/pylibcugraph/testing/type_utils.pyx +++ b/python/pylibcugraph/pylibcugraph/testing/type_utils.pyx @@ -1,4 +1,4 @@ -# Copyright (c) 2022-2023, NVIDIA CORPORATION. +# Copyright (c) 2022-2024, 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 @@ -90,7 +90,7 @@ def create_sampling_result(ResourceHandle resource_handle, device_sources.__cuda_array_interface__["data"][0] cdef uintptr_t cai_dsts_ptr = \ device_destinations.__cuda_array_interface__["data"][0] - + cdef uintptr_t cai_weights_ptr if device_weights is not None: cai_weights_ptr = device_weights.__cuda_array_interface__['data'][0] @@ -127,7 +127,7 @@ def create_sampling_result(ResourceHandle resource_handle, len(device_weights), get_c_type_from_numpy_type(device_weights.dtype) ) - ) + ) cdef cugraph_type_erased_device_array_view_t* c_edge_id_ptr = NULL if device_weights is not None: c_edge_id_ptr = ( @@ -136,7 +136,7 @@ def create_sampling_result(ResourceHandle resource_handle, len(device_edge_id), get_c_type_from_numpy_type(device_edge_id.dtype) ) - ) + ) cdef cugraph_type_erased_device_array_view_t* c_edge_type_ptr = NULL if device_weights is not None: c_edge_type_ptr = ( @@ -145,7 +145,7 @@ def create_sampling_result(ResourceHandle resource_handle, len(device_edge_type), get_c_type_from_numpy_type(device_edge_type.dtype) ) - ) + ) cdef cugraph_type_erased_device_array_view_t* c_hop_ptr = NULL if device_weights is not None: @@ -155,7 +155,7 @@ def create_sampling_result(ResourceHandle resource_handle, len(device_hop), get_c_type_from_numpy_type(device_hop.dtype) ) - ) + ) cdef cugraph_type_erased_device_array_view_t* c_label_ptr = NULL if device_weights is not None: @@ -165,7 +165,7 @@ def create_sampling_result(ResourceHandle resource_handle, len(device_batch_label), get_c_type_from_numpy_type(device_batch_label.dtype) ) - ) + ) error_code = cugraph_test_uniform_neighborhood_sample_result_create( diff --git a/python/pylibcugraph/pylibcugraph/triangle_count.pyx b/python/pylibcugraph/pylibcugraph/triangle_count.pyx index fd86181b581..0cbe9be7f19 100644 --- a/python/pylibcugraph/pylibcugraph/triangle_count.pyx +++ b/python/pylibcugraph/pylibcugraph/triangle_count.pyx @@ -1,4 +1,4 @@ -# Copyright (c) 2022-2023, NVIDIA CORPORATION. +# Copyright (c) 2022-2024, 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 @@ -73,11 +73,11 @@ def triangle_count(ResourceHandle resource_handle, start_list: device array type Device array containing the list of vertices for triangle counting. If 'None' the entire set of vertices in the graph is processed - + do_expensive_check: bool If True, performs more extensive tests on the inputs to ensure validitity, at the expense of increased run time. - + Returns ------- A tuple of device arrays, where the first item in the tuple is a device @@ -111,7 +111,7 @@ def triangle_count(ResourceHandle resource_handle, get_c_type_from_numpy_type(start_list.dtype)) else: start_ptr = NULL - + error_code = cugraph_triangle_count(c_resource_handle_ptr, c_graph_ptr, start_ptr, @@ -132,5 +132,5 @@ def triangle_count(ResourceHandle resource_handle, if start_list is not None: cugraph_type_erased_device_array_view_free(start_ptr) - + return (cupy_vertices, cupy_counts) diff --git a/python/pylibcugraph/pylibcugraph/two_hop_neighbors.pyx b/python/pylibcugraph/pylibcugraph/two_hop_neighbors.pyx index 3989e45d48f..4b1a5b74a3f 100644 --- a/python/pylibcugraph/pylibcugraph/two_hop_neighbors.pyx +++ b/python/pylibcugraph/pylibcugraph/two_hop_neighbors.pyx @@ -1,4 +1,4 @@ -# Copyright (c) 2022-2023, NVIDIA CORPORATION. +# Copyright (c) 2022-2024, 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 @@ -66,7 +66,7 @@ def get_two_hop_neighbors(ResourceHandle resource_handle, graph : SGGraph or MGGraph The input graph, for either Single or Multi-GPU operations. - + start_vertices : Optional array of starting vertices If None use all, if specified compute two-hop neighbors for these starting vertices @@ -102,16 +102,16 @@ def get_two_hop_neighbors(ResourceHandle resource_handle, cdef cugraph_type_erased_device_array_view_t* first_ptr = \ cugraph_vertex_pairs_get_first(result_ptr) - + cdef cugraph_type_erased_device_array_view_t* second_ptr = \ cugraph_vertex_pairs_get_second(result_ptr) - + cupy_first = copy_to_cupy_array(c_resource_handle_ptr, first_ptr) cupy_second = copy_to_cupy_array(c_resource_handle_ptr, second_ptr) # Free all pointers cugraph_vertex_pairs_free(result_ptr) if start_vertices is not None: - cugraph_type_erased_device_array_view_free(start_vertices_view_ptr) + cugraph_type_erased_device_array_view_free(start_vertices_view_ptr) return cupy_first, cupy_second diff --git a/python/pylibcugraph/pylibcugraph/uniform_neighbor_sample.pyx b/python/pylibcugraph/pylibcugraph/uniform_neighbor_sample.pyx index ce6493c38f5..b4145a80095 100644 --- a/python/pylibcugraph/pylibcugraph/uniform_neighbor_sample.pyx +++ b/python/pylibcugraph/pylibcugraph/uniform_neighbor_sample.pyx @@ -1,4 +1,4 @@ -# Copyright (c) 2022-2023, NVIDIA CORPORATION. +# Copyright (c) 2022-2024, 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 @@ -124,25 +124,25 @@ def uniform_neighbor_sample(ResourceHandle resource_handle, do_expensive_check: bool If True, performs more extensive tests on the inputs to ensure validitity, at the expense of increased run time. - + with_edge_properties: bool If True, returns the edge properties of each edges along with the edges themselves. Will result in an error if the provided graph does not have edge properties. - + batch_id_list: list[int32] (Optional) List of int32 batch ids that is returned with each edge. Optional argument, defaults to NULL, returning nothing. - + label_list: list[int32] (Optional) List of unique int32 batch ids. Required if also passing the label_to_output_comm_rank flag. Default to NULL (does nothing) - + label_to_output_comm_rank: list[int32] (Optional) Maps the unique batch ids in label_list to the rank of the worker that should hold results for that batch id. Defaults to NULL (does nothing) - + prior_sources_behavior: str (Optional) Options are "carryover", and "exclude". Default will leave the source list as-is. @@ -150,7 +150,7 @@ def uniform_neighbor_sample(ResourceHandle resource_handle, current hop. Exclude will exclude sources from previous hops from reappearing as sources in future hops. - + deduplicate_sources: bool (Optional) If True, will deduplicate the source list before sampling. Defaults to False. @@ -159,11 +159,11 @@ def uniform_neighbor_sample(ResourceHandle resource_handle, If True, will renumber the sources and destinations on a per-batch basis and return the renumber map and batch offsets in additional to the standard returns. - + compression: str (Optional) Options: COO (default), CSR, CSC, DCSR, DCSR Sets the compression format for the returned samples. - + compress_per_hop: bool (Optional) If False (default), will create a compressed edgelist for the entire batch. @@ -174,7 +174,7 @@ def uniform_neighbor_sample(ResourceHandle resource_handle, Random state to use when generating samples. Optional argument, defaults to a hash of process id, time, and hostname. (See pylibcugraph.random.CuGraphRandomState) - + return_dict: bool (Optional) Whether to return a dictionary instead of a tuple. Optional argument, defaults to False, returning a tuple. @@ -188,11 +188,11 @@ def uniform_neighbor_sample(ResourceHandle resource_handle, walk respectively, the third item in the tuple is a device array containing the start labels, and the fourth item in the tuple is a device array containing the indices for reconstructing paths. - + If renumber was set to True, then the fifth item in the tuple is a device array containing the renumber map, and the sixth item in the tuple is a device array containing the renumber map offsets (which delineate where - the renumber map for each batch starts). + the renumber map for each batch starts). """ cdef cugraph_resource_handle_t* c_resource_handle_ptr = ( @@ -218,22 +218,22 @@ def uniform_neighbor_sample(ResourceHandle resource_handle, cdef uintptr_t cai_start_ptr = \ start_list.__cuda_array_interface__["data"][0] - + cdef uintptr_t cai_batch_id_ptr if batch_id_list is not None: cai_batch_id_ptr = \ batch_id_list.__cuda_array_interface__['data'][0] - + cdef uintptr_t cai_label_list_ptr if label_list is not None: cai_label_list_ptr = \ label_list.__cuda_array_interface__['data'][0] - + cdef uintptr_t cai_label_to_output_comm_rank_ptr if label_to_output_comm_rank is not None: cai_label_to_output_comm_rank_ptr = \ label_to_output_comm_rank.__cuda_array_interface__['data'][0] - + cdef uintptr_t ai_fan_out_ptr = \ h_fan_out.__array_interface__["data"][0] @@ -251,7 +251,7 @@ def uniform_neighbor_sample(ResourceHandle resource_handle, len(batch_id_list), get_c_type_from_numpy_type(batch_id_list.dtype) ) - + cdef cugraph_type_erased_device_array_view_t* label_list_ptr = NULL if label_list is not None: label_list_ptr = \ @@ -260,7 +260,7 @@ def uniform_neighbor_sample(ResourceHandle resource_handle, len(label_list), get_c_type_from_numpy_type(label_list.dtype) ) - + cdef cugraph_type_erased_device_array_view_t* label_to_output_comm_rank_ptr = NULL if label_to_output_comm_rank is not None: label_to_output_comm_rank_ptr = \ @@ -276,7 +276,7 @@ def uniform_neighbor_sample(ResourceHandle resource_handle, len(h_fan_out), get_c_type_from_numpy_type(h_fan_out.dtype)) - + cg_rng_state = CuGraphRandomState(resource_handle, random_state) cdef cugraph_rng_state_t* rng_state_ptr = \ @@ -294,7 +294,7 @@ def uniform_neighbor_sample(ResourceHandle resource_handle, f'Invalid option {prior_sources_behavior}' ' for prior sources behavior' ) - + cdef cugraph_compression_type_t compression_behavior_e if compression is None or compression == 'COO': compression_behavior_e = cugraph_compression_type_t.COO diff --git a/python/pylibcugraph/pylibcugraph/weakly_connected_components.pyx b/python/pylibcugraph/pylibcugraph/weakly_connected_components.pyx index 240c374353d..c9f62be389d 100644 --- a/python/pylibcugraph/pylibcugraph/weakly_connected_components.pyx +++ b/python/pylibcugraph/pylibcugraph/weakly_connected_components.pyx @@ -1,4 +1,4 @@ -# Copyright (c) 2022-2023, NVIDIA CORPORATION. +# Copyright (c) 2022-2024, 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 @@ -61,8 +61,8 @@ def _ensure_args(graph, offsets, indices, weights): else: invalid_input = [i for p in [offsets, indices] if p is None] input_type = "csr_arrays" - - + + if len(invalid_input) != 0: raise TypeError("Invalid input combination: Must set either 'graph' or " "a combination of 'offsets', 'indices' and 'weights', not both") @@ -71,7 +71,7 @@ def _ensure_args(graph, offsets, indices, weights): assert_CAI_type(offsets, "offsets") assert_CAI_type(indices, "indices") assert_CAI_type(weights, "weights", True) - + return input_type @@ -95,7 +95,7 @@ def weakly_connected_components(ResourceHandle resource_handle, graph : SGGraph or MGGraph The input graph. - + offsets : object supporting a __cuda_array_interface__ interface Array containing the offsets values of a Compressed Sparse Row matrix that represents the graph. @@ -133,7 +133,7 @@ def weakly_connected_components(ResourceHandle resource_handle, ... store_transposed=False, renumber=True, do_expensive_check=False) >>> (vertices, labels) = weakly_connected_components( ... resource_handle, G, None, None, None, None, False) - + >>> vertices [0, 1, 2] >>> labels diff --git a/readme_pages/PRTAGS.md b/readme_pages/PRTAGS.md index 4fa02ff9590..6b16d0740dd 100644 --- a/readme_pages/PRTAGS.md +++ b/readme_pages/PRTAGS.md @@ -1,5 +1,5 @@ # Pull Request Tags -If you look at the list of current [Pull Request](https://github.com/rapidsai/cugraph/pulls) you will notice a set of bracketed tags in the subject line. Those tags help developers focus attention and know what is being asked. +If you look at the list of current [Pull Request](https://github.com/rapidsai/cugraph/pulls) you will notice a set of bracketed tags in the subject line. Those tags help developers focus attention and know what is being asked. PR = Pull Request @@ -11,4 +11,4 @@ PR = Pull Request | REVIEW | The code is ready for a full code review. Only code that has passed a code review is merged into the baseline | -Code must pass CI before it is merged \ No newline at end of file +Code must pass CI before it is merged diff --git a/readme_pages/TRANSITIONGUIDE.md b/readme_pages/TRANSITIONGUIDE.md index 73aa487aca1..f3c9dad207d 100644 --- a/readme_pages/TRANSITIONGUIDE.md +++ b/readme_pages/TRANSITIONGUIDE.md @@ -3,18 +3,18 @@ ## Python API ### Loading an edge list -Renumbering is now enabled by default in `from_cudf_edgelist`. -The renumbering feature allows us to hide the fact that we need vertices to be integers starting at 0. The auto-renumbering feature converts the data into the proper data type required by the underlying implementation. All algorithms accepting vertex identifiers (like the souce vertex for SSSP) now automatically accept user's notation too. On output, it will transparently un-renumber results, basically convert the internal IDs back. +Renumbering is now enabled by default in `from_cudf_edgelist`. +The renumbering feature allows us to hide the fact that we need vertices to be integers starting at 0. The auto-renumbering feature converts the data into the proper data type required by the underlying implementation. All algorithms accepting vertex identifiers (like the souce vertex for SSSP) now automatically accept user's notation too. On output, it will transparently un-renumber results, basically convert the internal IDs back. ## C++ API -Pagerank, BFS, and SSSP have dropped the `gdf_column` dependency in favor of basic types and templates +Pagerank, BFS, and SSSP have dropped the `gdf_column` dependency in favor of basic types and templates -Example : +Example : ``` -// 0.11 API -cugraph::pagerank(cugraph::Graph, gdf_column *pagerank, ...) -// 0.12 API -cugraph::pagerank(cugraph::Graph, float *pagerank ...) +// 0.11 API +cugraph::pagerank(cugraph::Graph, gdf_column *pagerank, ...) +// 0.12 API +cugraph::pagerank(cugraph::Graph, float *pagerank ...) ``` # 0.11 @@ -26,21 +26,21 @@ This release introduces new concepts in the API and improves user experience thr ### New graph types The Python API now has `Graph` (undirected) and `DiGraph` (directed) types. This is closer to NetworkX's API. -In the past, directed graphs were stored using the `Graph` type. +In the past, directed graphs were stored using the `Graph` type. Starting in 0.11, `DiGraph` should be used for directed graphs instead. `Graph` only refers to undirected graphs now. The `Multi(Di)Graph` types were added and more support for this new structure will be added in the next releases (more details in issue #604). ### Undirected graphs -cuGraph currently automatically "symmetrize" undirected inputs: each undirected edge (u,v) is stored as two directed edges (u,v) and (v,u). +cuGraph currently automatically "symmetrize" undirected inputs: each undirected edge (u,v) is stored as two directed edges (u,v) and (v,u). -When viewing the graph or requesting the number of edges, cuGraph will currently return this symmetrized view. -This is an implementation detail that will be hidden to the user in 0.12 (more details in issue #603). +When viewing the graph or requesting the number of edges, cuGraph will currently return this symmetrized view. +This is an implementation detail that will be hidden to the user in 0.12 (more details in issue #603). ### Loading an edge list Users are encouraged to use `from_cudf_edgelist` instead of `add_edge_list`. -This new API supports cuDF DataFrame. Users can now ask for an automatic renumbering of the edge list at the time it is loaded. +This new API supports cuDF DataFrame. Users can now ask for an automatic renumbering of the edge list at the time it is loaded. In this case, all analytics outputs are automatically un-renumbered before being returned. ## C++ API @@ -54,10 +54,10 @@ This release is the first step toward converting the former C-like API into a C+ Example : ```c -// < 0.11 API -gdf_error err = gdf_pagerank(, ...) -// >= 0.11 API -cugraph::pagerank(, ...) +// < 0.11 API +gdf_error err = gdf_pagerank(, ...) +// >= 0.11 API +cugraph::pagerank(, ...) ``` The C++ API provides functions that efficiently convert between data formats and access to the efficient CUDA algorithms. In 0.11, all automatic conversions and decision making were removed from the C++ layer. diff --git a/readme_pages/cugraph_dgl.md b/readme_pages/cugraph_dgl.md index 3c6ddd4026b..7b19787f4c6 100644 --- a/readme_pages/cugraph_dgl.md +++ b/readme_pages/cugraph_dgl.md @@ -3,7 +3,7 @@ [RAPIDS](https://rapids.ai) cugraph_dgl enables the ability to use cugraph Property Graphs with DGL. This cugraph backend allows DGL users access to a collection of GPU-accelerated algorithms for graph analytics, such as sampling, centrality computation, and community detection. -The goal of `cugraph_dgl` is to enable Multi-Node Multi-GPU cugraph accelerated graphs to help train large-scale Graph Neural Networks(GNN) on DGL by providing a duck-typed version of the [DGLGraph](https://docs.dgl.ai/api/python/dgl.DGLGraph.html#dgl.DGLGraph) which uses cugraph for storing graph structure and node/edge feature data. +The goal of `cugraph_dgl` is to enable Multi-Node Multi-GPU cugraph accelerated graphs to help train large-scale Graph Neural Networks(GNN) on DGL by providing a duck-typed version of the [DGLGraph](https://docs.dgl.ai/api/python/dgl.DGLGraph.html#dgl.DGLGraph) which uses cugraph for storing graph structure and node/edge feature data. ## Usage ```diff @@ -15,14 +15,13 @@ sampler = dgl.dataloading.NeighborSampler( [15, 10, 5], prefetch_node_feats=['feat'], prefetch_labels=['label']) train_dataloader = dgl.dataloading.DataLoader( -- dgl_g, +- dgl_g, + cugraph_g, -train_idx, -sampler, -device=device, +train_idx, +sampler, +device=device, batch_size=1024, shuffle=True, -drop_last=False, +drop_last=False, num_workers=0) ``` - diff --git a/readme_pages/cugraph_ops.md b/readme_pages/cugraph_ops.md index 87b0051a815..7bd4ac55185 100644 --- a/readme_pages/cugraph_ops.md +++ b/readme_pages/cugraph_ops.md @@ -7,7 +7,7 @@ CuGraphOps Cugraph-ops is a closed-source library that is composed of highly optimized and performant primitives associated with GNNs and related graph -operations, such as training, sampling and inference. +operations, such as training, sampling and inference. This is how cuGraphOps fits into the cuGraph ecosystem diff --git a/readme_pages/cugraph_python.md b/readme_pages/cugraph_python.md index 164c1212ed8..69d70f69fad 100644 --- a/readme_pages/cugraph_python.md +++ b/readme_pages/cugraph_python.md @@ -1,13 +1,13 @@ # cuGraph – Python -cuGraph is a Python package that encapsulate and hides the complexity of the lower layer C/CUDA code. Additionally, the software is focused on providing an easy and familiar API +cuGraph is a Python package that encapsulate and hides the complexity of the lower layer C/CUDA code. Additionally, the software is focused on providing an easy and familiar API ## cuGraph Notice -Vertex IDs are expected to be contiguous integers starting from 0. If your data doesn't match that restriction, we have a solution. cuGraph provides the renumber function, which is by default automatically called when data is added to a graph. Input vertex IDs for the renumber function can be any type, can be non-contiguous, can be multiple columns, and can start from an arbitrary number. The renumber function maps the provided input vertex IDs to either 32- or 64-bit contiguous integers starting from 0. +Vertex IDs are expected to be contiguous integers starting from 0. If your data doesn't match that restriction, we have a solution. cuGraph provides the renumber function, which is by default automatically called when data is added to a graph. Input vertex IDs for the renumber function can be any type, can be non-contiguous, can be multiple columns, and can start from an arbitrary number. The renumber function maps the provided input vertex IDs to either 32- or 64-bit contiguous integers starting from 0. Additionally, when using the auto-renumbering feature, vertices are automatically un-renumbered in results. @@ -21,4 +21,4 @@ The amount of memory required is dependent on the graph structure and the analyt | 500 million edges | 32 GB | | 250 million edges | 16 GB | -The use of managed memory for oversubscription can also be used to exceed the above memory limitations. See the recent blog on _Tackling Large Graphs with RAPIDS cuGraph and CUDA Unified Memory on GPUs_: https://medium.com/rapids-ai/tackling-large-graphs-with-rapids-cugraph-and-unified-virtual-memory-b5b69a065d4 \ No newline at end of file +The use of managed memory for oversubscription can also be used to exceed the above memory limitations. See the recent blog on _Tackling Large Graphs with RAPIDS cuGraph and CUDA Unified Memory on GPUs_: https://medium.com/rapids-ai/tackling-large-graphs-with-rapids-cugraph-and-unified-virtual-memory-b5b69a065d4 diff --git a/readme_pages/cugraph_service.md b/readme_pages/cugraph_service.md index 9c06cd9f71a..b1a95e62a95 100644 --- a/readme_pages/cugraph_service.md +++ b/readme_pages/cugraph_service.md @@ -4,7 +4,7 @@ The goal of cugraph_service is to wrap a cuGraph cluster and provide a Graph-as- Goals * Separate large graph management and analytic code from application code - * The application, like GNN code, should be isolated from the details of cuGraph graph management, dedicated multi-node/multi-GPU setup, feature storage and retrieval, etc. + * The application, like GNN code, should be isolated from the details of cuGraph graph management, dedicated multi-node/multi-GPU setup, feature storage and retrieval, etc. * Scaling from single GPU (SG), to multi-GPU (MG), to multi-node/multi-GPU (MNMG) should not require changes to the graph integration code * Support multiple concurrent clients/processes/threads sharing one or more graphs @@ -20,7 +20,7 @@ Goals # Picture -One option on a single DGX +One option on a single DGX graph_service_cluster diff --git a/readme_pages/data_types.md b/readme_pages/data_types.md index 37f2ee4daf6..936775742f1 100644 --- a/readme_pages/data_types.md +++ b/readme_pages/data_types.md @@ -1,5 +1,5 @@ # External Data Types -cuGraph Python strives to make getting data into and out of cuGraph simple. To that end, the Python interface accepts +cuGraph Python strives to make getting data into and out of cuGraph simple. To that end, the Python interface accepts @@ -15,7 +15,7 @@ cuGraph supports graph creation with Source and Destination being expressed as: cuGraph tries to match the return type based on the input type. So a NetworkX input will return the same data type that NetworkX would have. ## cuDF -The preferred data type is a cuDF object since it is already in the GPU. For loading data from disk into cuDF please see the cuDF documentation. +The preferred data type is a cuDF object since it is already in the GPU. For loading data from disk into cuDF please see the cuDF documentation. __Loading data__ * Graph.from_cudf_adjlist @@ -23,18 +23,18 @@ __Loading data__ __Results__
-Results which are not simple types (ints, floats) are typically cuDF Dataframes. +Results which are not simple types (ints, floats) are typically cuDF Dataframes. ## Pandas -The RAPIDS cuDF library can be thought of as accelerated Pandas +The RAPIDS cuDF library can be thought of as accelerated Pandas ## NetworkX Graph Objects -## +## diff --git a/readme_pages/gnn_support.md b/readme_pages/gnn_support.md index 1c52be1c013..924c2bf62af 100644 --- a/readme_pages/gnn_support.md +++ b/readme_pages/gnn_support.md @@ -27,7 +27,6 @@ An overview of GNN's and how they are used is found in this excellent [blog](htt RAPIDS GNN components improve other industy GNN specific projects. Due to the degree distribution of nodes, memory bottlenecks are the pain point for large scale graphs. To solve this problem, sampling operations form the backbone for Graph Neural Networks (GNN) training. However, current sampling methods provided by other libraries are not optimized enough for the whole process of GNN training. The main limit to performance is moving data between the hosts and devices. In cuGraph, we provide an end-to-end solution from data loading to training all on the GPUs. -CuGraph now supports compatibility with [Deep Graph Library](https://www.dgl.ai/) (DGL) and [PyTorch Geometric](https://pytorch-geometric.readthedocs.io/en/latest/) (PyG) by allowing conversion between a cuGraph object and a DGL or PyG object, making it possible for DGL and PyG users to access efficient data loader and graph operations (such as uniformed sampling) implementations in cuGraph, as well as keep their models unchanged in DGL or PyG. We have considerable speedup compared with the original implementation in DGL and PyG. +CuGraph now supports compatibility with [Deep Graph Library](https://www.dgl.ai/) (DGL) and [PyTorch Geometric](https://pytorch-geometric.readthedocs.io/en/latest/) (PyG) by allowing conversion between a cuGraph object and a DGL or PyG object, making it possible for DGL and PyG users to access efficient data loader and graph operations (such as uniformed sampling) implementations in cuGraph, as well as keep their models unchanged in DGL or PyG. We have considerable speedup compared with the original implementation in DGL and PyG. [](https://developer.nvidia.com/blog/optimizing-fraud-detection-in-financial-services-with-graph-neural-networks-and-nvidia-gpus/) - diff --git a/readme_pages/news.md b/readme_pages/news.md index f9ebe36b9dd..fa22fb8c318 100644 --- a/readme_pages/news.md +++ b/readme_pages/news.md @@ -1,13 +1,13 @@ # cuGraph News ### Scaling to 1 Trillion Edges -At GTC Spring '22 we presented results of running cuGraph on the [Selene](https://top500.org/system/179842/) supercomputer using 2,048 GPUs and processing a graph with `1.1 Trillion edges`. Synthetic data created with the RMAT generator found in cuGraph. +At GTC Spring '22 we presented results of running cuGraph on the [Selene](https://top500.org/system/179842/) supercomputer using 2,048 GPUs and processing a graph with `1.1 Trillion edges`. Synthetic data created with the RMAT generator found in cuGraph.
 
cuGraph Scaling


### cuGraph Software Stack -cuGraph has a new multi-layer software stack that allows users and system integrators to access cuGraph at different layers. +cuGraph has a new multi-layer software stack that allows users and system integrators to access cuGraph at different layers.
 
cuGraph Software Stack
-

\ No newline at end of file +

diff --git a/readme_pages/performance/performance.md b/readme_pages/performance/performance.md index 5700c59bba3..159b2334704 100644 --- a/readme_pages/performance/performance.md +++ b/readme_pages/performance/performance.md @@ -4,4 +4,4 @@ alt="RAPIDS" width="500"> We are working on a new nightly benchmarking system that will produce performance numbers. -This is a splash page for where the performance numbers will be posted in early 2023. \ No newline at end of file +This is a splash page for where the performance numbers will be posted in early 2023. diff --git a/readme_pages/property_graph.md b/readme_pages/property_graph.md index 19d6e23f718..bce090c2ad3 100644 --- a/readme_pages/property_graph.md +++ b/readme_pages/property_graph.md @@ -20,8 +20,8 @@ Property Graph enables: This is an example of using the cuGraph Property Graph in a two stage analysis. ``` -import cudf -import cugraph +import cudf +import cugraph from cugraph.experimental import PropertyGraph # Import a built-in dataset @@ -33,22 +33,22 @@ graph = cugraph.Graph(directed=False) G = karate.get_graph(create_using=graph,fetch=True) df = G.edgelist.edgelist_df -pG = PropertyGraph() +pG = PropertyGraph() pG. add_edge_data(df, vertex_col_names=("src", "dst")) -# Run Louvain to get the partition number for each vertex. -# Set resolution accordingly to identify two primary partitions. +# Run Louvain to get the partition number for each vertex. +# Set resolution accordingly to identify two primary partitions. (partition_info, _) = cugraph.louvain(pG.extract_subgraph(create_using=graph), resolution=0.6) -# Add the partition numbers back to the Property Graph as vertex properties +# Add the partition numbers back to the Property Graph as vertex properties pG.add_vertex_data(partition_info, vertex_col_name="vertex") -# Use the partition properties to extract a Graph for each partition. +# Use the partition properties to extract a Graph for each partition. G0 = pG.extract_subgraph(selection=pG.select_vertices("partition == 0")) G1 = pG.extract_subgraph(selection=pG. select_vertices("partition == 1")) -# Run pagerank on each graph, print results. -pageranks0 = cugraph.pagerank(G0) -pageranks1 = cugraph.pagerank(G1) +# Run pagerank on each graph, print results. +pageranks0 = cugraph.pagerank(G0) +pageranks1 = cugraph.pagerank(G1) print(pageranks0.sort_values (by="pagerank", ascending=False).head(3)) print(pageranks1.sort_values (by="pagerank", ascending=False).head(3)) ```