diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md
index 8863a753fc7..c71a1af4808 100644
--- a/.github/ISSUE_TEMPLATE/bug_report.md
+++ b/.github/ISSUE_TEMPLATE/bug_report.md
@@ -1,6 +1,6 @@
---
name: Bug report
-about: Create a report to help us improve
+about: Create a report to help us improve cuGraph
title: "[BUG]"
labels: "? - Needs Triage, bug"
assignees: ''
@@ -10,29 +10,19 @@ assignees: ''
**Describe the bug**
A clear and concise description of what the bug is.
-**To Reproduce**
-Steps to reproduce the behavior:
-1. Go to '...'
-2. Click on '....'
-3. Scroll down to '....'
-4. See error
+**Steps/Code to reproduce bug**
+Follow this guide http://matthewrocklin.com/blog/work/2018/02/28/minimal-bug-reports to craft a minimal bug report. This helps us reproduce the issue you're having and resolve the issue more quickly.
**Expected behavior**
A clear and concise description of what you expected to happen.
-**Screenshots**
-If applicable, add screenshots to help explain your problem.
+**Environment overview (please complete the following information)**
+ - Environment location: [Bare-metal, Docker, Cloud(specify cloud provider)]
+ - Method of cuGraph install: [conda, Docker, or from source]
+ - If method of install is [Docker], provide `docker pull` & `docker run` commands used
-**Desktop (please complete the following information):**
- - OS: [e.g. iOS]
- - Browser [e.g. chrome, safari]
- - Version [e.g. 22]
-
-**Smartphone (please complete the following information):**
- - Device: [e.g. iPhone6]
- - OS: [e.g. iOS8.1]
- - Browser [e.g. stock browser, safari]
- - Version [e.g. 22]
+**Environment details**
+Please run and paste the output of the `cugraph/print_env.sh` script here, to gather any other relevant environment details
**Additional context**
Add any other context about the problem here.
diff --git a/.github/ISSUE_TEMPLATE/documentation_request.md b/.github/ISSUE_TEMPLATE/documentation_request.md
new file mode 100644
index 00000000000..595a87e191e
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/documentation_request.md
@@ -0,0 +1,35 @@
+---
+name: Documentation request
+about: Report incorrect or needed documentation
+title: "[DOC]"
+labels: "? - Needs Triage, doc"
+assignees: ''
+
+---
+
+## Report incorrect documentation
+
+**Location of incorrect documentation**
+Provide links and line numbers if applicable.
+
+**Describe the problems or issues found in the documentation**
+A clear and concise description of what you found to be incorrect.
+
+**Steps taken to verify documentation is incorrect**
+List any steps you have taken:
+
+**Suggested fix for documentation**
+Detail proposed changes to fix the documentation if you have any.
+
+---
+
+## Report needed documentation
+
+**Report needed documentation**
+A clear and concise description of what documentation you believe it is needed and why.
+
+**Describe the documentation you'd like**
+A clear and concise description of what you want to happen.
+
+**Steps taken to search for needed documentation**
+List any steps you have taken:
\ No newline at end of file
diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md
index c3b1a9ac71d..e5e02a4cb2d 100644
--- a/.github/ISSUE_TEMPLATE/feature_request.md
+++ b/.github/ISSUE_TEMPLATE/feature_request.md
@@ -8,7 +8,7 @@ assignees: ''
---
**Is your feature request related to a problem? Please describe.**
-A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
+A clear and concise description of what the problem is. Ex. I wish I could use cuGraph to do [...]
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
@@ -16,7 +16,5 @@ A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
-**Task List**
-A clear list of task should be called out
**Additional context**
-Add any other context or screenshots about the feature request here.
+Add any other context, code examples, or references to existing implementations about the feature request here.
\ No newline at end of file
diff --git a/.github/ISSUE_TEMPLATE/question.md b/.github/ISSUE_TEMPLATE/question.md
index cc2d5cb79ad..a9b590525aa 100644
--- a/.github/ISSUE_TEMPLATE/question.md
+++ b/.github/ISSUE_TEMPLATE/question.md
@@ -1,6 +1,6 @@
---
name: Question
-about: Ask a Question
+about: Ask a Question about cuGraph
title: "[QST]"
labels: "? - Needs Triage, question"
assignees: ''
diff --git a/.gitignore b/.gitignore
index 517ceab566b..30bcd5a845d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -76,4 +76,7 @@ cpp/doxygen/html
# Raft symlink
python/cugraph/raft
-python/_external_repositories/
\ No newline at end of file
+python/_external_repositories/
+
+# created by Dask tests
+python/dask-worker-space
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 5118b9c9059..5036d07e005 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,9 +1,102 @@
+# cuGraph 0.15.0 (26 Aug 2020)
+
+## New Features
+- PR #940 Add MG Batch BC
+- PR #937 Add wrapper for gunrock HITS algorithm
+- PR #939 Updated Notebooks to include new features and benchmarks
+- PR #944 MG pagerank (dask)
+- PR #947 MG pagerank (CUDA)
+- PR #826 Bipartite Graph python API
+- PR #963 Renumbering refactor, add multi GPU support
+- PR #964 MG BFS (CUDA)
+- PR #990 MG Consolidation
+- PR #993 Add persistent Handle for Comms
+- PR #979 Add hypergraph implementation to convert DataFrames into Graphs
+- PR #1010 MG BFS (dask)
+- PR #1018 MG personalized pagerank
+- PR #1047 Updated select tests to use new dataset list that includes asymmetric directed graph
+- PR #1090 Add experimental Leiden function
+- PR #1077 Updated/added copyright notices, added copyright CI check from cuml
+- PR #1100 Add support for new build process (Project Flash)
+- PR #1093 New benchmarking notebook
+
+## Improvements
+- PR #898 Add Edge Betweenness Centrality, and endpoints to BC
+- PR #913 Eliminate `rmm.device_array` usage
+- PR #903 Add short commit hash to conda package
+- PR #920 modify bfs test, update graph number_of_edges, update storage of transposedAdjList in Graph
+- PR #933 Update mg_degree to use raft, add python tests
+- PR #930 rename test_utils.h to utilities/test_utils.hpp and remove thrust dependency
+- PR #934 Update conda dev environment.yml dependencies to 0.15
+- PR #942 Removed references to deprecated RMM headers.
+- PR #941 Regression python/cudf fix
+- PR #945 Simplified benchmark --no-rmm-reinit option, updated default options
+- PR #946 Install meta packages for dependencies
+- PR #952 Updated get_test_data.sh to also (optionally) download and install datasets for benchmark runs
+- PR #953 fix setting RAFT_DIR from the RAFT_PATH env var
+- PR #954 Update cuGraph error handling to use RAFT
+- PR #968 Add build script for CI benchmark integration
+- PR #959 Add support for uint32_t and int64_t types for BFS (cpp side)
+- PR #962 Update dask pagerank
+- PR #975 Upgrade GitHub template
+- PR #976 Fix error in Graph.edges(), update cuDF rename() calls
+- PR #977 Update force_atlas2 to call on_train_end after iterating
+- PR #980 Replace nvgraph Spectral Clustering (SC) functionality with RAFT SC
+- PR #987 Move graph out of experimental namespace
+- PR #984 Removing codecov until we figure out how to interpret failures that block CI
+- PR #985 Add raft handle to BFS, BC and edge BC
+- PR #991 Update conda upload versions for new supported CUDA/Python
+- PR #988 Add clang and clang tools to the conda env
+- PR #997 Update setup.cfg to run pytests under cugraph tests directory only
+- PR #1007 Add tolerance support to MG Pagerank and fix
+- PR #1009 Update benchmarks script to include requirements used
+- PR #1014 Fix benchmarks script variable name
+- PR #1021 Update cuGraph to use RAFT CUDA utilities
+- PR #1019 Remove deprecated CUDA library calls
+- PR #1024 Updated condata environment YML files
+- PR #1026 update chunksize for mnmg, remove files and unused code
+- PR #1028 Update benchmarks script to use ASV_LABEL
+- PR #1030 MG directory org and documentation
+- PR #1020 Updated Louvain to honor max_level, ECG now calls Louvain for 1 level, then full run.
+- PR #1031 MG notebook
+- PR #1034 Expose resolution (gamma) parameter in Louvain
+- PR #1037 Centralize test main function and replace usage of deprecated `cnmem_memory_resource`
+- PR #1041 Use S3 bucket directly for benchmark plugin
+- PR #1056 Fix MG BFS performance
+- PR #1062 Compute max_vertex_id in mnmg local data computation
+- PR #1068 Remove unused thirdparty code
+- PR #1105 Update `master` references to `main`
+
+## Bug Fixes
+- PR #936 Update Force Atlas 2 doc and wrapper
+- PR #938 Quote conda installs to avoid bash interpretation
+- PR #966 Fix build error (debug mode)
+- PR #983 Fix offset calculation in COO to CSR
+- PR #989: Fix issue with incorrect docker image being used in local build script
+- PR #992 Fix unrenumber of predecessor
+- PR #1008 Fix for cudf updates disabling iteration of Series/Columns/Index
+- PR #1012 Fix Local build script README
+- PR #1017 Fix more mg bugs
+- PR #1022 Fix support for using a cudf.DataFrame with a MG graph
+- PR #1025: Explicitly skip raft test folder for pytest 6.0.0
+- PR #1027 Fix documentation
+- PR #1033 Fix reparition error in big datasets, updated coroutine, fixed warnings
+- PR #1036 Fixed benchmarks for new renumbering API, updated comments, added quick test-only benchmark run to CI
+- PR #1040 Fix spectral clustering renumbering issue
+- PR #1057 Updated raft dependency to pull fixes on cusparse selection in CUDA 11
+- PR #1066 Update cugunrock to not build for unsupported CUDA architectures
+- PR #1069 Fixed CUDA 11 Pagerank crash, by replacing CUB's SpMV with raft's.
+- PR #1083 Fix NBs to run in nightly test run, update renumbering text, cleanup
+- PR #1087 Updated benchmarks README to better describe how to get plugin, added rapids-pytest-benchmark plugin to conda dev environments
+- PR #1101 Removed unnecessary device-to-host copy which caused a performance regression
+- PR #1106 Added new release.ipynb to notebook test skip list
+
# cuGraph 0.14.0 (03 Jun 2020)
## New Features
- PR #756 Add Force Atlas 2 layout
- PR #822 Added new functions in python graph class, similar to networkx
-- PR #840 OPG degree
+- PR #840 MG degree
- PR #875 UVM notebook
- PR #881 Raft integration infrastructure
@@ -24,7 +117,7 @@
- PR #807 Updating the Python docs
- PR #817 Add native Betweenness Centrality with sources subset
- PR #818 Initial version of new "benchmarks" folder
-- PR #820 OPG infra and all-gather smoke test
+- PR #820 MG infra and all-gather smoke test
- PR #823 Remove gdf column from nvgraph
- PR #829 Updated README and CONTRIBUTIOIN docs
- PR #831 Updated Notebook - Added K-Truss, ECG, and Betweenness Centrality
@@ -41,6 +134,7 @@
- PR #874 Update setup.py to use custom clean command
- PR #876 Add BFS C++ tests
- PR #878 Updated build script
+- PR #887 Updates test to common datasets
- PR #879 Add docs build script to repository
- PR #880 Remove remaining gdf_column references
- PR #882 Add Force Atlas 2 to benchmarks
@@ -49,6 +143,7 @@
- PR #897 Remove RMM ALLOC calls
- PR #899 Update include paths to remove deleted cudf headers
- PR #906 Update Louvain notebook
+- PR #948 Move doc customization scripts to Jenkins
## Bug Fixes
- PR #927 Update scikit learn dependency
@@ -65,11 +160,13 @@
- PR #860 Fix all Notebooks
- PR #870 Fix Louvain
- PR #889 Added missing conftest.py file to benchmarks dir
-- PR #896 opg dask infrastructure fixes
+- PR #896 mg dask infrastructure fixes
- PR #907 Fix bfs directed missing vertices
- PR #911 Env and changelog update
- PR #923 Updated pagerank with @afender 's temp fix for double-free crash
- PR #928 Fix scikit learn test install to work with libgcc-ng 7.3
+- PR 935 Merge
+- PR #956 Use new gpuCI image in local build script
# cuGraph 0.13.0 (31 Mar 2020)
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 54c931bdae5..ddd4fd0f9f4 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -13,8 +13,8 @@ __Style Formatting Tools:__
* `flake8` version 3.5.0+
-
-## 1) File an Issue for the RAPIDS cuGraph team to work
+
+## 1) File an Issue for the RAPIDS cuGraph team to work
To file an issue, go to the RAPIDS cuGraph [issue](https://github.com/rapidsai/cugraph/issues/new/choose) page an select the appropriate issue type. Once an issue is filed the RAPIDS cuGraph team will evaluate and triage the issue. If you believe the issue needs priority attention, please include that in the issue to notify the team.
***Bug Report***
@@ -36,8 +36,8 @@ There are several ways to ask questions, including [Stack Overflow]( https://sta
- describing your question
-
-## 2) Propose a New Feature and Implement It
+
+## 2) Propose a New Feature and Implement It
We love when people want to get involved, and if you have a suggestion for a new feature or enhancement and want to be the one doing the development work, we fully encourage that.
@@ -46,8 +46,8 @@ We love when people want to get involved, and if you have a suggestion for a new
- Once we agree that the plan looks good, go ahead and implement it
- Follow the [code contributions](#code-contributions) guide below.
-
-## 3) You want to implement a feature or bug-fix for an outstanding issue
+
+## 3) You want to implement a feature or bug-fix for an outstanding issue
- Find an open Issue, and post that you would like to work that issues
- Once we agree that the plan looks good, go ahead and implement it
- Follow the [code contributions](#code-contributions) guide below.
@@ -55,8 +55,8 @@ We love when people want to get involved, and if you have a suggestion for a new
If you need more context on a particular issue, please ask.
----
-
-# So you want to contribute code
+
+# So you want to contribute code
**TL;DR General Development Process**
1. Read the documentation on [building from source](SOURCEBUILD.md) to learn how to setup, and validate, the development environment
@@ -74,11 +74,14 @@ If you need more context on a particular issue, please ask.
Remember, if you are unsure about anything, don't hesitate to comment on issues
and ask for clarifications!
+**The _FIXME_** comment
+
+Use the _FIXME_ comment to capture technical debt. It should not be used to flag bugs since those need to be cleaned up before code is submitted.
+We are implementing a script to count and track the number of FIXME in the code. Usage of TODO or any other tag will not be accepted.
-## Fork a private copy of cuGraph
-
+## Fork a private copy of cuGraph
The RAPIDS cuGraph repo cannot directly be modified. Contributions must come in the form of a *Pull Request* from a forked version of cugraph. GitHub as a nice write up ion the process: https://help.github.com/en/github/getting-started-with-github/fork-a-repo
1. Fork the cugraph repo to your GitHub account
@@ -92,7 +95,8 @@ Read the section on [building cuGraph from source](SOURCEBUILD.md) to validate t
```git remote add upstream https://github.com/rapidsai/cugraph.git```
3. Checkout the latest branch
-cuGraph only allows contribution to the current branch and not main or a future branch. PLease check the [cuGraph](https://github.com/rapidsai/cugraph) page for the name of the current branch.
+cuGraph only allows contribution to the current branch and not main or a future branch. Please check the [cuGraph](https://github.com/rapidsai/cugraph) page for the name of the current branch.
+
```git checkout branch-x.x```
4. Code .....
diff --git a/Dockerfile b/Dockerfile
index 53169427136..de0b1e8c10b 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,4 +1,4 @@
-# built from https://github.com/rapidsai/cudf/blob/master/Dockerfile
+# built from https://github.com/rapidsai/cudf/blob/main/Dockerfile
FROM cudf
ADD src /cugraph/src
diff --git a/PRTAGS.md b/PRTAGS.md
index 91c47e035a4..8ec23ea30ac 100644
--- a/PRTAGS.md
+++ b/PRTAGS.md
@@ -8,5 +8,5 @@ PR = Pull Request
| WIP | _Work In Progress_ - Within the RAPIDS cuGraph team, we try to open a PR when development starts. This allows other to review code as it is being developed and provide feedback before too much code needs to be refactored. It also allows process to be tracked |
| skip-ci | _Do Not Run CI_ - This flag prevents CI from being run. It is good practice to include this with the **WIP** tag since code is typically not at a point where it will pass CI. |
| skip ci | same as above |
-| API-REVIEW | This tag request a code review just of the API portion of the code - This is benificial to ensure that all required arguments are captured. Doing this early can save from having to refactor later. |
-| REVIEW | The code is ready for a full code review. Only code that has passed a code review is merged into the baseline |
\ No newline at end of file
+| API-REVIEW | This tag request a code review just of the API portion of the code - This is beneficial to ensure that all required arguments are captured. Doing this early can save from having to refactor later. |
+| REVIEW | The code is ready for a full code review. Only code that has passed a code review is merged into the baseline |
diff --git a/README.md b/README.md
index f745ea1a0e3..45405d902bf 100644
--- a/README.md
+++ b/README.md
@@ -2,7 +2,7 @@
[![Build Status](https://gpuci.gpuopenanalytics.com/job/rapidsai/job/gpuci/job/cugraph/job/branches/job/cugraph-branch-pipeline/badge/icon)](https://gpuci.gpuopenanalytics.com/job/rapidsai/job/gpuci/job/cugraph/job/branches/job/cugraph-branch-pipeline/)
-The [RAPIDS](https://rapids.ai) cuGraph library is a collection of GPU accelerated graph algorithms that process data found in [GPU DataFrames](https://github.com/rapidsai/cudf). The vision of cuGraph is _to make graph analysis ubiquitous to the point that users just think in terms of analysis and not technologies or frameworks_. To realize that vision, cuGraph operators, at the Python layer, on GPU DataFrames, allowing for seamless passing of data between ETL tasks in [cuDF](https://github.com/rapidsai/cudf) and machine learning tasks in [cuML](https://github.com/rapidsai/cuml). Data scientist familiar with Python will quickly pick up how cuGraph integrates with the Pandas-like API of cuDF. Likewise, user familiar with NetworkX will quickly reconnize the NetworkX-like API provided in cuGraph, with the goal being to allow existing code to be ported with minimal effort into RAPIDS. For users familiar with C++/CUDA and graph structures, a C++ API is also provided. However, there is less type and structure checking at the C++ layer.
+The [RAPIDS](https://rapids.ai) cuGraph library is a collection of GPU accelerated graph algorithms that process data found in [GPU DataFrames](https://github.com/rapidsai/cudf). The vision of cuGraph is _to make graph analysis ubiquitous to the point that users just think in terms of analysis and not technologies or frameworks_. To realize that vision, cuGraph operates, at the Python layer, on GPU DataFrames, thereby allowing for seamless passing of data between ETL tasks in [cuDF](https://github.com/rapidsai/cudf) and machine learning tasks in [cuML](https://github.com/rapidsai/cuml). Data scientists familiar with Python will quickly pick up how cuGraph integrates with the Pandas-like API of cuDF. Likewise, users familiar with NetworkX will quickly recognize the NetworkX-like API provided in cuGraph, with the goal to allow existing code to be ported with minimal effort into RAPIDS. For users familiar with C++/CUDA and graph structures, a C++ API is also provided. However, there is less type and structure checking at the C++ layer.
For more project details, see [rapids.ai](https://rapids.ai/).
@@ -10,59 +10,62 @@ The [RAPIDS](https://rapids.ai) cuGraph library is a collection of GPU accelerat
-```markdown
+```python
import cugraph
# read data into a cuDF DataFrame using read_csv
-gdf = cudf.read_csv("graph_data.csv", names=["src", "dst"], dtype=["int32", "int32"] )
+gdf = cudf.read_csv("graph_data.csv", names=["src", "dst"], dtype=["int32", "int32"])
# We now have data as edge pairs
-# create a Graph using the source (src) and destination (dst) vertex pairs the GDF
+# create a Graph using the source (src) and destination (dst) vertex pairs
G = cugraph.Graph()
G.from_cudf_edgelist(gdf, source='src', destination='dst')
# Let's now get the PageRank score of each vertex by calling cugraph.pagerank
-gdf_page = cugraph.pagerank(G)
+df_page = cugraph.pagerank(G)
# Let's look at the PageRank Score (only do this on small graphs)
-for i in range(len(gdf_page)):
- print("vertex " + str(gdf_page['vertex'][i]) +
- " PageRank is " + str(gdf_page['pagerank'][i]))
+for i in range(len(df_page)):
+ print("vertex " + str(df_page['vertex'].iloc[i]) +
+ " PageRank is " + str(df_page['pagerank'].iloc[i]))
```
## Supported Algorithms
-| Category | Algorithm | Sacle | Notes
+| Category | Algorithm | Scale | Notes
| ------------ | -------------------------------------- | ------------ | ------------------- |
| Centrality | | | |
| | Katz | Single-GPU | |
| | Betweenness Centrality | Single-GPU | |
+| | Edge Betweenness Centrality | Single-GPU | |
| Community | | | |
+| | Leiden | Single-GPU | |
| | Louvain | Single-GPU | |
| | Ensemble Clustering for Graphs | Single-GPU | |
| | Spectral-Clustering - Balanced Cut | Single-GPU | |
-| | Spectral-Clustering | Single-GPU | |
+| | Spectral-Clustering - Modularity | Single-GPU | |
| | Subgraph Extraction | Single-GPU | |
| | Triangle Counting | Single-GPU | |
+| | K-Truss | Single-GPU | |
| Components | | | |
| | Weakly Connected Components | Single-GPU | |
| | Strongly Connected Components | Single-GPU | |
| Core | | | |
| | K-Core | Single-GPU | |
| | Core Number | Single-GPU | |
-| | K-Truss | Single-GPU | |
| Layout | | | |
| | Force Atlas 2 | Single-GPU | |
| Link Analysis| | | |
-| | Pagerank | Single-GPU | Multi-GPU on DGX avaible |
-| | Personal Pagerank | Single-GPU | |
+| | Pagerank | Multiple-GPU | limited to 2 billion vertices |
+| | Personal Pagerank | Multiple-GPU | limited to 2 billion vertices |
+| | HITS | Single-GPU | leverages Gunrock |
| Link Prediction | | | |
-| | Jacard Similarity | Single-GPU | |
-| | Weighted Jacard Similarity | Single-GPU | |
+| | Jaccard Similarity | Single-GPU | |
+| | Weighted Jaccard Similarity | Single-GPU | |
| | Overlap Similarity | Single-GPU | |
| Traversal | | | |
-| | Breadth First Search (BFS) | Single-GPU | |
+| | Breadth First Search (BFS) | Multiple-GPU | limited to 2 billion vertices |
| | Single Source Shortest Path (SSSP) | Single-GPU | |
| Structure | | | |
| | Renumbering | Single-GPU | Also for multiple columns |
@@ -78,26 +81,25 @@ for i in range(len(gdf_page)):
## cuGraph Notice
The current version of cuGraph has some limitations:
-- Vertex IDs need to be 32-bit integers.
+- Vertex IDs need to be 32-bit integers (that restriction is going away in 0.16)
- Vertex IDs are expected to be contiguous integers starting from 0.
-- If the starting index is not zero, cuGraph will add disconnected vertices to fill in the missing range. (Auto-) Renumbering fixes this issue
-cuGraph provides the renumber function to mitigate this problem. Input vertex IDs for the renumber function can be any type, can be non-contiguous, and can start from an arbitrary number. The renumber function maps the provided input vertex IDs to 32-bit contiguous integers starting from 0. cuGraph still requires the renumbered vertex IDs to be representable in 32-bit integers. These limitations are being addressed and will be fixed soon.
+cuGraph provides the renumber function to mitigate this problem, which is by default automatically called when data is addted 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 32-bit contiguous integers starting from 0. cuGraph still requires the renumbered vertex IDs to be representable in 32-bit integers. These limitations are being addressed and will be fixed soon.
-cuGraph provides an auto-renumbering feature, enabled by default, during Graph creating. Renumbered vertices are automaticaly un-renumbered.
+Additionally, when using the auto-renumbering feature, vertices are automatically un-renumbered in results.
-cuGraph is constantly being updatred and improved. Please see the [Transition Guide](TRANSITIONGUIDE.md) if errors are encountered with newer versions
+cuGraph is constantly being updated and improved. Please see the [Transition Guide](TRANSITIONGUIDE.md) if errors are encountered with newer versions
## Graph Sizes and GPU Memory Size
-The amount of memory required is dependent on the graph structure and the analytics being executed. As a simple rule of thumb, the amount of GPU memory should be about twice the size of the data size. That gives overhead for the CSV reader and other transform functions. There are ways around the rule but using smaller data chunks.
-
-
-| Size | Recomended GPU Memory |
-|-------------------|-----------------------|
-| 500 million edges | 32GB |
-| 250 million edges | 16 GB |
+The amount of memory required is dependent on the graph structure and the analytics being executed. As a simple rule of thumb, the amount of GPU memory should be about twice the size of the data size. That gives overhead for the CSV reader and other transform functions. There are ways around the rule but using smaller data chunks.
+| Size | Recommended GPU Memory |
+|-------------------|------------------------|
+| 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
## Getting cuGraph
@@ -108,35 +110,33 @@ There are 3 ways to get cuGraph :
3. [Build from Source](#source)
-
-## Quick Start
+
+## Quick Start
Please see the [Demo Docker Repository](https://hub.docker.com/r/rapidsai/rapidsai/), choosing a tag based on the NVIDIA CUDA version you’re running. This provides a ready to run Docker container with example notebooks and data, showcasing how you can utilize all of the RAPIDS libraries: cuDF, cuML, and cuGraph.
-
-### Conda
+### Conda
It is easy to install cuGraph using conda. You can get a minimal conda installation with [Miniconda](https://conda.io/miniconda.html) or get the full installation with [Anaconda](https://www.anaconda.com/download).
Install and update cuGraph using the conda command:
```bash
-# CUDA 10.0
-conda install -c nvidia -c rapidsai -c numba -c conda-forge -c defaults cugraph cudatoolkit=10.0
-
# CUDA 10.1
conda install -c nvidia -c rapidsai -c numba -c conda-forge -c defaults cugraph cudatoolkit=10.1
# CUDA 10.2
conda install -c nvidia -c rapidsai -c numba -c conda-forge -c defaults cugraph cudatoolkit=10.2
+
+# CUDA 11.0
+conda install -c nvidia -c rapidsai -c numba -c conda-forge -c defaults cugraph cudatoolkit=11.0
```
-Note: This conda installation only applies to Linux and Python versions 3.6/3.7.
+Note: This conda installation only applies to Linux and Python versions 3.7/3.8.
-
-### Build from Source and Contributing
+### Build from Source and Contributing
Please see our [guide for building cuGraph from source](SOURCEBUILD.md)
@@ -153,7 +153,7 @@ Python API documentation can be generated from [docs](docs) directory.
##
![](img/rapids_logo.png)
Open GPU Data Science
-The RAPIDS suite of open source software libraries aim to enable execution of end-to-end data science and analytics pipelines entirely on GPUs. It relies on NVIDIA® CUDA® primitives for low-level compute optimization, but exposing that GPU parallelism and high-bandwidth memory speed through user-friendly Python interfaces.
+The RAPIDS suite of open source software libraries aims to enable execution of end-to-end data science and analytics pipelines entirely on GPUs. It relies on NVIDIA® CUDA® primitives for low-level compute optimization but exposing that GPU parallelism and high-bandwidth memory speed through user-friendly Python interfaces.
![](img/rapids_arrow.png)
diff --git a/SOURCEBUILD.md b/SOURCEBUILD.md
index 23beee55f07..29aa20ad522 100644
--- a/SOURCEBUILD.md
+++ b/SOURCEBUILD.md
@@ -12,7 +12,7 @@ __Compiler__:
* `cmake` version 3.12+
__CUDA:__
-* CUDA 10.0+
+* CUDA 10.1+
* NVIDIA driver 396.44+
* Pascal architecture or better
@@ -47,8 +47,7 @@ __Create the conda development environment__
```bash
# create the conda environment (assuming in base `cugraph` directory)
-# for CUDA 10
-conda env create --name cugraph_dev --file conda/environments/cugraph_dev_cuda10.0.yml
+
# for CUDA 10.1
conda env create --name cugraph_dev --file conda/environments/cugraph_dev_cuda10.1.yml
@@ -56,6 +55,9 @@ conda env create --name cugraph_dev --file conda/environments/cugraph_dev_cuda10
# for CUDA 10.2
conda env create --name cugraph_dev --file conda/environments/cugraph_dev_cuda10.2.yml
+# for CUDA 11
+conda env create --name cugraph_dev --file conda/environments/cugraph_dev_cuda11.0.yml
+
# activate the environment
conda activate cugraph_dev
@@ -68,15 +70,15 @@ conda deactivate
```bash
-# for CUDA 10
-conda env update --name cugraph_dev --file conda/environments/cugraph_dev_cuda10.0.yml
-
# for CUDA 10.1
conda env update --name cugraph_dev --file conda/environments/cugraph_dev_cuda10.1.yml
# for CUDA 10.2
conda env update --name cugraph_dev --file conda/environments/cugraph_dev_cuda10.2.yml
+# for CUDA 11
+conda env update --name cugraph_dev --file conda/environments/cugraph_dev_cuda11.0.yml
+
conda activate cugraph_dev
```
@@ -200,7 +202,7 @@ Run either the C++ or the Python tests with datasets
make test
```
-Note: This conda installation only applies to Linux and Python versions 3.6/3.7.
+Note: This conda installation only applies to Linux and Python versions 3.7/3.8.
### Building and Testing on a gpuCI image locally
@@ -226,8 +228,8 @@ Next the env_vars.sh file needs to be edited
vi ./etc/conda/activate.d/env_vars.sh
#!/bin/bash
-export PATH=/usr/local/cuda-10.0/bin:$PATH # or cuda-10.2 if using CUDA 10.2
-export LD_LIBRARY_PATH=/usr/local/cuda-10.0/lib64:$LD_LIBRARY_PATH # or cuda-10.2 if using CUDA 10.2
+export PATH=/usr/local/cuda-10.1/bin:$PATH # or cuda-10.2 if using CUDA 10.2
+export LD_LIBRARY_PATH=/usr/local/cuda-10.1/lib64:$LD_LIBRARY_PATH # or cuda-10.2 if using CUDA 10.2
```
```
diff --git a/benchmarks/README.md b/benchmarks/README.md
index 7aa581d14bb..0190b2870de 100644
--- a/benchmarks/README.md
+++ b/benchmarks/README.md
@@ -15,13 +15,15 @@ directory under the root of the `cuGraph` source tree.
* cugraph built and installed (or `cugraph` sources and built C++ extensions
available on `PYTHONPATH`)
-* rapids-pytest-benchmark pytest plugin (`conda install -c rlratzel
+* rapids-pytest-benchmark pytest plugin (`conda install -c rapidsai
rapids-pytest-benchmark`)
- * NOTE: the `rlratzel` channel is temporary! This plugin will eventually be
- moved to a more standard channel
-* specific datasets installed in /datasets (see benchmark sources in
- this dir for details)
+* The benchmark datasets downloaded and installed in /datasets. Run the
+script below from the /datasets directory:
+```
+cd /datasets
+./get_test_data.sh --benchmark
+```
## Usage (Python)
### Python
@@ -33,6 +35,7 @@ directory under the root of the `cuGraph` source tree.
## Examples
### Python
+_**NOTE: these commands must be run from the `/benchmarks` directory.**_
* Run all the benchmarks and print their names on a separate line (`-v`), and generate a report to stdout
```
(rapids) user@machine:/cugraph/benchmarks> pytest -v
diff --git a/benchmarks/bench_algos.py b/benchmarks/bench_algos.py
index 91dc8fbb0fa..9be636ca480 100644
--- a/benchmarks/bench_algos.py
+++ b/benchmarks/bench_algos.py
@@ -1,3 +1,16 @@
+# Copyright (c) 2020, 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.
+
import pytest
import pytest_benchmark
@@ -17,6 +30,7 @@ def setFixtureParamNames(*args, **kwargs):
pass
import cugraph
+from cugraph.structure.number_map import NumberMap
from cugraph.tests import utils
import rmm
@@ -47,12 +61,26 @@ def createGraph(csvFileName, graphType=None):
renumber=True)
+# Record the current RMM settings so reinitialize() will be called only when a
+# change is needed (RMM defaults both values to False). This allows the
+# --no-rmm-reinit option to prevent reinitialize() from being called at all
+# (see conftest.py for details).
+RMM_SETTINGS = {"managed_mem": False,
+ "pool_alloc": False}
+
+
def reinitRMM(managed_mem, pool_alloc):
- rmm.reinitialize(
- managed_memory=managed_mem,
- pool_allocator=pool_alloc,
- initial_pool_size=2 << 27
- )
+
+ if (managed_mem != RMM_SETTINGS["managed_mem"]) or \
+ (pool_alloc != RMM_SETTINGS["pool_alloc"]):
+
+ rmm.reinitialize(
+ managed_memory=managed_mem,
+ pool_allocator=pool_alloc,
+ initial_pool_size=2 << 27
+ )
+ RMM_SETTINGS.update(managed_mem=managed_mem,
+ pool_alloc=pool_alloc)
###############################################################################
@@ -78,8 +106,7 @@ def edgelistCreated(request):
setFixtureParamNames(request, ["dataset", "managed_mem", "pool_allocator"])
csvFileName = request.param[0]
- if len(request.param) > 1:
- reinitRMM(request.param[1], request.param[2])
+ reinitRMM(request.param[1], request.param[2])
return utils.read_csv_file(csvFileName)
@@ -92,8 +119,7 @@ def graphWithAdjListComputed(request):
"""
setFixtureParamNames(request, ["dataset", "managed_mem", "pool_allocator"])
csvFileName = request.param[0]
- if len(request.param) > 1:
- reinitRMM(request.param[1], request.param[2])
+ reinitRMM(request.param[1], request.param[2])
G = createGraph(csvFileName, cugraph.structure.graph.Graph)
G.view_adj_list()
@@ -109,8 +135,7 @@ def anyGraphWithAdjListComputed(request):
"""
setFixtureParamNames(request, ["dataset", "managed_mem", "pool_allocator"])
csvFileName = request.param[0]
- if len(request.param) > 1:
- reinitRMM(request.param[1], request.param[2])
+ reinitRMM(request.param[1], request.param[2])
G = createGraph(csvFileName)
G.view_adj_list()
@@ -126,8 +151,7 @@ def anyGraphWithTransposedAdjListComputed(request):
"""
setFixtureParamNames(request, ["dataset", "managed_mem", "pool_allocator"])
csvFileName = request.param[0]
- if len(request.param) > 1:
- reinitRMM(request.param[1], request.param[2])
+ reinitRMM(request.param[1], request.param[2])
G = createGraph(csvFileName)
G.view_transposed_adj_list()
@@ -164,9 +188,7 @@ def bench_create_digraph(gpubenchmark, edgelistCreated):
@pytest.mark.ETL
def bench_renumber(gpubenchmark, edgelistCreated):
- gpubenchmark(cugraph.renumber,
- edgelistCreated["0"], # src
- edgelistCreated["1"]) # dst
+ gpubenchmark(NumberMap.renumber, edgelistCreated, "0", "1")
def bench_pagerank(gpubenchmark, anyGraphWithTransposedAdjListComputed):
@@ -233,3 +255,9 @@ def bench_graph_degrees(gpubenchmark, anyGraphWithAdjListComputed):
def bench_betweenness_centrality(gpubenchmark, anyGraphWithAdjListComputed):
gpubenchmark(cugraph.betweenness_centrality,
anyGraphWithAdjListComputed, k=10, seed=123)
+
+
+def bench_edge_betweenness_centrality(gpubenchmark,
+ anyGraphWithAdjListComputed):
+ gpubenchmark(cugraph.edge_betweenness_centrality,
+ anyGraphWithAdjListComputed, k=10, seed=123)
diff --git a/benchmarks/conftest.py b/benchmarks/conftest.py
index ea5be7212dc..8ab0c5a57b4 100644
--- a/benchmarks/conftest.py
+++ b/benchmarks/conftest.py
@@ -1,8 +1,4 @@
# pytest customizations specific to these benchmarks
-import sys
-from os import path
-import importlib
-
def pytest_addoption(parser):
parser.addoption("--no-rmm-reinit", action="store_true", default=False,
@@ -11,21 +7,19 @@ def pytest_addoption(parser):
def pytest_sessionstart(session):
- # if the --no-rmm-reinit option is given, import the benchmark's "params"
- # module and change the FIXTURE_PARAMS accordingly.
+ # if the --no-rmm-reinit option is given, set (or add to) the CLI "mark
+ # expression" (-m) the markers for no managedmem and no poolallocator. This
+ # will cause the RMM reinit() function to not be called.
if session.config.getoption("no_rmm_reinit"):
- paramsPyFile = path.join(path.dirname(path.abspath(__file__)),
- "params.py")
+ newMarkexpr = "managedmem_off and poolallocator_off"
+ currentMarkexpr = session.config.getoption("markexpr")
- # A simple "import" statement will not find the modules here (unless if
- # this package is on the import path) since pytest evaluates this from
- # a different location.
- spec = importlib.util.spec_from_file_location("params", paramsPyFile)
- module = importlib.util.module_from_spec(spec)
- spec.loader.exec_module(module)
+ if ("managedmem" in currentMarkexpr) or \
+ ("poolallocator" in currentMarkexpr):
+ raise RuntimeError("managedmem and poolallocator markers cannot "
+ "be used with --no-rmm-reinit")
- module.FIXTURE_PARAMS = module.NO_RMMREINIT_FIXTURE_PARAMS
+ if currentMarkexpr:
+ newMarkexpr = f"({currentMarkexpr}) and ({newMarkexpr})"
- # If "benchmarks.params" is registered in sys.modules, all future
- # imports of the module will simply refer to this one.
- sys.modules["benchmarks.params"] = module
+ session.config.option.markexpr = newMarkexpr
diff --git a/benchmarks/params.py b/benchmarks/params.py
index cab0210ba23..2d1d3ea4acc 100644
--- a/benchmarks/params.py
+++ b/benchmarks/params.py
@@ -1,3 +1,15 @@
+# Copyright (c) 2020, NVIDIA CORPORATION.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
from itertools import product
import pytest
@@ -58,8 +70,10 @@ def genFixtureParamsProduct(*args):
# FIXME: write and use mechanism described here for specifying datasets:
# https://docs.rapids.ai/maintainers/datasets
-# FIXME: rlr: soc-twitter-2010.csv crashes with OOM error on my HP-Z8!
+# FIXME: rlr: soc-twitter-2010.csv crashes with OOM error on my RTX-8000
UNDIRECTED_DATASETS = [
+ pytest.param("../datasets/karate.csv",
+ marks=[pytest.mark.tiny, pytest.mark.undirected]),
pytest.param("../datasets/csv/undirected/hollywood.csv",
marks=[pytest.mark.small, pytest.mark.undirected]),
pytest.param("../datasets/csv/undirected/europe_osm.csv",
@@ -88,16 +102,7 @@ def genFixtureParamsProduct(*args):
marks=[pytest.mark.poolallocator_off]),
]
-ALL_FIXTURE_PARAMS = genFixtureParamsProduct(
- (DIRECTED_DATASETS + UNDIRECTED_DATASETS, "ds"),
- (MANAGED_MEMORY, "mm"),
- (POOL_ALLOCATOR, "pa"))
-
-NO_RMMREINIT_FIXTURE_PARAMS = genFixtureParamsProduct(
- (DIRECTED_DATASETS +
- UNDIRECTED_DATASETS, "ds"))
-
-# conftest.py will switch this to NO_RMMREINIT_FIXTURE_PARAMS
-# if the --no-rmm-reinit option is passed.
-# See conftest.py for details
-FIXTURE_PARAMS = ALL_FIXTURE_PARAMS
+FIXTURE_PARAMS = genFixtureParamsProduct(
+ (DIRECTED_DATASETS + UNDIRECTED_DATASETS, "ds"),
+ (MANAGED_MEMORY, "mm"),
+ (POOL_ALLOCATOR, "pa"))
diff --git a/benchmarks/pytest.ini b/benchmarks/pytest.ini
index fb4e43965d6..06a67a06040 100644
--- a/benchmarks/pytest.ini
+++ b/benchmarks/pytest.ini
@@ -1,9 +1,9 @@
[pytest]
addopts =
- -x
--benchmark-warmup=on
--benchmark-warmup-iterations=1
--benchmark-min-rounds=3
+ --benchmark-columns="min, max, mean, stddev, outliers, gpu_mem, rounds"
markers =
managedmem_on: RMM managed memory enabled
@@ -12,6 +12,7 @@ markers =
poolallocator_off: RMM pool allocator disabled
ETL: benchmarks for ETL steps
small: small datasets
+ tiny: tiny datasets
directed: directed datasets
undirected: undirected datasets
diff --git a/build.sh b/build.sh
index 94c37cf20bb..e0557344384 100755
--- a/build.sh
+++ b/build.sh
@@ -34,7 +34,7 @@ HELP="$0 [ ...] [ ...]
default action (no args) is to build and install 'libcugraph' then 'cugraph' targets
"
-LIBCUGRAPH_BUILD_DIR=${REPODIR}/cpp/build
+LIBCUGRAPH_BUILD_DIR=${LIBCUGRAPH_BUILD_DIR:=${REPODIR}/cpp/build}
CUGRAPH_BUILD_DIR=${REPODIR}/python/build
BUILD_DIRS="${LIBCUGRAPH_BUILD_DIR} ${CUGRAPH_BUILD_DIR}"
@@ -116,7 +116,7 @@ if (( ${NUMARGS} == 0 )) || hasArg cugraph; then
cd ${REPODIR}/python
if [[ ${INSTALL_TARGET} != "" ]]; then
- python setup.py build_ext --inplace
+ python setup.py build_ext --inplace --library-dir=${LIBCUGRAPH_BUILD_DIR}
python setup.py install
else
python setup.py build_ext --inplace --library-dir=${LIBCUGRAPH_BUILD_DIR}
diff --git a/ci/benchmark/build.sh b/ci/benchmark/build.sh
new file mode 100644
index 00000000000..49a6362a904
--- /dev/null
+++ b/ci/benchmark/build.sh
@@ -0,0 +1,169 @@
+#!/usr/bin/env bash
+# Copyright (c) 2018-2020, NVIDIA CORPORATION.
+##########################################
+# cuGraph Benchmark test script for CI #
+##########################################
+
+set -e
+set -o pipefail
+NUMARGS=$#
+ARGS=$*
+
+function logger {
+ echo -e "\n>>>> $@\n"
+}
+
+function hasArg {
+ (( ${NUMARGS} != 0 )) && (echo " ${ARGS} " | grep -q " $1 ")
+}
+
+function cleanup {
+ logger "Removing datasets and temp files..."
+ rm -rf $WORKSPACE/datasets/test
+ rm -rf $WORKSPACE/datasets/benchmark
+ rm -f testoutput.txt
+}
+
+# Set cleanup trap for Jenkins
+if [ ! -z "$JENKINS_HOME" ] ; then
+ logger "Jenkins environment detected, setting cleanup trap..."
+ trap cleanup EXIT
+fi
+
+# Set path, build parallel level, and CUDA version
+cd $WORKSPACE
+export PATH=/conda/bin:/usr/local/cuda/bin:$PATH
+export PARALLEL_LEVEL=4
+export CUDA_REL=${CUDA_VERSION%.*}
+export HOME=$WORKSPACE
+export GIT_DESCRIBE_TAG=`git describe --tags`
+export MINOR_VERSION=`echo $GIT_DESCRIBE_TAG | grep -o -E '([0-9]+\.[0-9]+)'`
+
+# Set Benchmark Vars
+export DATASETS_DIR=${WORKSPACE}/datasets
+export BENCHMARKS_DIR=${WORKSPACE}/benchmarks
+
+##########################################
+# Environment Setup #
+##########################################
+
+# TODO: Delete build section when artifacts are available
+
+logger "Check environment..."
+env
+
+logger "Check GPU usage..."
+nvidia-smi
+
+logger "Activate conda env..."
+source activate rapids
+
+
+# Enter dependencies to be shown in ASV tooltips.
+CUGRAPH_DEPS=(cudf rmm)
+LIBCUGRAPH_DEPS=(cudf rmm)
+
+logger "conda install required packages"
+conda install -c nvidia -c rapidsai -c rapidsai-nightly -c conda-forge -c defaults \
+ "cudf=${MINOR_VERSION}" \
+ "rmm=${MINOR_VERSION}" \
+ "cudatoolkit=$CUDA_REL" \
+ "dask-cudf=${MINOR_VERSION}" \
+ "dask-cuda=${MINOR_VERSION}" \
+ "ucx-py=${MINOR_VERSION}" \
+ "rapids-build-env=${MINOR_VERSION}" \
+ rapids-pytest-benchmark
+
+# Install the master version of dask and distributed
+logger "pip install git+https://github.com/dask/distributed.git --upgrade --no-deps"
+pip install "git+https://github.com/dask/distributed.git" --upgrade --no-deps
+
+logger "pip install git+https://github.com/dask/dask.git --upgrade --no-deps"
+pip install "git+https://github.com/dask/dask.git" --upgrade --no-deps
+
+logger "Check versions..."
+python --version
+$CC --version
+$CXX --version
+conda list
+
+##########################################
+# Build cuGraph #
+##########################################
+
+logger "Build libcugraph..."
+$WORKSPACE/build.sh clean libcugraph cugraph
+
+##########################################
+# Run Benchmarks #
+##########################################
+
+logger "Downloading Datasets for Benchmarks..."
+cd $DATASETS_DIR
+bash ./get_test_data.sh --benchmark
+ERRORCODE=$((ERRORCODE | $?))
+# Exit if dataset download failed
+if (( ${ERRORCODE} != 0 )); then
+ exit ${ERRORCODE}
+fi
+
+
+# Concatenate dependency arrays, convert to JSON array,
+# and remove duplicates.
+X=("${CUGRAPH_DEPS[@]}" "${LIBCUGRAPH_DEPS[@]}")
+DEPS=$(printf '%s\n' "${X[@]}" | jq -R . | jq -s 'unique')
+
+# Build object with k/v pairs of "dependency:version"
+DEP_VER_DICT=$(jq -n '{}')
+for DEP in $(echo "${DEPS}" | jq -r '.[]'); do
+ VER=$(conda list | grep "^${DEP}" | awk '{print $2"-"$3}')
+ DEP_VER_DICT=$(echo "${DEP_VER_DICT}" | jq -c --arg DEP "${DEP}" --arg VER "${VER}" '. + { ($DEP): $VER }')
+done
+
+# Pass in an array of dependencies to get a dict of "dependency:version"
+function getReqs() {
+ local DEPS_ARR=("$@")
+ local REQS="{}"
+ for DEP in "${DEPS_ARR[@]}"; do
+ VER=$(echo "${DEP_VER_DICT}" | jq -r --arg DEP "${DEP}" '.[$DEP]')
+ REQS=$(echo "${REQS}" | jq -c --arg DEP "${DEP}" --arg VER "${VER}" '. + { ($DEP): $VER }')
+ done
+
+ echo "${REQS}"
+}
+
+REQS=$(getReqs "${CUGRAPH_DEPS[@]}")
+
+BENCHMARK_META=$(jq -n \
+ --arg NODE "${ASV_LABEL}" \
+ --arg BRANCH "branch-${MINOR_VERSION}" \
+ --argjson REQS "${REQS}" '
+ {
+ "machineName": $NODE,
+ "commitBranch": $BRANCH,
+ "requirements": $REQS
+ }
+')
+
+echo "Benchmark meta:"
+echo "${BENCHMARK_META}" | jq "."
+
+logger "Running Benchmarks..."
+cd $BENCHMARKS_DIR
+set +e
+time pytest -v -m "small and managedmem_on and poolallocator_on" \
+ --benchmark-gpu-device=0 \
+ --benchmark-gpu-max-rounds=3 \
+ --benchmark-asv-output-dir="${S3_ASV_DIR}" \
+ --benchmark-asv-metadata="${BENCHMARK_META}"
+
+
+
+EXITCODE=$?
+
+# The reqs below can be passed as requirements for
+# C++ benchmarks in the future.
+# REQS=$(getReqs "${LIBCUGRAPH_DEPS[@]}")
+
+set -e
+JOBEXITCODE=0
diff --git a/ci/checks/changelog.sh b/ci/checks/changelog.sh
index 6cd869d1171..73921f6bf19 100755
--- a/ci/checks/changelog.sh
+++ b/ci/checks/changelog.sh
@@ -1,20 +1,20 @@
#!/bin/bash
-# Copyright (c) 2018, NVIDIA CORPORATION.
+# Copyright (c) 2018-2020, NVIDIA CORPORATION.
############################
# cuGraph CHANGELOG Tester #
############################
-# Checkout master for comparison
-git checkout --quiet master
+# Checkout main for comparison
+git checkout --force --quiet main
# Switch back to tip of PR branch
-git checkout --quiet current-pr-branch
+git checkout --force --quiet current-pr-branch
# Ignore errors during searching
set +e
# Get list of modified files between matster and PR branch
-CHANGELOG=`git diff --name-only master...current-pr-branch | grep CHANGELOG.md`
+CHANGELOG=`git diff --name-only main...current-pr-branch | grep CHANGELOG.md`
# Check if CHANGELOG has PR ID
PRNUM=`cat CHANGELOG.md | grep "$PR_ID"`
RETVAL=0
diff --git a/ci/checks/copyright.py b/ci/checks/copyright.py
new file mode 100644
index 00000000000..cb7f6d1d360
--- /dev/null
+++ b/ci/checks/copyright.py
@@ -0,0 +1,189 @@
+# Copyright (c) 2019-2020, 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.
+#
+
+import datetime
+import re
+import argparse
+import io
+import os
+import git_helpers
+
+FilesToCheck = [
+ re.compile(r"[.](cmake|cpp|cu|cuh|h|hpp|sh|pxd|py|pyx)$"),
+ re.compile(r"CMakeLists[.]txt$"),
+ re.compile(r"CMakeLists_standalone[.]txt$"),
+ re.compile(r"setup[.]cfg$"),
+ re.compile(r"[.]flake8[.]cython$"),
+ re.compile(r"meta[.]yaml$")
+]
+
+# this will break starting at year 10000, which is probably OK :)
+CheckSimple = re.compile(r"Copyright \(c\) (\d{4}), NVIDIA CORPORATION")
+CheckDouble = re.compile(
+ r"Copyright \(c\) (\d{4})-(\d{4}), NVIDIA CORPORATION")
+
+
+def checkThisFile(f):
+ # This check covers things like symlinks which point to files that DNE
+ if not(os.path.exists(f)):
+ return False
+ if git_helpers and git_helpers.isFileEmpty(f):
+ return False
+ for checker in FilesToCheck:
+ if checker.search(f):
+ return True
+ return False
+
+
+def getCopyrightYears(line):
+ res = CheckSimple.search(line)
+ if res:
+ return (int(res.group(1)), int(res.group(1)))
+ res = CheckDouble.search(line)
+ if res:
+ return (int(res.group(1)), int(res.group(2)))
+ return (None, None)
+
+
+def replaceCurrentYear(line, start, end):
+ # first turn a simple regex into double (if applicable). then update years
+ res = CheckSimple.sub(r"Copyright (c) \1-\1, NVIDIA CORPORATION", line)
+ res = CheckDouble.sub(
+ r"Copyright (c) {:04d}-{:04d}, NVIDIA CORPORATION".format(start, end),
+ res)
+ return res
+
+
+def checkCopyright(f, update_current_year):
+ """
+ Checks for copyright headers and their years
+ """
+ errs = []
+ thisYear = datetime.datetime.now().year
+ lineNum = 0
+ crFound = False
+ yearMatched = False
+ with io.open(f, "r", encoding="utf-8") as fp:
+ lines = fp.readlines()
+ for line in lines:
+ lineNum += 1
+ start, end = getCopyrightYears(line)
+ if start is None:
+ continue
+ crFound = True
+ if start > end:
+ e = [f, lineNum, "First year after second year in the copyright "
+ "header (manual fix required)", None]
+ errs.append(e)
+ if thisYear < start or thisYear > end:
+ e = [f, lineNum, "Current year not included in the "
+ "copyright header", None]
+ if thisYear < start:
+ e[-1] = replaceCurrentYear(line, thisYear, end)
+ if thisYear > end:
+ e[-1] = replaceCurrentYear(line, start, thisYear)
+ errs.append(e)
+ else:
+ yearMatched = True
+ fp.close()
+ # copyright header itself not found
+ if not crFound:
+ e = [f, 0, "Copyright header missing or formatted incorrectly "
+ "(manual fix required)", None]
+ errs.append(e)
+ # even if the year matches a copyright header, make the check pass
+ if yearMatched:
+ errs = []
+
+ if update_current_year:
+ errs_update = [x for x in errs if x[-1] is not None]
+ if len(errs_update) > 0:
+ print("File: {}. Changing line(s) {}".format(
+ f, ', '.join(str(x[1]) for x in errs if x[-1] is not None)))
+ for _, lineNum, __, replacement in errs_update:
+ lines[lineNum - 1] = replacement
+ with io.open(f, "w", encoding="utf-8") as out_file:
+ for new_line in lines:
+ out_file.write(new_line)
+ errs = [x for x in errs if x[-1] is None]
+
+ return errs
+
+
+
+def getAllFilesUnderDir(root, pathFilter=None):
+ retList = []
+ for (dirpath, dirnames, filenames) in os.walk(root):
+ for fn in filenames:
+ filePath = os.path.join(dirpath, fn)
+ if pathFilter(filePath):
+ retList.append(filePath)
+ return retList
+
+
+def checkCopyright_main():
+ """
+ Checks for copyright headers in all the modified files. In case of local
+ repo, this script will just look for uncommitted files and in case of CI
+ it compares between branches "$PR_TARGET_BRANCH" and "current-pr-branch"
+ """
+ retVal = 0
+
+ argparser = argparse.ArgumentParser(
+ description="Checks for a consistent copyright header")
+ argparser.add_argument("--update-current-year", dest='update_current_year',
+ action="store_true", required=False, help="If set, "
+ "update the current year if a header is already "
+ "present and well formatted.")
+ argparser.add_argument("--git-modified-only", dest='git_modified_only',
+ action="store_true", required=False, help="If set, "
+ "only files seen as modified by git will be "
+ "processed.")
+
+ (args, dirs) = argparser.parse_known_args()
+ if args.git_modified_only:
+ files = git_helpers.modifiedFiles(pathFilter=checkThisFile)
+ else:
+ files = []
+ for d in [os.path.abspath(d) for d in dirs]:
+ if not(os.path.isdir(d)):
+ raise ValueError(f"{d} is not a directory.")
+ files += getAllFilesUnderDir(d, pathFilter=checkThisFile)
+
+ errors = []
+ for f in files:
+ errors += checkCopyright(f, args.update_current_year)
+
+ if len(errors) > 0:
+ print("Copyright headers incomplete in some of the files!")
+ for e in errors:
+ print(" %s:%d Issue: %s" % (e[0], e[1], e[2]))
+ print("")
+ n_fixable = sum(1 for e in errors if e[-1] is not None)
+ path_parts = os.path.abspath(__file__).split(os.sep)
+ file_from_repo = os.sep.join(path_parts[path_parts.index("ci"):])
+ if n_fixable > 0:
+ print("You can run {} --update-current-year to fix {} of these "
+ "errors.\n".format(file_from_repo, n_fixable))
+ retVal = 1
+ else:
+ print("Copyright check passed")
+
+ return retVal
+
+
+if __name__ == "__main__":
+ import sys
+ sys.exit(checkCopyright_main())
diff --git a/ci/checks/style.sh b/ci/checks/style.sh
index fa933e41410..696f566a96a 100755
--- a/ci/checks/style.sh
+++ b/ci/checks/style.sh
@@ -1,11 +1,17 @@
#!/bin/bash
-# Copyright (c) 2018, NVIDIA CORPORATION.
+# Copyright (c) 2018-2020, NVIDIA CORPORATION.
########################
# cuGraph Style Tester #
########################
-# Ignore errors and set path
-set +e
+# Assume this script is run from the root of the cugraph repo
+
+# Make failing commands visible when used in a pipeline and allow the script to
+# continue on errors, but use ERRORCODE to still allow any failing command to be
+# captured for returning a final status code. This allows all style check to
+# take place to provide a more comprehensive list of style violations.
+set -o pipefail
+ERRORCODE=0
PATH=/conda/bin:$PATH
# Activate common conda env
@@ -13,11 +19,12 @@ source activate gdf
# Run flake8 and get results/return code
FLAKE=`flake8 --config=python/.flake8 python`
-FLAKE_RETVAL=$?
+ERRORCODE=$((ERRORCODE | $?))
# Run clang-format and check for a consistent code format
CLANG_FORMAT=`python cpp/scripts/run-clang-format.py 2>&1`
CLANG_FORMAT_RETVAL=$?
+ERRORCODE=$((ERRORCODE | ${CLANG_FORMAT_RETVAL}))
# Output results if failure otherwise show pass
if [ "$FLAKE" != "" ]; then
@@ -36,8 +43,19 @@ else
echo -e "\n\n>>>> PASSED: clang format check\n\n"
fi
-RETVALS=($FLAKE_RETVAL $CLANG_FORMAT_RETVAL)
-IFS=$'\n'
-RETVAL=`echo "${RETVALS[*]}" | sort -nr | head -n1`
+# Check for copyright headers in the files modified currently
+#COPYRIGHT=`env PYTHONPATH=ci/utils python ci/checks/copyright.py cpp python benchmarks ci 2>&1`
+COPYRIGHT=`env PYTHONPATH=ci/utils python ci/checks/copyright.py --git-modified-only 2>&1`
+CR_RETVAL=$?
+ERRORCODE=$((ERRORCODE | ${CR_RETVAL}))
+
+# Output results if failure otherwise show pass
+if [ "$CR_RETVAL" != "0" ]; then
+ echo -e "\n\n>>>> FAILED: copyright check; begin output\n\n"
+ echo -e "$COPYRIGHT"
+ echo -e "\n\n>>>> FAILED: copyright check; end output\n\n"
+else
+ echo -e "\n\n>>>> PASSED: copyright check\n\n"
+fi
-exit $RETVAL
+exit ${ERRORCODE}
diff --git a/ci/cpu/build.sh b/ci/cpu/build.sh
index dfbbbffc73b..2cdb77bbbc2 100755
--- a/ci/cpu/build.sh
+++ b/ci/cpu/build.sh
@@ -1,5 +1,5 @@
#!/bin/bash
-# Copyright (c) 2018, NVIDIA CORPORATION.
+# Copyright (c) 2018-2020, NVIDIA CORPORATION.
#########################################
# cuGraph CPU conda build script for CI #
#########################################
@@ -20,10 +20,6 @@ export HOME=$WORKSPACE
# Switch to project root; also root of repo checkout
cd $WORKSPACE
-# Get latest tag and number of commits since tag
-export GIT_DESCRIBE_TAG=`git describe --abbrev=0 --tags`
-export GIT_DESCRIBE_NUMBER=`git rev-list ${GIT_DESCRIBE_TAG}..HEAD --count`
-
# If nightly build, append current YYMMDD to version
if [[ "$BUILD_MODE" = "branch" && "$SOURCE_BRANCH" = branch-* ]] ; then
export VERSION_SUFFIX=`date +%y%m%d`
diff --git a/ci/cpu/cugraph/build_cugraph.sh b/ci/cpu/cugraph/build_cugraph.sh
index 874488ff020..70f5baee230 100755
--- a/ci/cpu/cugraph/build_cugraph.sh
+++ b/ci/cpu/cugraph/build_cugraph.sh
@@ -1,9 +1,25 @@
#!/usr/bin/env bash
+# Copyright (c) 2018-2020, 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.
+
set -e
if [ "$BUILD_CUGRAPH" == "1" ]; then
echo "Building cugraph"
CUDA_REL=${CUDA_VERSION%.*}
-
- conda build conda/recipes/cugraph --python=$PYTHON
+ if [[ -z "$PROJECT_FLASH" || "$PROJECT_FLASH" == "0" ]]; then
+ conda build conda/recipes/cugraph --python=$PYTHON
+ else
+ conda build conda/recipes/cugraph -c ci/artifacts/cugraph/cpu/conda-bld/ --dirty --no-remove-work-dir --python=$PYTHON
+ fi
fi
diff --git a/ci/cpu/cugraph/upload-anaconda.sh b/ci/cpu/cugraph/upload-anaconda.sh
index e729972cf43..9601905d6c4 100755
--- a/ci/cpu/cugraph/upload-anaconda.sh
+++ b/ci/cpu/cugraph/upload-anaconda.sh
@@ -1,13 +1,22 @@
#!/bin/bash
+# Copyright (c) 2018-2020, 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
#
-# Adopted from https://github.com/tmcdonell/travis-scripts/blob/dfaac280ac2082cd6bcaba3217428347899f2975/update-accelerate-buildbot.sh
+# 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.
set -e
-if [ "$UPLOAD_CUGRAPH" == "1" ]; then
+if [[ "$BUILD_CUGRAPH" == "1" && "$UPLOAD_CUGRAPH" == "1" ]]; then
export UPLOADFILE=`conda build conda/recipes/cugraph -c rapidsai -c nvidia -c numba -c conda-forge -c defaults --python=$PYTHON --output`
- SOURCE_BRANCH=master
# Have to label all CUDA versions due to the compatibility to work with any CUDA
if [ "$LABEL_MAIN" == "1" ]; then
@@ -22,8 +31,7 @@ if [ "$UPLOAD_CUGRAPH" == "1" ]; then
test -e ${UPLOADFILE}
- # Restrict uploads to master branch
- if [ ${GIT_BRANCH} != ${SOURCE_BRANCH} ]; then
+ if [ ${BUILD_MODE} != "branch" ]; then
echo "Skipping upload"
return 0
fi
diff --git a/ci/cpu/libcugraph/build_libcugraph.sh b/ci/cpu/libcugraph/build_libcugraph.sh
index b728c130d0e..e5ff77d7db9 100755
--- a/ci/cpu/libcugraph/build_libcugraph.sh
+++ b/ci/cpu/libcugraph/build_libcugraph.sh
@@ -1,9 +1,25 @@
#!/usr/bin/env bash
+# Copyright (c) 2018-2020, 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.
+
set -e
if [ "$BUILD_LIBCUGRAPH" == '1' ]; then
echo "Building libcugraph"
CUDA_REL=${CUDA_VERSION%.*}
-
- conda build conda/recipes/libcugraph
+ if [[ -z "$PROJECT_FLASH" || "$PROJECT_FLASH" == "0" ]]; then
+ conda build conda/recipes/libcugraph
+ else
+ conda build --dirty --no-remove-work-dir conda/recipes/libcugraph
+ fi
fi
diff --git a/ci/cpu/libcugraph/upload-anaconda.sh b/ci/cpu/libcugraph/upload-anaconda.sh
index 11316dc5b1f..8cd71070778 100755
--- a/ci/cpu/libcugraph/upload-anaconda.sh
+++ b/ci/cpu/libcugraph/upload-anaconda.sh
@@ -1,23 +1,31 @@
#!/bin/bash
+# Copyright (c) 2018-2020, 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
#
-# Adopted from https://github.com/tmcdonell/travis-scripts/blob/dfaac280ac2082cd6bcaba3217428347899f2975/update-accelerate-buildbot.sh
+# 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.
set -e
-if [ "$UPLOAD_LIBCUGRAPH" == "1" ]; then
+if [[ "$BUILD_LIBCUGRAPH" == "1" && "$UPLOAD_LIBCUGRAPH" == "1" ]]; then
CUDA_REL=${CUDA_VERSION%.*}
export UPLOADFILE=`conda build conda/recipes/libcugraph --output`
- SOURCE_BRANCH=master
LABEL_OPTION="--label main"
echo "LABEL_OPTION=${LABEL_OPTION}"
test -e ${UPLOADFILE}
- # Restrict uploads to master branch
- if [ ${GIT_BRANCH} != ${SOURCE_BRANCH} ]; then
+ if [ ${BUILD_MODE} != "branch" ]; then
echo "Skipping upload"
return 0
fi
diff --git a/ci/cpu/prebuild.sh b/ci/cpu/prebuild.sh
index 2abc137662c..ee471329b35 100644
--- a/ci/cpu/prebuild.sh
+++ b/ci/cpu/prebuild.sh
@@ -1,15 +1,30 @@
#!/usr/bin/env bash
+# Copyright (c) 2018-2020, 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.
-export BUILD_CUGRAPH=1
-export BUILD_LIBCUGRAPH=1
+if [[ -z "$PROJECT_FLASH" || "$PROJECT_FLASH" == "0" ]]; then
+ #If project flash is not activate, always build both
+ export BUILD_CUGRAPH=1
+ export BUILD_LIBCUGRAPH=1
+fi
-if [[ "$CUDA" == "10.0" ]]; then
+if [[ "$CUDA" == "10.1" ]]; then
export UPLOAD_CUGRAPH=1
else
export UPLOAD_CUGRAPH=0
fi
-if [[ "$PYTHON" == "3.6" ]]; then
+if [[ "$PYTHON" == "3.7" ]]; then
export UPLOAD_LIBCUGRAPH=1
else
export UPLOAD_LIBCUGRAPH=0
diff --git a/ci/docs/build.sh b/ci/docs/build.sh
index 1bf8b6b569a..71ad79419a0 100644
--- a/ci/docs/build.sh
+++ b/ci/docs/build.sh
@@ -61,15 +61,3 @@ done
mv $PROJECT_WORKSPACE/cpp/doxygen/html/* $DOCS_WORKSPACE/api/libcugraph/$BRANCH_VERSION
mv $PROJECT_WORKSPACE/docs/build/html/* $DOCS_WORKSPACE/api/cugraph/$BRANCH_VERSION
-# Customize HTML documentation
-./update_symlinks.sh $NIGHTLY_VERSION
-./customization/lib_map.sh
-
-
-for PROJECT in ${PROJECTS[@]}; do
- echo ""
- echo "Customizing: $PROJECT"
- ./customization/customize_docs_in_folder.sh api/$PROJECT/ $NIGHTLY_VERSION
- git add $DOCS_WORKSPACE/api/$PROJECT/*
-done
-
diff --git a/ci/getGTestTimes.sh b/ci/getGTestTimes.sh
index b2c3c7718e0..8a3752d76e2 100755
--- a/ci/getGTestTimes.sh
+++ b/ci/getGTestTimes.sh
@@ -1,4 +1,16 @@
#!/bin/bash
+# Copyright (c) 2019-2020, 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.
# This script will print the gtest results sorted by runtime. This will print
# the results two ways: first by printing all tests sorted by runtime, then by
diff --git a/ci/gpu/build.sh b/ci/gpu/build.sh
index 78c020375d9..3cef2e56877 100755
--- a/ci/gpu/build.sh
+++ b/ci/gpu/build.sh
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
-# Copyright (c) 2018, NVIDIA CORPORATION.
+# Copyright (c) 2018-2020, NVIDIA CORPORATION.
##########################################
# cuGraph GPU build & testscript for CI #
##########################################
@@ -57,21 +57,19 @@ source activate gdf
logger "conda install required packages"
conda install -c nvidia -c rapidsai -c rapidsai-nightly -c conda-forge -c defaults \
- cudf=${MINOR_VERSION} \
- rmm=${MINOR_VERSION} \
- networkx>=2.3 \
- python-louvain \
- cudatoolkit=$CUDA_REL \
- dask>=2.12.0 \
- distributed>=2.12.0 \
- dask-cudf=${MINOR_VERSION} \
- dask-cuda=${MINOR_VERSION} \
- scikit-learn=0.23.0 \
- nccl>=2.5 \
- ucx-py=${MINOR_VERSION} \
- libcypher-parser \
- ipython=7.3* \
- jupyterlab
+ "cudf=${MINOR_VERSION}" \
+ "rmm=${MINOR_VERSION}" \
+ "cudatoolkit=$CUDA_REL" \
+ "dask-cudf=${MINOR_VERSION}" \
+ "dask-cuda=${MINOR_VERSION}" \
+ "ucx-py=${MINOR_VERSION}" \
+ "rapids-build-env=$MINOR_VERSION.*" \
+ "rapids-notebook-env=$MINOR_VERSION.*" \
+ rapids-pytest-benchmark
+
+# https://docs.rapids.ai/maintainers/depmgmt/
+# conda remove --force rapids-build-env rapids-notebook-env
+# conda install "your-pkg=1.0.0"
# Install the master version of dask and distributed
logger "pip install git+https://github.com/dask/distributed.git --upgrade --no-deps"
@@ -91,8 +89,10 @@ conda list
# BUILD - Build libcugraph and cuGraph from source
################################################################################
-logger "Build libcugraph..."
-$WORKSPACE/build.sh clean libcugraph cugraph
+if [[ -z "$PROJECT_FLASH" || "$PROJECT_FLASH" == "0" ]]; then
+ logger "Build libcugraph..."
+ $WORKSPACE/build.sh clean libcugraph cugraph
+fi
################################################################################
# TEST - Run GoogleTest and py.tests for libcugraph and cuGraph
diff --git a/ci/gpu/test-notebooks.sh b/ci/gpu/test-notebooks.sh
index 491458df5ce..247eb328d2e 100755
--- a/ci/gpu/test-notebooks.sh
+++ b/ci/gpu/test-notebooks.sh
@@ -1,4 +1,16 @@
#!/bin/bash
+# Copyright (c) 2019-2020, 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.
#RAPIDS_DIR=/rapids
NOTEBOOKS_DIR=${WORKSPACE}/notebooks
@@ -11,7 +23,7 @@ TOPLEVEL_NB_FOLDERS=$(find . -name *.ipynb |cut -d'/' -f2|sort -u)
# Add notebooks that should be skipped here
# (space-separated list of filenames without paths)
-SKIPNBS="uvm.ipynb"
+SKIPNBS="uvm.ipynb bfs_benchmark.ipynb louvain_benchmark.ipynb pagerank_benchmark.ipynb sssp_benchmark.ipynb release.ipynb"
## Check env
env
diff --git a/ci/local/README.md b/ci/local/README.md
index c20a073e833..28bbe3590ea 100644
--- a/ci/local/README.md
+++ b/ci/local/README.md
@@ -25,7 +25,7 @@ where:
Example Usage:
`bash build.sh -r ~/rapids/cugraph -i gpuci/rapidsai-base:cuda10.1-ubuntu16.04-gcc5-py3.6`
-For a full list of available gpuCI docker images, visit our [DockerHub](https://hub.docker.com/r/gpuci/rapidsai-base/tags) page.
+For a full list of available gpuCI docker images, visit our [DockerHub](https://hub.docker.com/r/gpuci/rapidsai/tags) page.
Style Check:
```bash
@@ -51,6 +51,7 @@ The docker image will generate build artifacts in a folder on your machine locat
The script will build your repository and run all tests. If any tests fail, it dumps the user into the docker container itself to allow you to debug from within the container. If all the tests pass as expected the container exits and is automatically removed. Remember to exit the container if tests fail and you do not wish to debug within the container itself.
+If you would like to rerun the tests after changing some code in the container, run `bash ci/gpu/build.sh`.
### Container File Structure
diff --git a/ci/local/build.sh b/ci/local/build.sh
index c6f7f1a51e2..51b9380a311 100755
--- a/ci/local/build.sh
+++ b/ci/local/build.sh
@@ -1,6 +1,21 @@
#!/bin/bash
-
-DOCKER_IMAGE="gpuci/rapidsai-base:cuda10.0-ubuntu16.04-gcc5-py3.6"
+# Copyright (c) 2018-2020, 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.
+
+GIT_DESCRIBE_TAG=`git describe --tags`
+MINOR_VERSION=`echo $GIT_DESCRIBE_TAG | grep -o -E '([0-9]+\.[0-9]+)'`
+
+DOCKER_IMAGE="gpuci/rapidsai:${MINOR_VERSION}-cuda10.1-devel-ubuntu16.04-py3.7"
REPO_PATH=${PWD}
RAPIDS_DIR_IN_CONTAINER="/rapids"
CPP_BUILD_DIR="cpp/build"
@@ -139,4 +154,4 @@ docker run --rm -it ${GPU_OPTS} \
-v "$PASSWD_FILE":/etc/passwd:ro \
-v "$GROUP_FILE":/etc/group:ro \
--cap-add=SYS_PTRACE \
- "${DOCKER_IMAGE}" bash -c "${COMMAND}"
\ No newline at end of file
+ "${DOCKER_IMAGE}" bash -c "${COMMAND}"
diff --git a/ci/release/update-version.sh b/ci/release/update-version.sh
index b9faa5cbf1f..d853c3693c6 100755
--- a/ci/release/update-version.sh
+++ b/ci/release/update-version.sh
@@ -1,7 +1,16 @@
#!/bin/bash
-########################
-# RMM Version Updater #
-########################
+# Copyright (c) 2018-2020, 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.
## Usage
# bash update-version.sh
@@ -17,6 +26,7 @@ CURRENT_TAG=`git tag | grep -xE 'v[0-9\.]+' | sort --version-sort | tail -n 1 |
CURRENT_MAJOR=`echo $CURRENT_TAG | awk '{split($0, a, "."); print a[1]}'`
CURRENT_MINOR=`echo $CURRENT_TAG | awk '{split($0, a, "."); print a[2]}'`
CURRENT_PATCH=`echo $CURRENT_TAG | awk '{split($0, a, "."); print a[3]}'`
+CURRENT_SHORT_TAG=${CURRENT_MAJOR}.${CURRENT_MINOR}
NEXT_MAJOR=$((CURRENT_MAJOR + 1))
NEXT_MINOR=$((CURRENT_MINOR + 1))
NEXT_PATCH=$((CURRENT_PATCH + 1))
@@ -51,3 +61,11 @@ sed_runner 's/'"CUGRAPH VERSION .* LANGUAGES C CXX CUDA)"'/'"CUGRAPH VERSION ${N
# RTD update
sed_runner 's/version = .*/version = '"'${NEXT_SHORT_TAG}'"'/g' docs/source/conf.py
sed_runner 's/release = .*/release = '"'${NEXT_FULL_TAG}'"'/g' docs/source/conf.py
+
+for FILE in conda/environments/*.yml; do
+ sed_runner "s/cudf=${CURRENT_SHORT_TAG}/cudf=${NEXT_SHORT_TAG}/g" ${FILE};
+ sed_runner "s/rmm=${CURRENT_SHORT_TAG}/rmm=${NEXT_SHORT_TAG}/g" ${FILE};
+ sed_runner "s/dask-cuda=${CURRENT_SHORT_TAG}/dask-cuda=${NEXT_SHORT_TAG}/g" ${FILE};
+ sed_runner "s/dask-cudf=${CURRENT_SHORT_TAG}/dask-cudf=${NEXT_SHORT_TAG}/g" ${FILE};
+ sed_runner "s/ucx-py=${CURRENT_SHORT_TAG}/ucx-py=${NEXT_SHORT_TAG}/g" ${FILE};
+done
diff --git a/ci/test.sh b/ci/test.sh
index 37ec2fcc956..fde9bbb3d8d 100755
--- a/ci/test.sh
+++ b/ci/test.sh
@@ -1,4 +1,16 @@
#!/bin/bash
+# Copyright (c) 2019-2020, 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.
# note: do not use set -e in order to allow all gtest invocations to take place,
# and instead keep track of exit status and exit with an overall exit status
@@ -45,7 +57,12 @@ else
fi
fi
-cd ${CUGRAPH_ROOT}/cpp/build
+if [[ -z "$PROJECT_FLASH" || "$PROJECT_FLASH" == "0" ]]; then
+ cd ${CUGRAPH_ROOT}/cpp/build
+else
+ export LD_LIBRARY_PATH="$WORKSPACE/ci/artifacts/cugraph/cpu/conda_work/cpp/build:$LD_LIBRARY_PATH"
+ cd $WORKSPACE/ci/artifacts/cugraph/cpu/conda_work/cpp/build
+fi
for gt in gtests/*; do
test_name=$(basename $gt)
@@ -54,9 +71,22 @@ for gt in gtests/*; do
ERRORCODE=$((ERRORCODE | $?))
done
-echo "Python py.test for cuGraph..."
+if [[ "$PROJECT_FLASH" == "1" ]]; then
+ echo "Installing libcugraph..."
+ conda install -c $WORKSPACE/ci/artifacts/cugraph/cpu/conda-bld/ libcugraph
+ export LIBCUGRAPH_BUILD_DIR="$WORKSPACE/ci/artifacts/cugraph/cpu/conda_work/cpp/build"
+ echo "Build cugraph..."
+ $WORKSPACE/build.sh cugraph
+fi
+
+echo "Python pytest for cuGraph..."
cd ${CUGRAPH_ROOT}/python
-py.test --cache-clear --junitxml=${CUGRAPH_ROOT}/junit-cugraph.xml -v --cov-config=.coveragerc --cov=cugraph --cov-report=xml:${WORKSPACE}/python/cugraph/cugraph-coverage.xml --cov-report term
+pytest --cache-clear --junitxml=${CUGRAPH_ROOT}/junit-cugraph.xml -v --cov-config=.coveragerc --cov=cugraph --cov-report=xml:${WORKSPACE}/python/cugraph/cugraph-coverage.xml --cov-report term --ignore=cugraph/raft
+ERRORCODE=$((ERRORCODE | $?))
+
+echo "Python benchmarks for cuGraph (running as tests)..."
+cd ${CUGRAPH_ROOT}/benchmarks
+pytest -v -m "managedmem_on and poolallocator_on and tiny" --benchmark-disable
ERRORCODE=$((ERRORCODE | $?))
exit ${ERRORCODE}
diff --git a/ci/utils/git_helpers.py b/ci/utils/git_helpers.py
new file mode 100644
index 00000000000..83ad73fe283
--- /dev/null
+++ b/ci/utils/git_helpers.py
@@ -0,0 +1,137 @@
+# Copyright (c) 2019-2020, 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.
+#
+
+import subprocess
+import os
+import re
+
+
+def isFileEmpty(f):
+ return os.stat(f).st_size == 0
+
+
+def __git(*opts):
+ """Runs a git command and returns its output"""
+ cmd = "git " + " ".join(list(opts))
+ ret = subprocess.check_output(cmd, shell=True)
+ return ret.decode("UTF-8")
+
+
+def __gitdiff(*opts):
+ """Runs a git diff command with no pager set"""
+ return __git("--no-pager", "diff", *opts)
+
+
+def branch():
+ """Returns the name of the current branch"""
+ name = __git("rev-parse", "--abbrev-ref", "HEAD")
+ name = name.rstrip()
+ return name
+
+
+def uncommittedFiles():
+ """
+ Returns a list of all changed files that are not yet committed. This
+ means both untracked/unstaged as well as uncommitted files too.
+ """
+ files = __git("status", "-u", "-s")
+ ret = []
+ for f in files.splitlines():
+ f = f.strip(" ")
+ f = re.sub("\s+", " ", f) # noqa: W605
+ tmp = f.split(" ", 1)
+ # only consider staged files or uncommitted files
+ # in other words, ignore untracked files
+ if tmp[0] == "M" or tmp[0] == "A":
+ ret.append(tmp[1])
+ return ret
+
+
+def changedFilesBetween(b1, b2):
+ """Returns a list of files changed between branches b1 and b2"""
+ current = branch()
+ __git("checkout", "--quiet", b1)
+ __git("checkout", "--quiet", b2)
+ files = __gitdiff("--name-only", "--ignore-submodules", "%s...%s" %
+ (b1, b2))
+ __git("checkout", "--quiet", current)
+ return files.splitlines()
+
+
+def changesInFileBetween(file, b1, b2, pathFilter=None):
+ """Filters the changed lines to a file between the branches b1 and b2"""
+ current = branch()
+ __git("checkout", "--quiet", b1)
+ __git("checkout", "--quiet", b2)
+ diffs = __gitdiff("--ignore-submodules", "-w", "--minimal", "-U0",
+ "%s...%s" % (b1, b2), "--", file)
+ __git("checkout", "--quiet", current)
+ lines = []
+ for line in diffs.splitlines():
+ if pathFilter is None or pathFilter(line):
+ lines.append(line)
+ return lines
+
+
+def modifiedFiles(pathFilter=None):
+ """
+ If inside a CI-env (ie. currentBranch=current-pr-branch and the env-var
+ PR_TARGET_BRANCH is defined), then lists out all files modified between
+ these 2 branches. Else, lists out all the uncommitted files in the current
+ branch.
+
+ Such utility function is helpful while putting checker scripts as part of
+ cmake, as well as CI process. This way, during development, only the files
+ touched (but not yet committed) by devs can be checked. But, during the CI
+ process ALL files modified by the dev, as submiited in the PR, will be
+ checked. This happens, all the while using the same script.
+ """
+ if "PR_TARGET_BRANCH" in os.environ and branch() == "current-pr-branch":
+ allFiles = changedFilesBetween(os.environ["PR_TARGET_BRANCH"],
+ branch())
+ else:
+ allFiles = uncommittedFiles()
+ files = []
+ for f in allFiles:
+ if pathFilter is None or pathFilter(f):
+ files.append(f)
+ return files
+
+
+def listAllFilesInDir(folder):
+ """Utility function to list all files/subdirs in the input folder"""
+ allFiles = []
+ for root, dirs, files in os.walk(folder):
+ for name in files:
+ allFiles.append(os.path.join(root, name))
+ return allFiles
+
+
+def listFilesToCheck(filesDirs, pathFilter=None):
+ """
+ Utility function to filter the input list of files/dirs based on the input
+ pathFilter method and returns all the files that need to be checked
+ """
+ allFiles = []
+ for f in filesDirs:
+ if os.path.isfile(f):
+ if pathFilter is None or pathFilter(f):
+ allFiles.append(f)
+ elif os.path.isdir(f):
+ files = listAllFilesInDir(f)
+ for f_ in files:
+ if pathFilter is None or pathFilter(f_):
+ allFiles.append(f_)
+ return allFiles
diff --git a/ci/utils/nbtest.sh b/ci/utils/nbtest.sh
index f7b9774c6fd..8c86baeaa09 100755
--- a/ci/utils/nbtest.sh
+++ b/ci/utils/nbtest.sh
@@ -1,4 +1,16 @@
#!/bin/bash
+# Copyright (c) 2019-2020, 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.
MAGIC_OVERRIDE_CODE="
def my_run_line_magic(*args, **kwargs):
diff --git a/ci/utils/nbtestlog2junitxml.py b/ci/utils/nbtestlog2junitxml.py
index 15b362e4b70..e9712253b0e 100644
--- a/ci/utils/nbtestlog2junitxml.py
+++ b/ci/utils/nbtestlog2junitxml.py
@@ -1,3 +1,16 @@
+# Copyright (c) 2019-2020, 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.
+
# Generate a junit-xml file from parsing a nbtest log
import re
diff --git a/codecov.yml b/codecov.yml
new file mode 100644
index 00000000000..c0a3a2fba2b
--- /dev/null
+++ b/codecov.yml
@@ -0,0 +1,5 @@
+#Configuration File for CodeCov
+coverage:
+ status:
+ project: off
+ patch: off
diff --git a/conda/environments/cugraph_dev_cuda10.1.yml b/conda/environments/cugraph_dev_cuda10.1.yml
index 40e4da01244..eb987f326c8 100644
--- a/conda/environments/cugraph_dev_cuda10.1.yml
+++ b/conda/environments/cugraph_dev_cuda10.1.yml
@@ -5,21 +5,22 @@ channels:
- rapidsai-nightly
- conda-forge
dependencies:
-- cudf=0.14.*
-- nvstrings=0.14.*
-- rmm=0.14.*
+- cudf=0.15.*
+- rmm=0.15.*
- dask>=2.12.0
- distributed>=2.12.0
-- dask-cuda=0.14*
-- dask-cudf=0.14*
+- dask-cuda=0.15*
+- dask-cudf=0.15*
- nccl>=2.5
-- ucx-py=0.14*
+- ucx-py=0.15*
- scipy
- networkx
- python-louvain
- cudatoolkit=10.1
+- clang=8.0.1
+- clang-tools=8.0.1
- cmake>=3.12
-- python>=3.6,<3.8
+- python>=3.6,<3.9
- notebook>=0.5.0
- boost
- cython>=0.29,<0.30
@@ -35,3 +36,4 @@ dependencies:
- recommonmark
- pip
- libcypher-parser
+- rapids-pytest-benchmark
diff --git a/conda/environments/cugraph_dev_cuda10.2.yml b/conda/environments/cugraph_dev_cuda10.2.yml
index 6625d6c711c..028e0fce1a4 100644
--- a/conda/environments/cugraph_dev_cuda10.2.yml
+++ b/conda/environments/cugraph_dev_cuda10.2.yml
@@ -5,21 +5,22 @@ channels:
- rapidsai-nightly
- conda-forge
dependencies:
-- cudf=0.14.*
-- nvstrings=0.14.*
-- rmm=0.14.*
+- cudf=0.15.*
+- rmm=0.15.*
- dask>=2.12.0
- distributed>=2.12.0
-- dask-cuda=0.14*
-- dask-cudf=0.14*
+- dask-cuda=0.15*
+- dask-cudf=0.15*
- nccl>=2.5
-- ucx-py=0.14*
+- ucx-py=0.15*
- scipy
- networkx
- python-louvain
- cudatoolkit=10.2
+- clang=8.0.1
+- clang-tools=8.0.1
- cmake>=3.12
-- python>=3.6,<3.8
+- python>=3.6,<3.9
- notebook>=0.5.0
- boost
- cython>=0.29,<0.30
@@ -35,3 +36,4 @@ dependencies:
- recommonmark
- pip
- libcypher-parser
+- rapids-pytest-benchmark
diff --git a/conda/environments/cugraph_dev_cuda10.0.yml b/conda/environments/cugraph_dev_cuda11.0.yml
similarity index 70%
rename from conda/environments/cugraph_dev_cuda10.0.yml
rename to conda/environments/cugraph_dev_cuda11.0.yml
index 83e98d90437..bc3b84badf2 100644
--- a/conda/environments/cugraph_dev_cuda10.0.yml
+++ b/conda/environments/cugraph_dev_cuda11.0.yml
@@ -5,21 +5,22 @@ channels:
- rapidsai-nightly
- conda-forge
dependencies:
-- cudf=0.14.*
-- nvstrings=0.14.*
-- rmm=0.14.*
+- cudf=0.15.*
+- rmm=0.15.*
- dask>=2.12.0
- distributed>=2.12.0
-- dask-cuda=0.14*
-- dask-cudf=0.14*
+- dask-cuda=0.15*
+- dask-cudf=0.15*
- nccl>=2.5
-- ucx-py=0.14*
+- ucx-py=0.15*
- scipy
- networkx
- python-louvain
-- cudatoolkit=10.0
+- cudatoolkit=11.0
+- clang=8.0.1
+- clang-tools=8.0.1
- cmake>=3.12
-- python>=3.6,<3.8
+- python>=3.6,<3.9
- notebook>=0.5.0
- boost
- cython>=0.29,<0.30
@@ -35,3 +36,4 @@ dependencies:
- recommonmark
- pip
- libcypher-parser
+- rapids-pytest-benchmark
diff --git a/conda/recipes/cugraph/meta.yaml b/conda/recipes/cugraph/meta.yaml
index 4be2ef4014d..1a32fd2a4b1 100644
--- a/conda/recipes/cugraph/meta.yaml
+++ b/conda/recipes/cugraph/meta.yaml
@@ -4,7 +4,6 @@
# conda build -c nvidia -c rapidsai -c conda-forge -c defaults .
{% set version = environ.get('GIT_DESCRIBE_TAG', '0.0.0.dev').lstrip('v') + environ.get('VERSION_SUFFIX', '') %}
{% set minor_version = version.split('.')[0] + '.' + version.split('.')[1] %}
-{% set git_revision_count=environ.get('GIT_DESCRIBE_NUMBER', 0) %}
{% set py_version=environ.get('CONDA_PY', 36) %}
package:
name: cugraph
@@ -14,8 +13,8 @@ source:
path: ../../..
build:
- number: {{ git_revision_count }}
- string: py{{ py_version }}_{{ git_revision_count }}
+ number: {{ GIT_DESCRIBE_NUMBER }}
+ string: py{{ py_version }}_{{ GIT_DESCRIBE_HASH }}_{{ GIT_DESCRIBE_NUMBER }}
script_env:
- CC
- CXX
diff --git a/conda/recipes/libcugraph/meta.yaml b/conda/recipes/libcugraph/meta.yaml
index 2d0f81dd27a..22731102110 100644
--- a/conda/recipes/libcugraph/meta.yaml
+++ b/conda/recipes/libcugraph/meta.yaml
@@ -4,18 +4,17 @@
# conda build -c nvidia -c rapidsai -c conda-forge -c defaults .
{% set version = environ.get('GIT_DESCRIBE_TAG', '0.0.0.dev').lstrip('v') + environ.get('VERSION_SUFFIX', '') %}
{% set minor_version = version.split('.')[0] + '.' + version.split('.')[1] %}
-{% set git_revision_count=environ.get('GIT_DESCRIBE_NUMBER', 0) %}
{% set cuda_version='.'.join(environ.get('CUDA', '9.2').split('.')[:2]) %}
package:
name: libcugraph
version: {{ version }}
source:
- path: ../../..
+ git_url: ../../..
build:
- number: {{ git_revision_count }}
- string: cuda{{ cuda_version }}_{{ git_revision_count }}
+ number: {{ GIT_DESCRIBE_NUMBER }}
+ string: cuda{{ cuda_version }}_{{ GIT_DESCRIBE_HASH }}_{{ GIT_DESCRIBE_NUMBER }}
script_env:
- CC
- CXX
diff --git a/conda_build.sh b/conda_build.sh
index 14e3fae1e1f..4643e302f5c 100755
--- a/conda_build.sh
+++ b/conda_build.sh
@@ -8,7 +8,7 @@ conda build -c nvidia -c rapidsai -c rapidsai-nightly/label/cuda${CUDA_REL} -c c
if [ "$UPLOAD_PACKAGE" == '1' ]; then
export UPLOADFILE=`conda build -c nvidia -c rapidsai -c conda-forge -c defaults --python=${PYTHON} conda/recipes/cugraph --output`
- SOURCE_BRANCH=master
+ SOURCE_BRANCH=main
test -e ${UPLOADFILE}
diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt
index d948b27a939..70d7edf99a3 100644
--- a/cpp/CMakeLists.txt
+++ b/cpp/CMakeLists.txt
@@ -1,6 +1,5 @@
#=============================================================================
-# Copyright 2018 BlazingDB, Inc.
-# Copyright 2018 Percy Camilo Triveño Aucahuasi
+# Copyright (c) 2018-2020, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -17,7 +16,7 @@
cmake_minimum_required(VERSION 3.12 FATAL_ERROR)
-project(CUGRAPH VERSION 0.14.0 LANGUAGES C CXX CUDA)
+project(CUGRAPH VERSION 0.15.0 LANGUAGES C CXX CUDA)
###################################################################################################
# - build type ------------------------------------------------------------------------------------
@@ -104,13 +103,6 @@ set(CMAKE_EXE_LINKER_FLAGS "-Wl,--disable-new-dtags")
option(BUILD_TESTS "Configure CMake to build tests"
ON)
-option(BUILD_MPI "Build with MPI" OFF)
-if (BUILD_MPI)
- find_package(MPI REQUIRED)
- set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${MPI_C_COMPILE_FLAGS}")
- set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${MPI_CXX_COMPILE_FLAGS}")
- set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${MPI_CXX_LINK_FLAGS}")
-endif(BUILD_MPI)
###################################################################################################
# - cmake modules ---------------------------------------------------------------------------------
@@ -194,24 +186,52 @@ if (RMM_INCLUDE AND RMM_LIBRARY)
endif (RMM_INCLUDE AND RMM_LIBRARY)
###################################################################################################
-# - External Projects -----------------------------------------------------------------------------
-
-# https://cmake.org/cmake/help/v3.0/module/ExternalProject.html
-include(ExternalProject)
+# - Fetch Content -----------------------------------------------------------------------------
+include(FetchContent)
# - CUB
-set(CUB_DIR ${CMAKE_CURRENT_BINARY_DIR}/cub CACHE STRING "Path to cub repo")
-set(CUB_INCLUDE_DIR ${CUB_DIR}/src/cub CACHE STRING "Path to cub includes")
+message("Fetching CUB")
-ExternalProject_Add(cub
- GIT_REPOSITORY https://github.com/NVlabs/cub.git
- GIT_TAG v1.8.0
- PREFIX ${CUB_DIR}
- CONFIGURE_COMMAND ""
- BUILD_COMMAND ""
- INSTALL_COMMAND ""
+FetchContent_Declare(
+ cub
+ GIT_REPOSITORY https://github.com/thrust/cub.git
+ GIT_TAG 1.9.10
+ GIT_SHALLOW true
)
+FetchContent_GetProperties(cub)
+if(NOT cub_POPULATED)
+ FetchContent_Populate(cub)
+ # We are not using the cub CMake targets, so no need to call `add_subdirectory()`.
+endif()
+set(CUB_INCLUDE_DIR "${cub_SOURCE_DIR}")
+
+# - THRUST
+message("Fetching Thrust")
+
+FetchContent_Declare(
+ thrust
+ GIT_REPOSITORY https://github.com/thrust/thrust.git
+ GIT_TAG 1.9.10
+ GIT_SHALLOW true
+)
+
+FetchContent_GetProperties(thrust)
+if(NOT thrust_POPULATED)
+ FetchContent_Populate(thrust)
+ # We are not using the thrust CMake targets, so no need to call `add_subdirectory()`.
+endif()
+set(THRUST_INCLUDE_DIR "${thrust_SOURCE_DIR}")
+
+
+
+
+###################################################################################################
+# - External Projects -----------------------------------------------------------------------------
+
+# https://cmake.org/cmake/help/v3.0/module/ExternalProject.html
+include(ExternalProject)
+
# - CUHORNET
set(CUHORNET_DIR ${CMAKE_CURRENT_BINARY_DIR}/cuhornet CACHE STRING "Path to cuhornet repo")
set(CUHORNET_INCLUDE_DIR ${CUHORNET_DIR}/src/cuhornet CACHE STRING "Path to cuhornet includes")
@@ -219,7 +239,7 @@ set(CUHORNET_INCLUDE_DIR ${CUHORNET_DIR}/src/cuhornet CACHE STRING "Path to cuho
ExternalProject_Add(cuhornet
GIT_REPOSITORY https://github.com/rapidsai/cuhornet.git
- GIT_TAG master
+ GIT_TAG main
PREFIX ${CUHORNET_DIR}
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
@@ -232,12 +252,18 @@ set(CUGUNROCK_DIR ${CMAKE_CURRENT_BINARY_DIR}/cugunrock CACHE STRING
ExternalProject_Add(cugunrock
GIT_REPOSITORY https://github.com/rapidsai/cugunrock.git
- GIT_TAG fea_full_bc # provide a branch, a tag, or even a commit hash
+ GIT_TAG main
PREFIX ${CUGUNROCK_DIR}
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=
-DGPU_ARCHS=""
-DGUNROCK_BUILD_SHARED_LIBS=OFF
-DGUNROCK_BUILD_TESTS=OFF
+ -DCUDA_AUTODETECT_GENCODE=FALSE
+ -DGUNROCK_GENCODE_SM60=TRUE
+ -DGUNROCK_GENCODE_SM61=TRUE
+ -DGUNROCK_GENCODE_SM70=TRUE
+ -DGUNROCK_GENCODE_SM72=TRUE
+ -DGUNROCK_GENCODE_SM75=TRUE
BUILD_BYPRODUCTS ${CUGUNROCK_DIR}/lib/libgunrock.a
)
@@ -263,7 +289,7 @@ endif(NOT NCCL_PATH)
if(DEFINED ENV{RAFT_PATH})
message(STATUS "RAFT_PATH environment variable detected.")
message(STATUS "RAFT_DIR set to $ENV{RAFT_PATH}")
- set(RAFT_DIR ENV{RAFT_PATH})
+ set(RAFT_DIR "$ENV{RAFT_PATH}")
ExternalProject_Add(raft
DOWNLOAD_COMMAND ""
@@ -278,14 +304,14 @@ else(DEFINED ENV{RAFT_PATH})
ExternalProject_Add(raft
GIT_REPOSITORY https://github.com/rapidsai/raft.git
- GIT_TAG e003de27fc4e4a096337f184dddbd7942a68bb5c
+ GIT_TAG 099e2b874b05555a78bed1666fa2d22f784e56a7
PREFIX ${RAFT_DIR}
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND "")
# Redefining RAFT_DIR so it coincides with the one inferred by env variable.
- set(RAFT_DIR ${RAFT_DIR}/src/raft/ CACHE STRING "Path to RAFT repo")
+ set(RAFT_DIR "${RAFT_DIR}/src/raft/")
endif(DEFINED ENV{RAFT_PATH})
@@ -301,13 +327,14 @@ link_directories(
"${CMAKE_CUDA_IMPLICIT_LINK_DIRECTORIES}")
add_library(cugraph SHARED
- src/comms/mpi/comms_mpi.cpp
src/db/db_object.cu
src/db/db_parser_integration_test.cu
src/db/db_operators.cu
- src/utilities/cusparse_helper.cu
+ src/utilities/spmv_1D.cu
src/structure/graph.cu
src/link_analysis/pagerank.cu
+ src/link_analysis/pagerank_1D.cu
+ src/link_analysis/gunrock_hits.cpp
src/traversal/bfs.cu
src/traversal/sssp.cu
src/link_prediction/jaccard.cu
@@ -318,25 +345,17 @@ add_library(cugraph SHARED
src/community/spectral_clustering.cu
src/community/louvain.cpp
src/community/louvain_kernels.cu
+ src/community/leiden.cpp
+ src/community/leiden_kernels.cu
src/community/ktruss.cu
src/community/ECG.cu
src/community/triangles_counting.cu
src/community/extract_subgraph_by_vertex.cu
src/cores/core_number.cu
src/traversal/two_hop_neighbors.cu
- src/utilities/cusparse_helper.cu
src/components/connectivity.cu
src/centrality/katz_centrality.cu
src/centrality/betweenness_centrality.cu
- src/nvgraph/kmeans.cu
- src/nvgraph/lanczos.cu
- src/nvgraph/spectral_matrix.cu
- src/nvgraph/modularity_maximization.cu
- src/nvgraph/nvgraph_cusparse.cpp
- src/nvgraph/nvgraph_cublas.cpp
- src/nvgraph/nvgraph_lapack.cu
- src/nvgraph/nvgraph_vector_kernels.cu
- src/nvgraph/partition.cu
)
#
@@ -346,20 +365,17 @@ add_library(cugraph SHARED
add_dependencies(cugraph cugunrock)
add_dependencies(cugraph raft)
-if (BUILD_MPI)
- add_compile_definitions(ENABLE_OPG=1)
-endif (BUILD_MPI)
-
###################################################################################################
# - include paths ---------------------------------------------------------------------------------
target_include_directories(cugraph
PRIVATE
+ "${CUB_INCLUDE_DIR}"
+ "${THRUST_INCLUDE_DIR}"
"${CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES}"
"${LIBCYPHERPARSER_INCLUDE}"
"${Boost_INCLUDE_DIRS}"
"${RMM_INCLUDE}"
"${CMAKE_CURRENT_SOURCE_DIR}/../thirdparty"
- "${CUB_INCLUDE_DIR}"
"${CUHORNET_INCLUDE_DIR}/hornet/include"
"${CUHORNET_INCLUDE_DIR}/hornetsnest/include"
"${CUHORNET_INCLUDE_DIR}/xlib/include"
@@ -367,7 +383,6 @@ target_include_directories(cugraph
"${CMAKE_CURRENT_SOURCE_DIR}/src"
"${CUGUNROCK_DIR}/include"
"${NCCL_INCLUDE_DIRS}"
- "${MPI_CXX_INCLUDE_PATH}"
"${RAFT_DIR}/cpp/include"
PUBLIC
"${CMAKE_CURRENT_SOURCE_DIR}/include"
@@ -377,7 +392,7 @@ target_include_directories(cugraph
# - link libraries --------------------------------------------------------------------------------
target_link_libraries(cugraph PRIVATE
- ${RMM_LIBRARY} gunrock ${NVSTRINGS_LIBRARY} cublas cusparse curand cusolver cudart cuda ${LIBCYPHERPARSER_LIBRARY} ${MPI_CXX_LIBRARIES} ${NCCL_LIBRARIES})
+ ${RMM_LIBRARY} gunrock cublas cusparse curand cusolver cudart cuda ${LIBCYPHERPARSER_LIBRARY} ${MPI_CXX_LIBRARIES} ${NCCL_LIBRARIES})
if(OpenMP_CXX_FOUND)
target_link_libraries(cugraph PRIVATE
diff --git a/cpp/cmake/Modules/FindNCCL.cmake b/cpp/cmake/Modules/FindNCCL.cmake
index 16ca4458a7f..0f673707444 100644
--- a/cpp/cmake/Modules/FindNCCL.cmake
+++ b/cpp/cmake/Modules/FindNCCL.cmake
@@ -1,4 +1,4 @@
-# Copyright (c) 2019, NVIDIA CORPORATION.
+# Copyright (c) 2019-2020, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/cpp/include/algorithms.hpp b/cpp/include/algorithms.hpp
index ece827475ee..5241043fe88 100644
--- a/cpp/include/algorithms.hpp
+++ b/cpp/include/algorithms.hpp
@@ -17,6 +17,7 @@
#include
#include
+#include
namespace cugraph {
@@ -28,6 +29,7 @@ namespace cugraph {
* when the tolerance descreases and/or alpha increases toward the limiting value of 1.
* The user is free to use default values or to provide inputs for the initial guess,
* tolerance and maximum number of iterations.
+
*
* @throws cugraph::logic_error with a custom message when an error
occurs.
@@ -38,7 +40,9 @@ namespace cugraph {
32-bit)
* @tparam WT Type of edge weights. Supported value : float or double.
*
- * @param[in] graph cuGRAPH graph descriptor, should contain the connectivity
+ * @param[in] handle Library handle (RAFT). If a communicator is set in the handle,
+ the multi GPU version will be selected.
+ * @param[in] graph cuGraph graph descriptor, should contain the connectivity
information as a transposed adjacency list (CSC). Edge weights are not used for this algorithm.
* @param[in] alpha The damping factor alpha represents the probability to follow
an outgoing edge, standard value is 0.85. Thus, 1.0-alpha is the probability to “teleport” to a
@@ -48,36 +52,38 @@ namespace cugraph {
* @param[in] pagerank Array of size V. Should contain the initial guess if
has_guess=true. In this case the initial guess cannot be the vector of 0s. Memory is provided and
owned by the caller.
- * @param[in] personalization_subset_size (optional) The number of vertices for to personalize.
- Initialized to 0 by default.
- * @param[in] personalization_subset (optional) Array of size personalization_subset_size containing
- vertices for running personalized pagerank. Initialized to nullptr by default. Memory is provided
- and owned by the caller.
- * @param[in] personalization_values (optional) Array of size personalization_subset_size containing
- values associated with personalization_subset vertices. Initialized to nullptr by default. Memory
- is provided and owned by the caller.
- * @param[in] tolerance Set the tolerance the approximation, this parameter should be a
- small magnitude value.
+ * @param[in] personalization_subset_size (optional) Supported on single-GPU, on the roadmap for
+ Multi-GPU. The number of vertices for to personalize. Initialized to 0 by default.
+ * @param[in] personalization_subset (optional) Supported on single-GPU, on the roadmap for
+ Multi-GPU..= Array of size personalization_subset_size containing vertices for running personalized
+ pagerank. Initialized to nullptr by default. Memory is provided and owned by the caller.
+ * @param[in] personalization_values (optional) Supported on single-GPU, on the roadmap for
+ Multi-GPU. Array of size personalization_subset_size containing values associated with
+ personalization_subset vertices. Initialized to nullptr by default. Memory is provided and owned by
+ the caller.
+ * @param[in] tolerance Supported on single-GPU. Set the tolerance the approximation,
+ this parameter should be a small magnitude value.
* The lower the tolerance the better the approximation. If this
- value is 0.0f, cuGRAPH will use the default value which is 1.0E-5.
+ value is 0.0f, cuGraph will use the default value which is 1.0E-5.
* Setting too small a tolerance can lead to non-convergence due
to numerical roundoff. Usually values between 0.01 and 0.00001 are acceptable.
* @param[in] max_iter (optional) The maximum number of iterations before an answer is
returned. This can be used to limit the execution time and do an early exit before the solver
reaches the convergence tolerance.
- * If this value is lower or equal to 0 cuGRAPH will use the
+ * If this value is lower or equal to 0 cuGraph will use the
default value, which is 500.
- * @param[in] has_guess (optional) This parameter is used to notify cuGRAPH if it
- should use a user-provided initial guess. False means the user does not have a guess, in this case
- cuGRAPH will use a uniform vector set to 1/V.
- * If the value is True, cuGRAPH will read the pagerank parameter
+ * @param[in] has_guess (optional) Supported on single-GPU. This parameter is used to
+ notify cuGraph if it should use a user-provided initial guess. False means the user does not have a
+ guess, in this case cuGraph will use a uniform vector set to 1/V.
+ * If the value is True, cuGraph will read the pagerank parameter
and use this as an initial guess.
* @param[out] *pagerank The PageRank : pagerank[i] is the PageRank of vertex i. Memory
remains provided and owned by the caller.
*
*/
template
-void pagerank(experimental::GraphCSCView const &graph,
+void pagerank(raft::handle_t const &handle,
+ GraphCSCView const &graph,
WT *pagerank,
VT personalization_subset_size = 0,
VT *personalization_subset = nullptr,
@@ -106,7 +112,7 @@ void pagerank(experimental::GraphCSCView const &graph,
* caller
*/
template
-void jaccard(experimental::GraphCSRView const &graph, WT const *weights, WT *result);
+void jaccard(GraphCSRView const &graph, WT const *weights, WT *result);
/**
* @brief Compute jaccard similarity coefficient for selected vertex pairs
@@ -130,7 +136,7 @@ void jaccard(experimental::GraphCSRView const &graph, WT const *weig
* caller
*/
template
-void jaccard_list(experimental::GraphCSRView const &graph,
+void jaccard_list(GraphCSRView const &graph,
WT const *weights,
ET num_pairs,
VT const *first,
@@ -156,7 +162,7 @@ void jaccard_list(experimental::GraphCSRView const &graph,
* caller
*/
template
-void overlap(experimental::GraphCSRView const &graph, WT const *weights, WT *result);
+void overlap(GraphCSRView const &graph, WT const *weights, WT *result);
/**
* @brief Compute overlap coefficient for select pairs of vertices
@@ -180,7 +186,7 @@ void overlap(experimental::GraphCSRView const &graph, WT const *weig
* caller
*/
template
-void overlap_list(experimental::GraphCSRView const &graph,
+void overlap_list(GraphCSRView const &graph,
WT const *weights,
ET num_pairs,
VT const *first,
@@ -203,7 +209,7 @@ void overlap_list(experimental::GraphCSRView const &graph,
* @tparam WT Type of edge weights. Supported values : float or
* double.
*
- * @param[in] graph cuGRAPH graph descriptor, should contain the
+ * @param[in] graph cuGraph graph descriptor, should contain the
* connectivity information as a COO. Graph is considered undirected. Edge weights are used for this
* algorithm and set to 1 by default.
* @param[out] pos Device array (2, n) containing x-axis and y-axis
@@ -241,7 +247,7 @@ void overlap_list(experimental::GraphCSRView const &graph,
*
*/
template
-void force_atlas2(experimental::GraphCOOView &graph,
+void force_atlas2(GraphCOOView &graph,
float *pos,
const int max_iter = 500,
float *x_start = nullptr,
@@ -267,39 +273,87 @@ void force_atlas2(experimental::GraphCOOView &graph,
*
* The current implementation does not support a weighted graph.
*
- * @throws cugraph::logic_error with a custom message when an error
- * occurs.
+ * @throws cugraph::logic_error if `result == nullptr` or
+ * `number_of_sources < 0` or `number_of_sources !=0 and sources == nullptr`.
+ * @tparam vertex_t Type of vertex identifiers. Supported value : int
+ * (signed, 32-bit)
+ * @tparam edge_t Type of edge identifiers. Supported value : int
+ * (signed, 32-bit)
+ * @tparam weight_t Type of edge weights. Supported values : float or
+ * double.
+ * @tparam result_t Type of computed result. Supported values : float or
+ * double
+ * @param[in] handle Library handle (RAFT). If a communicator is set in the
+ * handle, the multi GPU version will be selected.
+ * @param[in] graph cuGRAPH graph descriptor, should contain the
+ * connectivity information as a CSR
+ * @param[out] result Device array of centrality scores
+ * @param[in] normalized If true, return normalized scores, if false return
+ * unnormalized scores.
+ * @param[in] endpoints If true, include endpoints of paths in score, if false
+ * do not
+ * @param[in] weight If specified, device array of weights for each edge
+ * @param[in] k If specified, number of vertex samples defined in the
+ * vertices array.
+ * @param[in] vertices If specified, host array of vertex ids to estimate
+ * betweenness these vertices will serve as sources for the traversal
+ * algorihtm to obtain shortest path counters.
+ * @param[in] total_number_of_source_used If specified use this number to normalize results
+ * when using subsampling, it allows accumulation of results across multiple calls.
*
- * @tparam VT Type of vertex identifiers. Supported value : int (signed,
- * 32-bit)
- * @tparam ET Type of edge identifiers. Supported value : int (signed,
- * 32-bit)
- * @tparam WT Type of edge weights. Supported values : float or double.
- * @tparam result_t Type of computed result. Supported values : float or double
- * (double only supported in default implementation)
+ */
+template
+void betweenness_centrality(const raft::handle_t &handle,
+ GraphCSRView const &graph,
+ result_t *result,
+ bool normalized = true,
+ bool endpoints = false,
+ weight_t const *weight = nullptr,
+ vertex_t k = 0,
+ vertex_t const *vertices = nullptr);
+
+/**
+ * @brief Compute edge betweenness centrality for a graph
*
- * @param[in] graph cuGRAPH graph descriptor, should contain the connectivity
- * information as a CSR
- * @param[out] result Device array of centrality scores
- * @param[in] normalized If true, return normalized scores, if false return unnormalized
- * scores.
- * @param[in] endpoints If true, include endpoints of paths in score, if false do not
- * @param[in] weight If specified, device array of weights for each edge
- * @param[in] k If specified, number of vertex samples defined in the vertices
- * array.
- * @param[in] vertices If specified, host array of vertex ids to estimate betweenness
- * centrality, these vertices will serve as sources for the traversal algorihtm to obtain
- * shortest path counters.
+ * Betweenness centrality of an edge is the sum of the fraction of all-pairs shortest paths that
+ * pass through this edge. The weight parameter is currenlty not supported
+ *
+ * @throws cugraph::logic_error if `result == nullptr` or
+ * `number_of_sources < 0` or `number_of_sources !=0 and sources == nullptr` or `endpoints ==
+ * true`.
+ * @tparam vertex_t Type of vertex identifiers. Supported value : int
+ * (signed, 32-bit)
+ * @tparam edge_t Type of edge identifiers. Supported value : int
+ * (signed, 32-bit)
+ * @tparam weight_t Type of edge weights. Supported values : float or
+ * double.
+ * @tparam result_t Type of computed result. Supported values : float or
+ * double
+ * @param[in] handle Library handle (RAFT). If a communicator is set in the
+ * handle, the multi GPU version will be selected.
+ * @param[in] graph cuGraph graph descriptor, should contain the
+ * connectivity information as a CSR
+ * @param[out] result Device array of centrality scores
+ * @param[in] normalized If true, return normalized scores, if false return
+ * unnormalized scores.
+ * @param[in] weight If specified, device array of weights for each edge
+ * @param[in] k If specified, number of vertex samples defined in the
+ * vertices array.
+ * @param[in] vertices If specified, host array of vertex ids to estimate
+ * betweenness these vertices will serve as sources for the traversal
+ * algorihtm to obtain shortest path counters.
+ * @param[in] total_number_of_source_used If specified use this number to normalize results
+ * when using subsampling, it allows accumulation of results across multiple calls.
*
*/
-template
-void betweenness_centrality(experimental::GraphCSRView const &graph,
- result_t *result,
- bool normalized = true,
- bool endpoints = false,
- WT const *weight = nullptr,
- VT k = 0,
- VT const *vertices = nullptr);
+template
+void edge_betweenness_centrality(const raft::handle_t &handle,
+ GraphCSRView const &graph,
+ result_t *result,
+ bool normalized = true,
+ weight_t const *weight = nullptr,
+ vertex_t k = 0,
+ vertex_t const *vertices = nullptr);
enum class cugraph_cc_t {
CUGRAPH_WEAK = 0, ///> Weakly Connected Components
@@ -330,14 +384,14 @@ enum class cugraph_cc_t {
* @tparam ET Type of edge identifiers. Supported value : int (signed, 32-bit)
* @tparam WT Type of edge weights. Supported values : float or double.
*
- * @param[in] graph cuGRAPH graph descriptor, should contain the connectivity
+ * @param[in] graph cuGraph graph descriptor, should contain the connectivity
* information as a CSR
* @param[in] connectivity_type STRONG or WEAK
* @param[out] labels Device array of component labels (labels[i] indicates the label
* associated with vertex id i.
*/
template
-void connected_components(experimental::GraphCSRView const &graph,
+void connected_components(GraphCSRView const &graph,
cugraph_cc_t connectivity_type,
VT *labels);
@@ -358,7 +412,7 @@ void connected_components(experimental::GraphCSRView const &graph,
* 32-bit)
* @tparam WT Type of edge weights. Supported values : float or double.
*
- * @param[in] graph cuGRAPH graph descriptor, should contain the connectivity
+ * @param[in] graph cuGraph graph descriptor, should contain the connectivity
* information as a COO
* @param[in] k The order of the truss
* @param[in] mr Memory resource used to allocate the returned graph
@@ -366,8 +420,8 @@ void connected_components(experimental::GraphCSRView const &graph,
*
*/
template
-std::unique_ptr> k_truss_subgraph(
- experimental::GraphCOOView const &graph,
+std::unique_ptr> k_truss_subgraph(
+ GraphCOOView const &graph,
int k,
rmm::mr::device_memory_resource *mr = rmm::mr::get_default_resource());
@@ -384,7 +438,7 @@ std::unique_ptr> k_truss_subgraph(
* @tparam WT Type of edge weights. Supported values : float or double.
* @tparam result_t Type of computed result. Supported values : float
*
- * @param[in] graph cuGRAPH graph descriptor, should contain the connectivity
+ * @param[in] graph cuGraph graph descriptor, should contain the connectivity
* information as a CSR
* @param[out] result Device array of centrality scores
* @param[in] alpha Attenuation factor with a default value of 0.1. Alpha is set to
@@ -404,7 +458,7 @@ std::unique_ptr> k_truss_subgraph(
* @param[in] normalized If True normalize the resulting katz centrality values
*/
template
-void katz_centrality(experimental::GraphCSRView const &graph,
+void katz_centrality(GraphCSRView const &graph,
result_t *result,
double alpha,
int max_iter,
@@ -415,14 +469,14 @@ void katz_centrality(experimental::GraphCSRView const &graph,
/**
* @brief Compute the Core Number for the nodes of the graph G
*
- * @param[in] graph cuGRAPH graph descriptor with a valid edgeList or adjList
+ * @param[in] graph cuGraph graph descriptor with a valid edgeList or adjList
* @param[out] core_number Populated by the core number of every vertex in the graph
*
* @throws cugraph::logic_error when an error occurs.
*/
/* ----------------------------------------------------------------------------*/
template
-void core_number(experimental::GraphCSRView const &graph, VT *core_number);
+void core_number(GraphCSRView const &graph, VT *core_number);
/**
* @brief Compute K Core of the graph G
@@ -435,7 +489,7 @@ void core_number(experimental::GraphCSRView const &graph, VT *core_n
* 32-bit)
* @tparam WT Type of edge weights. Supported values : float or double.
*
- * @param[in] graph cuGRAPH graph in coordinate format
+ * @param[in] graph cuGraph graph in coordinate format
* @param[in] k Order of the core. This value must not be negative.
* @param[in] vertex_id User specified vertex identifiers for which core number values
* are supplied
@@ -446,8 +500,8 @@ void core_number(experimental::GraphCSRView const &graph, VT *core_n
* @param[out] out_graph Unique pointer to K Core subgraph in COO format
*/
template
-std::unique_ptr> k_core(
- experimental::GraphCOOView const &graph,
+std::unique_ptr> k_core(
+ GraphCOOView const &graph,
int k,
VT const *vertex_id,
VT const *core_number,
@@ -472,8 +526,7 @@ std::unique_ptr> k_core(
* @return Graph in COO format
*/
template
-std::unique_ptr> get_two_hop_neighbors(
- experimental::GraphCSRView const &graph);
+std::unique_ptr> get_two_hop_neighbors(GraphCSRView const &graph);
/**
* @Synopsis Performs a single source shortest path traversal of a graph starting from a vertex.
@@ -486,7 +539,7 @@ std::unique_ptr> get_two_hop_neighbo
* 32-bit)
* @tparam WT Type of edge weights. Supported values : float or double.
*
- * @param[in] graph cuGRAPH graph descriptor, should contain the connectivity
+ * @param[in] graph cuGraph graph descriptor, should contain the connectivity
* information as a CSR
*
* @param[out] distances If set to a valid pointer, array of size V populated by distance
@@ -500,7 +553,7 @@ std::unique_ptr> get_two_hop_neighbo
*
*/
template
-void sssp(experimental::GraphCSRView const &graph,
+void sssp(GraphCSRView const &graph,
WT *distances,
VT *predecessors,
const VT source_vertex);
@@ -519,7 +572,9 @@ void sssp(experimental::GraphCSRView const &graph,
* 32-bit)
* @tparam WT Type of edge weights. Supported values : int (signed, 32-bit)
*
- * @param[in] graph cuGRAPH graph descriptor, should contain the connectivity
+ * @param[in] handle Library handle (RAFT). If a communicator is set in the handle,
+ the multi GPU version will be selected.
+ * @param[in] graph cuGraph graph descriptor, should contain the connectivity
* information as a CSR
*
* @param[out] distances If set to a valid pointer, this is populated by distance of
@@ -535,41 +590,96 @@ void sssp(experimental::GraphCSRView const &graph,
*
* @param[in] directed Treat the input graph as directed
*
- * @throws cugraph::logic_error when an error occurs.
+ * @param[in] mg_batch If set to true use SG BFS path when comms are initialized.
+ *
*/
template
-void bfs(experimental::GraphCSRView const &graph,
+void bfs(raft::handle_t const &handle,
+ GraphCSRView const &graph,
VT *distances,
VT *predecessors,
double *sp_counters,
const VT start_vertex,
- bool directed = true);
+ bool directed = true,
+ bool mg_batch = false);
/**
* @brief Louvain implementation
*
- * Compute a clustering of the graph by minimizing modularity
+ * Compute a clustering of the graph by maximizing modularity
+ *
+ * Computed using the Louvain method described in:
+ *
+ * VD Blondel, J-L Guillaume, R Lambiotte and E Lefebvre: Fast unfolding of
+ * community hierarchies in large networks, J Stat Mech P10008 (2008),
+ * http://arxiv.org/abs/0803.0476
*
* @throws cugraph::logic_error when an error occurs.
*
- * @tparam VT Type of vertex identifiers.
+ * @tparam vertex_t Type of vertex identifiers.
* Supported value : int (signed, 32-bit)
- * @tparam ET Type of edge identifiers.
+ * @tparam edge_t Type of edge identifiers.
* Supported value : int (signed, 32-bit)
- * @tparam WT Type of edge weights. Supported values : float or double.
+ * @tparam weight_t Type of edge weights. Supported values : float or double.
*
* @param[in] graph input graph object (CSR)
* @param[out] final_modularity modularity of the returned clustering
* @param[out] num_level number of levels of the returned clustering
* @param[out] clustering Pointer to device array where the clustering should be stored
* @param[in] max_iter (optional) maximum number of iterations to run (default 100)
+ * @param[in] resolution (optional) The value of the resolution parameter to use.
+ * Called gamma in the modularity formula, this changes the size
+ * of the communities. Higher resolutions lead to more smaller
+ * communities, lower resolutions lead to fewer larger
+ * communities. (default 1)
+ *
*/
-template
-void louvain(experimental::GraphCSRView const &graph,
- WT *final_modularity,
+template
+void louvain(GraphCSRView const &graph,
+ weight_t *final_modularity,
int *num_level,
- VT *louvain_parts,
- int max_iter = 100);
+ vertex_t *louvain_parts,
+ int max_iter = 100,
+ weight_t resolution = weight_t{1});
+
+/**
+ * @brief Leiden implementation
+ *
+ * Compute a clustering of the graph by maximizing modularity using the Leiden improvements
+ * to the Louvain method.
+ *
+ * Computed using the Leiden method described in:
+ *
+ * Traag, V. A., Waltman, L., & van Eck, N. J. (2019). From Louvain to Leiden:
+ * guaranteeing well-connected communities. Scientific reports, 9(1), 5233.
+ * doi: 10.1038/s41598-019-41695-z
+ *
+ * @throws cugraph::logic_error when an error occurs.
+ *
+ * @tparam vertex_t Type of vertex identifiers.
+ * Supported value : int (signed, 32-bit)
+ * @tparam edge_t Type of edge identifiers.
+ * Supported value : int (signed, 32-bit)
+ * @tparam weight_t Type of edge weights. Supported values : float or double.
+ *
+ * @param[in] graph input graph object (CSR)
+ * @param[out] final_modularity modularity of the returned clustering
+ * @param[out] num_level number of levels of the returned clustering
+ * @param[out] clustering Pointer to device array where the clustering should be stored
+ * @param[in] max_iter (optional) maximum number of iterations to run (default 100)
+ * @param[in] resolution (optional) The value of the resolution parameter to use.
+ * Called gamma in the modularity formula, this changes the size
+ * of the communities. Higher resolutions lead to more smaller
+ * communities, lower resolutions lead to fewer larger
+ * communities. (default 1)
+ */
+template
+void leiden(GraphCSRView const &graph,
+ weight_t &final_modularity,
+ int &num_level,
+ vertex_t *leiden_parts,
+ int max_iter = 100,
+ weight_t resolution = weight_t{1});
/**
* @brief Computes the ecg clustering of the given graph.
@@ -596,12 +706,9 @@ void louvain(experimental::GraphCSRView const &graph,
* written
*/
template
-void ecg(experimental::GraphCSRView const &graph_csr,
- WT min_weight,
- VT ensemble_size,
- VT *ecg_parts);
+void ecg(GraphCSRView const &graph_csr, WT min_weight, VT ensemble_size, VT *ecg_parts);
-namespace nvgraph {
+namespace triangle {
/**
* @brief Count the number of triangles in the graph
@@ -619,8 +726,10 @@ namespace nvgraph {
* @return The number of triangles
*/
template
-uint64_t triangle_count(experimental::GraphCSRView const &graph);
+uint64_t triangle_count(GraphCSRView const &graph);
+} // namespace triangle
+namespace subgraph {
/**
* @brief Extract subgraph by vertices
*
@@ -642,8 +751,9 @@ uint64_t triangle_count(experimental::GraphCSRView const &graph);
* @param[out] result a graph in COO format containing the edges in the subgraph
*/
template
-std::unique_ptr> extract_subgraph_vertex(
- experimental::GraphCOOView const &graph, VT const *vertices, VT num_vertices);
+std::unique_ptr> extract_subgraph_vertex(GraphCOOView const &graph,
+ VT const *vertices,
+ VT num_vertices);
/**
* @brief Wrapper function for Nvgraph balanced cut clustering
@@ -663,11 +773,14 @@ std::unique_ptr> extract_subgraph_vertex(
* @param[in] evs_max_iter The maximum number of iterations of the eigenvalue solver
* @param[in] kmean_tolerance The tolerance to use for the kmeans solver
* @param[in] kmean_max_iter The maximum number of iteration of the k-means solver
- * @param[out] clustering Pointer to device memory where the resulting clustering will be
- * stored
+ * @param[out] clustering Pointer to device memory where the resulting clustering will
+ * be stored
*/
+} // namespace subgraph
+
+namespace ext_raft {
template
-void balancedCutClustering(experimental::GraphCSRView const &graph,
+void balancedCutClustering(GraphCSRView const &graph,
VT num_clusters,
VT num_eigen_vects,
WT evs_tolerance,
@@ -694,11 +807,11 @@ void balancedCutClustering(experimental::GraphCSRView const &graph,
* @param[in] evs_max_iter The maximum number of iterations of the eigenvalue solver
* @param[in] kmean_tolerance The tolerance to use for the kmeans solver
* @param[in] kmean_max_iter The maximum number of iteration of the k-means solver
- * @param[out] clustering Pointer to device memory where the resulting clustering will be
- * stored
+ * @param[out] clustering Pointer to device memory where the resulting clustering will
+ * be stored
*/
template
-void spectralModularityMaximization(experimental::GraphCSRView const &graph,
+void spectralModularityMaximization(GraphCSRView const &graph,
VT n_clusters,
VT n_eig_vects,
WT evs_tolerance,
@@ -724,7 +837,7 @@ void spectralModularityMaximization(experimental::GraphCSRView const
* @param[out] score Pointer to a float in which the result will be written
*/
template
-void analyzeClustering_modularity(experimental::GraphCSRView const &graph,
+void analyzeClustering_modularity(GraphCSRView const &graph,
int n_clusters,
VT const *clustering,
WT *score);
@@ -746,7 +859,7 @@ void analyzeClustering_modularity(experimental::GraphCSRView const &
* @param[out] score Pointer to a float in which the result will be written
*/
template
-void analyzeClustering_edge_cut(experimental::GraphCSRView const &graph,
+void analyzeClustering_edge_cut(GraphCSRView const &graph,
int n_clusters,
VT const *clustering,
WT *score);
@@ -768,10 +881,50 @@ void analyzeClustering_edge_cut(experimental::GraphCSRView const &gr
* @param[out] score Pointer to a float in which the result will be written
*/
template
-void analyzeClustering_ratio_cut(experimental::GraphCSRView const &graph,
+void analyzeClustering_ratio_cut(GraphCSRView const &graph,
int n_clusters,
VT const *clustering,
WT *score);
-} // namespace nvgraph
+} // namespace ext_raft
+
+namespace gunrock {
+/**
+ * @brief Compute the HITS vertex values for a graph
+ *
+ * cuGraph uses the gunrock implementation of HITS
+ *
+ * @throws cugraph::logic_error on an error
+ *
+ * @tparam VT Type of vertex identifiers.
+ * Supported value : int (signed, 32-bit)
+ * @tparam ET Type of edge identifiers.
+ * Supported value : int (signed, 32-bit)
+ * @tparam WT Type of edge weights.
+ * Supported value : float
+ *
+ * @param[in] graph input graph object (CSR). Edge weights are not used
+ * for this algorithm.
+ * @param[in] max_iter Maximum number of iterations to run
+ * @param[in] tolerance Currently ignored. gunrock implementation runs
+ * the specified number of iterations and stops
+ * @param[in] starting value Currently ignored. gunrock does not support.
+ * @param[in] normalized Currently ignored, gunrock computes this as true
+ * @param[out] *hubs Device memory pointing to the node value based
+ * on outgoing links
+ * @param[out] *authorities Device memory pointing to the node value based
+ * on incoming links
+ *
+ */
+template
+void hits(GraphCSRView const &graph,
+ int max_iter,
+ WT tolerance,
+ WT const *starting_value,
+ bool normalized,
+ WT *hubs,
+ WT *authorities);
+
+} // namespace gunrock
+
} // namespace cugraph
diff --git a/cpp/include/comms_mpi.hpp b/cpp/include/comms_mpi.hpp
deleted file mode 100644
index 7a17bdfea4c..00000000000
--- a/cpp/include/comms_mpi.hpp
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright (c) 2020, 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.
- */
-
-#pragma once
-#if ENABLE_OPG
-#include
-#include
-#endif
-#include
-namespace cugraph {
-namespace experimental {
-
-enum class ReduceOp { SUM, MAX, MIN };
-
-// basic info about the snmg env setup
-class Comm {
- private:
- int _p{0};
- int _rank{0};
- bool _finalize_mpi{false};
- bool _finalize_nccl{false};
-
- int _device_id{0};
- int _device_count{0};
-
- int _sm_count_per_device{0};
- int _max_grid_dim_1D{0};
- int _max_block_dim_1D{0};
- int _l2_cache_size{0};
- int _shared_memory_size_per_sm{0};
-
-#if ENABLE_OPG
- MPI_Comm _mpi_comm{};
- ncclComm_t _nccl_comm{};
-#endif
-
- public:
- Comm(){};
- Comm(int p);
-#if ENABLE_OPG
- Comm(ncclComm_t comm, int size, int rank);
-#endif
- ~Comm();
- int get_rank() const { return _rank; }
- int get_p() const { return _p; }
- int get_dev() const { return _device_id; }
- int get_dev_count() const { return _device_count; }
- int get_sm_count() const { return _sm_count_per_device; }
- bool is_master() const { return (_rank == 0) ? true : false; }
-
- void barrier();
-
- template
- void allgather(size_t size, value_t *sendbuff, value_t *recvbuff) const;
-
- template
- void allreduce(size_t size, value_t *sendbuff, value_t *recvbuff, ReduceOp reduce_op) const;
-};
-
-} // namespace experimental
-} // namespace cugraph
diff --git a/cpp/include/functions.hpp b/cpp/include/functions.hpp
index db737a4f5a4..1e88acb54b7 100644
--- a/cpp/include/functions.hpp
+++ b/cpp/include/functions.hpp
@@ -15,70 +15,13 @@
*/
#pragma once
+#include
#include
#include
namespace cugraph {
-/**
- * @brief Convert COO to CSR, unweighted
- *
- * Takes a list of edges in COOrdinate format and generates a CSR format.
- * Note, if you want CSC format simply pass the src and dst arrays
- * in the opposite order.
- *
- * @throws cugraph::logic_error when an error occurs.
- *
- * @tparam vertex_t type of vertex index
- * @tparam edge_t type of edge index
- *
- * @param[in] num_edges Number of edges
- * @param[in] src Device array containing original source vertices
- * @param[in] dst Device array containing original dest vertices
- * @param[out] offsets Device array containing the CSR offsets
- * @param[out] indices Device array containing the CSR indices
- *
- * @return Number of unique vertices in the src and dst arrays
- *
- */
-template
-vertex_t coo2csr(
- edge_t num_edges, vertex_t const *src, vertex_t const *dst, edge_t **offsets, vertex_t **indices);
-
-/**
- * @brief Convert COO to CSR, weighted
- *
- * Takes a list of edges in COOrdinate format and generates a CSR format.
- * Note, if you want CSC format simply pass the src and dst arrays
- * in the opposite order.
- *
- * @throws cugraph::logic_error when an error occurs.
- *
- * @tparam vertex_t type of vertex index
- * @tparam edge_t type of edge index
- * @tparam weight_t type of the edge weight
- *
- * @param[in] num_edges Number of edges
- * @param[in] src Device array containing original source vertices
- * @param[in] dst Device array containing original dest vertices
- * @param[in] weights Device array containing original edge weights
- * @param[out] offsets Device array containing the CSR offsets
- * @param[out] indices Device array containing the CSR indices
- * @param[out] csr_weights Device array containing the CSR edge weights
- *
- * @return Number of unique vertices in the src and dst arrays
- *
- */
-template
-vertex_t coo2csr_weighted(edge_t num_edges,
- vertex_t const *src,
- vertex_t const *dst,
- weight_t const *weights,
- edge_t **offsets,
- vertex_t **indices,
- weight_t **csr_weights);
-
/**
* @brief Convert COO to CSR
*
@@ -90,15 +33,15 @@ vertex_t coo2csr_weighted(edge_t num_edges,
* @tparam ET type of edge index
* @tparam WT type of the edge weight
*
- * @param[in] graph cuGRAPH graph in coordinate format
+ * @param[in] graph cuGraph graph in coordinate format
* @param[in] mr Memory resource used to allocate the returned graph
*
* @return Unique pointer to generate Compressed Sparse Row graph
*
*/
template
-std::unique_ptr> coo_to_csr(
- experimental::GraphCOOView const &graph,
+std::unique_ptr> coo_to_csr(
+ GraphCOOView const &graph,
rmm::mr::device_memory_resource *mr = rmm::mr::get_default_resource());
/**
@@ -135,4 +78,24 @@ std::unique_ptr renumber_vertices(
ET *map_size,
rmm::mr::device_memory_resource *mr = rmm::mr::get_default_resource());
+/**
+ * @brief Broadcast using handle communicator
+ *
+ * Use handle's communicator to operate broadcasting.
+ *
+ * @throws cugraph::logic_error when an error occurs.
+ *
+ * @tparam value_t Type of the data to broadcast
+ *
+ * @param[out] value Point to the data
+ * @param[in] count Number of elements to broadcast
+ *
+ */
+
+// FIXME: It would be better to expose it in RAFT
+template
+void comms_bcast(const raft::handle_t &handle, value_t *value, size_t count)
+{
+ handle.get_comms().bcast(value, count, 0, handle.get_stream());
+}
} // namespace cugraph
diff --git a/cpp/include/graph.hpp b/cpp/include/graph.hpp
index d7b1a2838ac..9d42b4acdd7 100644
--- a/cpp/include/graph.hpp
+++ b/cpp/include/graph.hpp
@@ -14,16 +14,15 @@
* limitations under the License.
*/
#pragma once
-#include
+#include
+#include
+#include
#include
#include
+#include
#include
-#include
-#include
-
namespace cugraph {
-namespace experimental {
enum class PropType { PROP_UNDEF, PROP_FALSE, PROP_TRUE };
@@ -47,107 +46,133 @@ enum class DegreeDirection {
/**
* @brief Base class graphs, all but vertices and edges
*
- * @tparam VT Type of vertex id
- * @tparam ET Type of edge id
- * @tparam WT Type of weight
+ * @tparam vertex_t Type of vertex id
+ * @tparam edge_t Type of edge id
+ * @tparam weight_t Type of weight
*/
-template
+template
class GraphViewBase {
public:
- WT *edge_data; ///< edge weight
- Comm comm;
+ raft::handle_t *handle;
+ weight_t *edge_data; ///< edge weight
GraphProperties prop;
- VT number_of_vertices;
- ET number_of_edges;
+ vertex_t number_of_vertices;
+ edge_t number_of_edges;
+
+ vertex_t *local_vertices;
+ edge_t *local_edges;
+ vertex_t *local_offsets;
/**
* @brief Fill the identifiers array with the vertex identifiers.
*
- * @param[out] identifier Pointer to device memory to store the vertex
+ * @param[out] identifiers Pointer to device memory to store the vertex
* identifiers
*/
- void get_vertex_identifiers(VT *identifiers) const;
- void set_communicator(Comm &comm_) { comm = comm_; }
+ void get_vertex_identifiers(vertex_t *identifiers) const;
+
+ void set_local_data(vertex_t *vertices, edge_t *edges, vertex_t *offsets)
+ {
+ local_vertices = vertices;
+ local_edges = edges;
+ local_offsets = offsets;
+ }
- GraphViewBase(WT *edge_data_, VT number_of_vertices_, ET number_of_edges_)
- : edge_data(edge_data_),
- comm(),
+ void set_handle(raft::handle_t *handle_in) { handle = handle_in; }
+
+ GraphViewBase(weight_t *edge_data, vertex_t number_of_vertices, edge_t number_of_edges)
+ : handle(nullptr),
+ edge_data(edge_data),
prop(),
- number_of_vertices(number_of_vertices_),
- number_of_edges(number_of_edges_)
+ number_of_vertices(number_of_vertices),
+ number_of_edges(number_of_edges),
+ local_vertices(nullptr),
+ local_edges(nullptr),
+ local_offsets(nullptr)
{
}
+
bool has_data(void) const { return edge_data != nullptr; }
};
/**
* @brief A graph stored in COO (COOrdinate) format.
*
- * @tparam VT Type of vertex id
- * @tparam ET Type of edge id
- * @tparam WT Type of weight
+ * @tparam vertex_t Type of vertex id
+ * @tparam edge_t Type of edge id
+ * @tparam weight_t Type of weight
*/
-template
-class GraphCOOView : public GraphViewBase {
+template
+class GraphCOOView : public GraphViewBase {
public:
- VT *src_indices{nullptr}; ///< rowInd
- VT *dst_indices{nullptr}; ///< colInd
+ vertex_t *src_indices{nullptr}; ///< rowInd
+ vertex_t *dst_indices{nullptr}; ///< colInd
/**
* @brief Computes degree(in, out, in+out) of all the nodes of a Graph
*
* @throws cugraph::logic_error when an error occurs.
*
- * @param[out] degree Device array of size V (V is number of vertices) initialized
+ * @param[out] degree Device array of size V (V is number of
+ * vertices) initialized
* to zeros. Will contain the computed degree of every vertex.
* @param[in] direction IN_PLUS_OUT, IN or OUT
*/
- void degree(ET *degree, DegreeDirection direction) const;
+ void degree(edge_t *degree, DegreeDirection direction) const;
/**
* @brief Default constructor
*/
- GraphCOOView() : GraphViewBase(nullptr, 0, 0) {}
+ GraphCOOView() : GraphViewBase(nullptr, 0, 0) {}
/**
* @brief Wrap existing arrays representing an edge list in a Graph.
*
- * GraphCOOView does not own the memory used to represent this graph. This
+ * GraphCOOView does not own the memory used to represent this
+ * graph. This
* function does not allocate memory.
*
- * @param source_indices This array of size E (number of edges) contains the index of the
+ * @param source_indices This array of size E (number of edges)
+ * contains the index of the
* source for each edge. Indices must be in the range [0, V-1].
- * @param destination_indices This array of size E (number of edges) contains the index of the
+ * @param destination_indices This array of size E (number of edges)
+ * contains the index of the
* destination for each edge. Indices must be in the range [0, V-1].
- * @param edge_data This array size E (number of edges) contains the weight for each
- * edge. This array can be null in which case the graph is considered unweighted.
+ * @param edge_data This array size E (number of edges) contains
+ * the weight for each
+ * edge. This array can be null in which case the graph is considered
+ * unweighted.
* @param number_of_vertices The number of vertices in the graph
* @param number_of_edges The number of edges in the graph
*/
- GraphCOOView(
- VT *src_indices_, VT *dst_indices_, WT *edge_data_, VT number_of_vertices_, ET number_of_edges_)
- : GraphViewBase(edge_data_, number_of_vertices_, number_of_edges_),
- src_indices(src_indices_),
- dst_indices(dst_indices_)
+ GraphCOOView(vertex_t *src_indices,
+ vertex_t *dst_indices,
+ weight_t *edge_data,
+ vertex_t number_of_vertices,
+ edge_t number_of_edges)
+ : GraphViewBase(edge_data, number_of_vertices, number_of_edges),
+ src_indices(src_indices),
+ dst_indices(dst_indices)
{
}
};
/**
- * @brief Base class for graph stored in CSR (Compressed Sparse Row) format or CSC (Compressed
+ * @brief Base class for graph stored in CSR (Compressed Sparse Row)
+ * format or CSC (Compressed
* Sparse Column) format
*
- * @tparam VT Type of vertex id
- * @tparam ET Type of edge id
- * @tparam WT Type of weight
+ * @tparam vertex_t Type of vertex id
+ * @tparam edge_t Type of edge id
+ * @tparam weight_t Type of weight
*/
-template
-class GraphCompressedSparseBaseView : public GraphViewBase {
+template
+class GraphCompressedSparseBaseView : public GraphViewBase {
public:
- ET *offsets{nullptr}; ///< CSR offsets
- VT *indices{nullptr}; ///< CSR indices
+ edge_t *offsets{nullptr}; ///< CSR offsets
+ vertex_t *indices{nullptr}; ///< CSR indices
/**
* @brief Fill the identifiers in the array with the source vertex
@@ -156,42 +181,53 @@ class GraphCompressedSparseBaseView : public GraphViewBase {
* @param[out] src_indices Pointer to device memory to store the
* source vertex identifiers
*/
- void get_source_indices(VT *src_indices) const;
+ void get_source_indices(vertex_t *src_indices) const;
/**
* @brief Computes degree(in, out, in+out) of all the nodes of a Graph
*
* @throws cugraph::logic_error when an error occurs.
*
- * @param[out] degree Device array of size V (V is number of vertices) initialized
+ * @param[out] degree Device array of size V (V is number of
+ * vertices) initialized
* to zeros. Will contain the computed degree of every vertex.
- * @param[in] x Integer value indicating type of degree calculation
+ * @param[in] direction Integer value indicating type of degree
+ * calculation
* 0 : in+out degree
* 1 : in-degree
* 2 : out-degree
*/
- void degree(ET *degree, DegreeDirection direction) const;
+ void degree(edge_t *degree, DegreeDirection direction) const;
/**
* @brief Wrap existing arrays representing adjacency lists in a Graph.
- * GraphCSRView does not own the memory used to represent this graph. This
+ * GraphCSRView does not own the memory used to represent this
+ * graph. This
* function does not allocate memory.
*
- * @param offsets This array of size V+1 (V is number of vertices) contains the
- * offset of adjacency lists of every vertex. Offsets must be in the range [0, E] (number of
+ * @param offsets This array of size V+1 (V is number of
+ * vertices) contains the
+ * offset of adjacency lists of every vertex. Offsets must be in the range [0,
+ * E] (number of
* edges).
- * @param indices This array of size E contains the index of the destination for
+ * @param indices This array of size E contains the index of
+ * the destination for
* each edge. Indices must be in the range [0, V-1].
- * @param edge_data This array of size E (number of edges) contains the weight for
- * each edge. This array can be null in which case the graph is considered unweighted.
+ * @param edge_data This array of size E (number of edges)
+ * contains the weight for
+ * each edge. This array can be null in which case the graph is considered
+ * unweighted.
* @param number_of_vertices The number of vertices in the graph
* @param number_of_edges The number of edges in the graph
*/
- GraphCompressedSparseBaseView(
- ET *offsets_, VT *indices_, WT *edge_data_, VT number_of_vertices_, ET number_of_edges_)
- : GraphViewBase(edge_data_, number_of_vertices_, number_of_edges_),
- offsets{offsets_},
- indices{indices_}
+ GraphCompressedSparseBaseView(edge_t *offsets,
+ vertex_t *indices,
+ weight_t *edge_data,
+ vertex_t number_of_vertices,
+ edge_t number_of_edges)
+ : GraphViewBase(edge_data, number_of_vertices, number_of_edges),
+ offsets{offsets},
+ indices{indices}
{
}
};
@@ -199,37 +235,49 @@ class GraphCompressedSparseBaseView : public GraphViewBase {
/**
* @brief A graph stored in CSR (Compressed Sparse Row) format.
*
- * @tparam VT Type of vertex id
- * @tparam ET Type of edge id
- * @tparam WT Type of weight
+ * @tparam vertex_t Type of vertex id
+ * @tparam edge_t Type of edge id
+ * @tparam weight_t Type of weight
*/
-template
-class GraphCSRView : public GraphCompressedSparseBaseView {
+template
+class GraphCSRView : public GraphCompressedSparseBaseView {
public:
/**
* @brief Default constructor
*/
- GraphCSRView() : GraphCompressedSparseBaseView(nullptr, nullptr, nullptr, 0, 0) {}
+ GraphCSRView()
+ : GraphCompressedSparseBaseView(nullptr, nullptr, nullptr, 0, 0)
+ {
+ }
/**
* @brief Wrap existing arrays representing adjacency lists in a Graph.
- * GraphCSRView does not own the memory used to represent this graph. This
+ * GraphCSRView does not own the memory used to represent this
+ * graph. This
* function does not allocate memory.
*
- * @param offsets This array of size V+1 (V is number of vertices) contains the
- * offset of adjacency lists of every vertex. Offsets must be in the range [0, E] (number of
+ * @param offsets This array of size V+1 (V is number of
+ * vertices) contains the
+ * offset of adjacency lists of every vertex. Offsets must be in the range [0,
+ * E] (number of
* edges).
- * @param indices This array of size E contains the index of the destination for
+ * @param indices This array of size E contains the index of
+ * the destination for
* each edge. Indices must be in the range [0, V-1].
- * @param edge_data This array of size E (number of edges) contains the weight for
- * each edge. This array can be null in which case the graph is considered unweighted.
+ * @param edge_data This array of size E (number of edges)
+ * contains the weight for
+ * each edge. This array can be null in which case the graph is considered
+ * unweighted.
* @param number_of_vertices The number of vertices in the graph
* @param number_of_edges The number of edges in the graph
*/
- GraphCSRView(
- ET *offsets_, VT *indices_, WT *edge_data_, VT number_of_vertices_, ET number_of_edges_)
- : GraphCompressedSparseBaseView(
- offsets_, indices_, edge_data_, number_of_vertices_, number_of_edges_)
+ GraphCSRView(edge_t *offsets,
+ vertex_t *indices,
+ weight_t *edge_data,
+ vertex_t number_of_vertices,
+ edge_t number_of_edges)
+ : GraphCompressedSparseBaseView(
+ offsets, indices, edge_data, number_of_vertices, number_of_edges)
{
}
};
@@ -237,57 +285,75 @@ class GraphCSRView : public GraphCompressedSparseBaseView {
/**
* @brief A graph stored in CSC (Compressed Sparse Column) format.
*
- * @tparam VT Type of vertex id
- * @tparam ET Type of edge id
- * @tparam WT Type of weight
+ * @tparam vertex_t Type of vertex id
+ * @tparam edge_t Type of edge id
+ * @tparam weight_t Type of weight
*/
-template
-class GraphCSCView : public GraphCompressedSparseBaseView {
+template
+class GraphCSCView : public GraphCompressedSparseBaseView {
public:
/**
* @brief Default constructor
*/
- GraphCSCView() : GraphCompressedSparseBaseView(nullptr, nullptr, nullptr, 0, 0) {}
+ GraphCSCView()
+ : GraphCompressedSparseBaseView(nullptr, nullptr, nullptr, 0, 0)
+ {
+ }
/**
- * @brief Wrap existing arrays representing transposed adjacency lists in a Graph.
- * GraphCSCView does not own the memory used to represent this graph. This
+ * @brief Wrap existing arrays representing transposed adjacency lists in
+ * a Graph.
+ * GraphCSCView does not own the memory used to represent this
+ * graph. This
* function does not allocate memory.
*
- * @param offsets This array of size V+1 (V is number of vertices) contains the
- * offset of adjacency lists of every vertex. Offsets must be in the range [0, E] (number of
+ * @param offsets This array of size V+1 (V is number of
+ * vertices) contains the
+ * offset of adjacency lists of every vertex. Offsets must be in the range [0,
+ * E] (number of
* edges).
- * @param indices This array of size E contains the index of the destination for
+ * @param indices This array of size E contains the index of
+ * the destination for
* each edge. Indices must be in the range [0, V-1].
- * @param edge_data This array of size E (number of edges) contains the weight for
- * each edge. This array can be null in which case the graph is considered unweighted.
+ * @param edge_data This array of size E (number of edges)
+ * contains the weight for
+ * each edge. This array can be null in which case the graph is considered
+ * unweighted.
* @param number_of_vertices The number of vertices in the graph
* @param number_of_edges The number of edges in the graph
*/
- GraphCSCView(
- ET *offsets_, VT *indices_, WT *edge_data_, VT number_of_vertices_, ET number_of_edges_)
- : GraphCompressedSparseBaseView(
- offsets_, indices_, edge_data_, number_of_vertices_, number_of_edges_)
+ GraphCSCView(edge_t *offsets,
+ vertex_t *indices,
+ weight_t *edge_data,
+ vertex_t number_of_vertices,
+ edge_t number_of_edges)
+ : GraphCompressedSparseBaseView(
+ offsets, indices, edge_data, number_of_vertices, number_of_edges)
{
}
};
/**
- * @brief TODO : Change this Take ownership of the provided graph arrays in COO format
+ * @brief TODO : Change this Take ownership of the provided graph arrays in
+ * COO format
*
- * @param source_indices This array of size E (number of edges) contains the index of the
+ * @param source_indices This array of size E (number of edges) contains
+ * the index of the
* source for each edge. Indices must be in the range [0, V-1].
- * @param destination_indices This array of size E (number of edges) contains the index of the
+ * @param destination_indices This array of size E (number of edges) contains
+ * the index of the
* destination for each edge. Indices must be in the range [0, V-1].
- * @param edge_data This array size E (number of edges) contains the weight for each
- * edge. This array can be null in which case the graph is considered unweighted.
+ * @param edge_data This array size E (number of edges) contains
+ * the weight for each
+ * edge. This array can be null in which case the graph is considered
+ * unweighted.
* @param number_of_vertices The number of vertices in the graph
* @param number_of_edges The number of edges in the graph
*/
-template
+template
struct GraphCOOContents {
- VT number_of_vertices;
- ET number_of_edges;
+ vertex_t number_of_vertices;
+ edge_t number_of_edges;
std::unique_ptr src_indices;
std::unique_ptr dst_indices;
std::unique_ptr edge_data;
@@ -298,278 +364,291 @@ struct GraphCOOContents {
*
* This class will src_indices and dst_indicies (until moved)
*
- * @tparam VT Type of vertex id
- * @tparam ET Type of edge id
- * @tparam WT Type of weight
+ * @tparam vertex_t Type of vertex id
+ * @tparam edge_t Type of edge id
+ * @tparam weight_t Type of weight
*/
-template
+template
class GraphCOO {
- VT number_of_vertices_;
- ET number_of_edges_;
- rmm::device_buffer src_indices_{}; ///< rowInd
- rmm::device_buffer dst_indices_{}; ///< colInd
- rmm::device_buffer edge_data_{}; ///< CSR data
+ vertex_t number_of_vertices_p;
+ edge_t number_of_edges_p;
+ rmm::device_buffer src_indices_p{}; ///< rowInd
+ rmm::device_buffer dst_indices_p{}; ///< colInd
+ rmm::device_buffer edge_data_p{}; ///< CSR data
public:
/**
* @brief Take ownership of the provided graph arrays in COO format
*
- * @param source_indices This array of size E (number of edges) contains the index of the
- * source for each edge. Indices must be in the range [0, V-1].
- * @param destination_indices This array of size E (number of edges) contains the index of the
- * destination for each edge. Indices must be in the range [0, V-1].
- * @param edge_data This array size E (number of edges) contains the weight for each
- * edge. This array can be null in which case the graph is considered unweighted.
* @param number_of_vertices The number of vertices in the graph
* @param number_of_edges The number of edges in the graph
+ * @param has_data Wiether or not the class has data, default = False
+ * @param stream Specify the cudaStream, default = null
+ * @param mr Specify the memory resource
*/
- GraphCOO(VT number_of_vertices,
- ET number_of_edges,
+ GraphCOO(vertex_t number_of_vertices,
+ edge_t number_of_edges,
bool has_data = false,
cudaStream_t stream = nullptr,
rmm::mr::device_memory_resource *mr = rmm::mr::get_default_resource())
- : number_of_vertices_(number_of_vertices),
- number_of_edges_(number_of_edges),
- src_indices_(sizeof(VT) * number_of_edges, stream, mr),
- dst_indices_(sizeof(VT) * number_of_edges, stream, mr),
- edge_data_((has_data ? sizeof(WT) * number_of_edges : 0), stream, mr)
+ : number_of_vertices_p(number_of_vertices),
+ number_of_edges_p(number_of_edges),
+ src_indices_p(sizeof(vertex_t) * number_of_edges, stream, mr),
+ dst_indices_p(sizeof(vertex_t) * number_of_edges, stream, mr),
+ edge_data_p((has_data ? sizeof(weight_t) * number_of_edges : 0), stream, mr)
{
}
- GraphCOO(GraphCOOView const &graph,
+ GraphCOO(GraphCOOView const &graph,
cudaStream_t stream = nullptr,
rmm::mr::device_memory_resource *mr = rmm::mr::get_default_resource())
- : number_of_vertices_(graph.number_of_vertices),
- number_of_edges_(graph.number_of_edges),
- src_indices_(graph.src_indices, graph.number_of_edges * sizeof(VT), stream, mr),
- dst_indices_(graph.dst_indices, graph.number_of_edges * sizeof(VT), stream, mr)
+ : number_of_vertices_p(graph.number_of_vertices),
+ number_of_edges_p(graph.number_of_edges),
+ src_indices_p(graph.src_indices, graph.number_of_edges * sizeof(vertex_t), stream, mr),
+ dst_indices_p(graph.dst_indices, graph.number_of_edges * sizeof(vertex_t), stream, mr)
{
if (graph.has_data()) {
- edge_data_ =
- rmm::device_buffer{graph.edge_data, graph.number_of_edges * sizeof(WT), stream, mr};
+ edge_data_p =
+ rmm::device_buffer{graph.edge_data, graph.number_of_edges * sizeof(weight_t), stream, mr};
}
}
- VT number_of_vertices(void) { return number_of_vertices_; }
- ET number_of_edges(void) { return number_of_edges_; }
- VT *src_indices(void) { return static_cast(src_indices_.data()); }
- VT *dst_indices(void) { return static_cast(dst_indices_.data()); }
- WT *edge_data(void) { return static_cast(edge_data_.data()); }
+ vertex_t number_of_vertices(void) { return number_of_vertices_p; }
+ edge_t number_of_edges(void) { return number_of_edges_p; }
+ vertex_t *src_indices(void) { return static_cast(src_indices_p.data()); }
+ vertex_t *dst_indices(void) { return static_cast(dst_indices_p.data()); }
+ weight_t *edge_data(void) { return static_cast(edge_data_p.data()); }
- GraphCOOContents release() noexcept
+ GraphCOOContents release() noexcept
{
- VT number_of_vertices = number_of_vertices_;
- ET number_of_edges = number_of_edges_;
- number_of_vertices_ = 0;
- number_of_edges_ = 0;
- return GraphCOOContents{
+ vertex_t number_of_vertices = number_of_vertices_p;
+ edge_t number_of_edges = number_of_edges_p;
+ number_of_vertices_p = 0;
+ number_of_edges_p = 0;
+ return GraphCOOContents{
number_of_vertices,
number_of_edges,
- std::make_unique(std::move(src_indices_)),
- std::make_unique(std::move(dst_indices_)),
- std::make_unique(std::move(edge_data_))};
+ std::make_unique(std::move(src_indices_p)),
+ std::make_unique(std::move(dst_indices_p)),
+ std::make_unique(std::move(edge_data_p))};
}
- GraphCOOView view(void) noexcept
+ GraphCOOView view(void) noexcept
{
- return GraphCOOView(
- src_indices(), dst_indices(), edge_data(), number_of_vertices_, number_of_edges_);
+ return GraphCOOView(
+ src_indices(), dst_indices(), edge_data(), number_of_vertices_p, number_of_edges_p);
}
- bool has_data(void) { return nullptr != edge_data_.data(); }
+ bool has_data(void) { return nullptr != edge_data_p.data(); }
};
-template
+template
struct GraphSparseContents {
- VT number_of_vertices;
- ET number_of_edges;
+ vertex_t number_of_vertices;
+ edge_t number_of_edges;
std::unique_ptr offsets;
std::unique_ptr indices;
std::unique_ptr edge_data;
};
/**
- * @brief Base class for constructted graphs stored in CSR (Compressed Sparse Row) format or
+ * @brief Base class for constructted graphs stored in CSR (Compressed
+ * Sparse Row) format or
* CSC (Compressed Sparse Column) format
*
- * @tparam VT Type of vertex id
- * @tparam ET Type of edge id
- * @tparam WT Type of weight
+ * @tparam vertex_t Type of vertex id
+ * @tparam edge_t Type of edge id
+ * @tparam weight_t Type of weight
*/
-template
+template
class GraphCompressedSparseBase {
- VT number_of_vertices_{0};
- ET number_of_edges_{0};
- rmm::device_buffer offsets_{}; ///< CSR offsets
- rmm::device_buffer indices_{}; ///< CSR indices
- rmm::device_buffer edge_data_{}; ///< CSR data
+ vertex_t number_of_vertices_p{0};
+ edge_t number_of_edges_p{0};
+ rmm::device_buffer offsets_p{}; ///< CSR offsets
+ rmm::device_buffer indices_p{}; ///< CSR indices
+ rmm::device_buffer edge_data_p{}; ///< CSR data
- bool has_data_{false};
+ bool has_data_p{false};
public:
/**
* @brief Take ownership of the provided graph arrays in CSR/CSC format
*
- * @param offsets This array of size V+1 (V is number of vertices) contains the
- * offset of adjacency lists of every vertex. Offsets must be in the range [0, E] (number of
- * edges).
- * @param indices This array of size E contains the index of the destination for
- * each edge. Indices must be in the range [0, V-1].
- * @param edge_data This array of size E (number of edges) contains the weight for
- * each edge. This array can be null in which case the graph is considered unweighted.
* @param number_of_vertices The number of vertices in the graph
* @param number_of_edges The number of edges in the graph
+ * @param has_data Wiether or not the class has data, default = False
+ * @param stream Specify the cudaStream, default = null
+ * @param mr Specify the memory resource
*/
- GraphCompressedSparseBase(VT number_of_vertices,
- ET number_of_edges,
+ GraphCompressedSparseBase(vertex_t number_of_vertices,
+ edge_t number_of_edges,
bool has_data,
cudaStream_t stream,
rmm::mr::device_memory_resource *mr)
- : number_of_vertices_(number_of_vertices),
- number_of_edges_(number_of_edges),
- offsets_(sizeof(ET) * (number_of_vertices + 1), stream, mr),
- indices_(sizeof(VT) * number_of_edges, stream, mr),
- edge_data_((has_data ? sizeof(WT) * number_of_edges : 0), stream, mr)
+ : number_of_vertices_p(number_of_vertices),
+ number_of_edges_p(number_of_edges),
+ offsets_p(sizeof(edge_t) * (number_of_vertices + 1), stream, mr),
+ indices_p(sizeof(vertex_t) * number_of_edges, stream, mr),
+ edge_data_p((has_data ? sizeof(weight_t) * number_of_edges : 0), stream, mr)
{
}
- GraphCompressedSparseBase(GraphSparseContents &&contents)
- : number_of_vertices_(contents.number_of_vertices),
- number_of_edges_(contents.number_of_edges),
- offsets_(std::move(*contents.offsets.release())),
- indices_(std::move(*contents.indices.release())),
- edge_data_(std::move(*contents.edge_data.release()))
+ GraphCompressedSparseBase(GraphSparseContents &&contents)
+ : number_of_vertices_p(contents.number_of_vertices),
+ number_of_edges_p(contents.number_of_edges),
+ offsets_p(std::move(*contents.offsets.release())),
+ indices_p(std::move(*contents.indices.release())),
+ edge_data_p(std::move(*contents.edge_data.release()))
{
}
- VT number_of_vertices(void) { return number_of_vertices_; }
- ET number_of_edges(void) { return number_of_edges_; }
- ET *offsets(void) { return static_cast(offsets_.data()); }
- VT *indices(void) { return static_cast(indices_.data()); }
- WT *edge_data(void) { return static_cast(edge_data_.data()); }
+ vertex_t number_of_vertices(void) { return number_of_vertices_p; }
+ edge_t number_of_edges(void) { return number_of_edges_p; }
+ edge_t *offsets(void) { return static_cast(offsets_p.data()); }
+ vertex_t *indices(void) { return static_cast(indices_p.data()); }
+ weight_t *edge_data(void) { return static_cast(edge_data_p.data()); }
- GraphSparseContents release() noexcept
+ GraphSparseContents release() noexcept
{
- VT number_of_vertices = number_of_vertices_;
- ET number_of_edges = number_of_edges_;
- number_of_vertices_ = 0;
- number_of_edges_ = 0;
- return GraphSparseContents{
+ vertex_t number_of_vertices = number_of_vertices_p;
+ edge_t number_of_edges = number_of_edges_p;
+ number_of_vertices_p = 0;
+ number_of_edges_p = 0;
+ return GraphSparseContents{
number_of_vertices,
number_of_edges,
- std::make_unique(std::move(offsets_)),
- std::make_unique(std::move(indices_)),
- std::make_unique(std::move(edge_data_))};
+ std::make_unique(std::move(offsets_p)),
+ std::make_unique(std::move(indices_p)),
+ std::make_unique(std::move(edge_data_p))};
}
- bool has_data(void) { return nullptr != edge_data_.data(); }
+ bool has_data(void) { return nullptr != edge_data_p.data(); }
};
/**
- * @brief A constructed graph stored in CSR (Compressed Sparse Row) format.
+ * @brief A constructed graph stored in CSR (Compressed Sparse Row)
+ * format.
*
- * @tparam VT Type of vertex id
- * @tparam ET Type of edge id
- * @tparam WT Type of weight
+ * @tparam vertex_t Type of vertex id
+ * @tparam edge_t Type of edge id
+ * @tparam weight_t Type of weight
*/
-template
-class GraphCSR : public GraphCompressedSparseBase {
+template
+class GraphCSR : public GraphCompressedSparseBase {
public:
/**
* @brief Default constructor
*/
- GraphCSR() : GraphCompressedSparseBase() {}
+ GraphCSR() : GraphCompressedSparseBase() {}
/**
* @brief Take ownership of the provided graph arrays in CSR format
*
- * @param offsets This array of size V+1 (V is number of vertices) contains the
- * offset of adjacency lists of every vertex. Offsets must be in the range [0, E] (number of
- * edges).
- * @param indices This array of size E contains the index of the destination for
- * each edge. Indices must be in the range [0, V-1].
- * @param edge_data This array of size E (number of edges) contains the weight for
- * each edge. This array can be null in which case the graph is considered unweighted.
* @param number_of_vertices The number of vertices in the graph
* @param number_of_edges The number of edges in the graph
+ * @param has_data Wiether or not the class has data, default = False
+ * @param stream Specify the cudaStream, default = null
+ * @param mr Specify the memory resource
*/
- GraphCSR(VT number_of_vertices_,
- ET number_of_edges_,
+ GraphCSR(vertex_t number_of_vertices_,
+ edge_t number_of_edges_,
bool has_data_ = false,
cudaStream_t stream = nullptr,
rmm::mr::device_memory_resource *mr = rmm::mr::get_default_resource())
- : GraphCompressedSparseBase(
+ : GraphCompressedSparseBase(
number_of_vertices_, number_of_edges_, has_data_, stream, mr)
{
}
- GraphCSR(GraphSparseContents &&contents)
- : GraphCompressedSparseBase(std::move(contents))
+ GraphCSR(GraphSparseContents