diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS
index d35c5c02218..ebffd18ca5a 100644
--- a/.github/CODEOWNERS
+++ b/.github/CODEOWNERS
@@ -1,3 +1,17 @@
+# https://docs.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners
+# Order matters - match of highest importance goes last (last match wins)
+
+#doc code owners
+datasets/ @rapidsai/cugraph-doc-codeowners
+notebooks/ @rapidsai/cugraph-doc-codeowners
+docs/ @rapidsai/cugraph-doc-codeowners
+**/*.txt @rapidsai/cugraph-doc-codeowners
+**/*.md @rapidsai/cugraph-doc-codeowners
+**/*.rst @rapidsai/cugraph-doc-codeowners
+**/*.ipynb @rapidsai/cugraph-doc-codeowners
+**/*.pdf @rapidsai/cugraph-doc-codeowners
+**/*.png @rapidsai/cugraph-doc-codeowners
+
#cpp code owners
cpp/ @rapidsai/cugraph-cpp-codeowners
@@ -9,7 +23,7 @@ python/ @rapidsai/cugraph-python-codeowners
**/cmake/ @rapidsai/cugraph-cmake-codeowners
#build/ops code owners
-.github/ @rapidsai/ops-codeowners
+.github/ @rapidsai/ops-codeowners
ci/ @rapidsai/ops-codeowners
conda/ @rapidsai/ops-codeowners
**/Dockerfile @rapidsai/ops-codeowners
diff --git a/.github/labeler.yml b/.github/labeler.yml
new file mode 100644
index 00000000000..9c3af6de64b
--- /dev/null
+++ b/.github/labeler.yml
@@ -0,0 +1,37 @@
+# https://github.com/actions/labeler#common-examples
+# Adapted from https://github.com/rapidsai/cugraph/blob/main/.github/CODEOWNERS
+# Labels culled from https://github.com/rapidsai/cugraph/labels
+
+python:
+ - 'python/**'
+ - 'notebooks/**'
+
+benchmarks:
+ - 'benchmarks/**'
+
+doc:
+ - 'docs/**'
+ - '**/*.md'
+ - 'datasets/**'
+ - 'notebooks/**'
+ - '**/*.txt'
+ - '**/*.rst'
+ - '**/*.ipynb'
+ - '**/*.pdf'
+ - '**/*.png'
+
+datasets:
+ - 'datasets/**'
+
+cuGraph:
+ - 'cpp/**'
+
+CMake:
+ - '**/CMakeLists.txt'
+ - '**/cmake/**'
+
+gpuCI:
+ - 'ci/**'
+
+conda:
+ - 'conda/**'
diff --git a/.github/workflows/stale.yaml b/.github/workflows/stale.yaml
new file mode 100644
index 00000000000..8b65da69aa2
--- /dev/null
+++ b/.github/workflows/stale.yaml
@@ -0,0 +1,57 @@
+name: Mark inactive issues and pull requests
+
+on:
+ schedule:
+ - cron: "0 * * * *"
+
+jobs:
+ mark-inactive-30d:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Mark 30 day inactive issues and pull requests
+ uses: actions/stale@v3
+ with:
+ repo-token: ${{ secrets.GITHUB_TOKEN }}
+ stale-issue-message: >
+ This issue has been labeled `inactive-30d` due to no recent activity in the past 30 days.
+ Please close this issue if no further response or action is needed.
+ Otherwise, please respond with a comment indicating any updates or changes to the original issue and/or confirm this issue still needs to be addressed.
+ This issue will be labeled `inactive-90d` if there is no activity in the next 60 days.
+ stale-issue-label: "inactive-30d"
+ exempt-issue-labels: "0 - Blocked,0 - Backlog,good first issue"
+ days-before-issue-stale: 30
+ days-before-issue-close: -1
+ stale-pr-message: >
+ This PR has been labeled `inactive-30d` due to no recent activity in the past 30 days.
+ Please close this PR if it is no longer required.
+ Otherwise, please respond with a comment indicating any updates.
+ This PR will be labeled `inactive-90d` if there is no activity in the next 60 days.
+ stale-pr-label: "inactive-30d"
+ exempt-pr-labels: "0 - Blocked,0 - Backlog,good first issue"
+ days-before-pr-stale: 30
+ days-before-pr-close: -1
+ operations-per-run: 50
+ mark-inactive-90d:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Mark 90 day inactive issues and pull requests
+ uses: actions/stale@v3
+ with:
+ repo-token: ${{ secrets.GITHUB_TOKEN }}
+ stale-issue-message: >
+ This issue has been labeled `inactive-90d` due to no recent activity in the past 90 days.
+ Please close this issue if no further response or action is needed.
+ Otherwise, please respond with a comment indicating any updates or changes to the original issue and/or confirm this issue still needs to be addressed.
+ stale-issue-label: "inactive-90d"
+ exempt-issue-labels: "0 - Blocked,0 - Backlog,good first issue"
+ days-before-issue-stale: 90
+ days-before-issue-close: -1
+ stale-pr-message: >
+ This PR has been labeled `inactive-90d` due to no recent activity in the past 90 days.
+ Please close this PR if it is no longer required.
+ Otherwise, please respond with a comment indicating any updates.
+ stale-pr-label: "inactive-90d"
+ exempt-pr-labels: "0 - Blocked,0 - Backlog,good first issue"
+ days-before-pr-stale: 90
+ days-before-pr-close: -1
+ operations-per-run: 50
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 815ffa86e35..601ac2fb4f8 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,228 @@
-# cuGraph 0.17.0 (10 Dec 2020)
+# cuGraph 21.08.00 (4 Aug 2021)
+
+## π¨ Breaking Changes
+
+- Removed depricated code ([#1705](https://github.com/rapidsai/cugraph/pull/1705)) [@BradReesWork](https://github.com/BradReesWork)
+- Delete legacy renumbering implementation ([#1681](https://github.com/rapidsai/cugraph/pull/1681)) [@ChuckHastings](https://github.com/ChuckHastings)
+- Migrate old graph to legacy directory/namespace ([#1675](https://github.com/rapidsai/cugraph/pull/1675)) [@ChuckHastings](https://github.com/ChuckHastings)
+
+## π Bug Fixes
+
+- Changed cuco cmake function to return early if cuco has already been added as a target ([#1746](https://github.com/rapidsai/cugraph/pull/1746)) [@rlratzel](https://github.com/rlratzel)
+- revert cuco to latest dev branch, issues should be fixed ([#1721](https://github.com/rapidsai/cugraph/pull/1721)) [@ChuckHastings](https://github.com/ChuckHastings)
+- Fix `conda` uploads ([#1712](https://github.com/rapidsai/cugraph/pull/1712)) [@ajschmidt8](https://github.com/ajschmidt8)
+- Updated for CUDA-specific py packages ([#1709](https://github.com/rapidsai/cugraph/pull/1709)) [@rlratzel](https://github.com/rlratzel)
+- Use `library_dirs` for cython linking, link cudatoolkit libs, allow setting UCX install location ([#1698](https://github.com/rapidsai/cugraph/pull/1698)) [@trxcllnt](https://github.com/trxcllnt)
+- Fix the Louvain failure with 64 bit vertex IDs ([#1696](https://github.com/rapidsai/cugraph/pull/1696)) [@seunghwak](https://github.com/seunghwak)
+- Use nested include in destination of install headers to avoid docker permission issues ([#1656](https://github.com/rapidsai/cugraph/pull/1656)) [@dantegd](https://github.com/dantegd)
+- Added accidentally-removed cpp-mgtests target back to the valid args list ([#1652](https://github.com/rapidsai/cugraph/pull/1652)) [@rlratzel](https://github.com/rlratzel)
+- Update UCX-Py version to 0.21 ([#1650](https://github.com/rapidsai/cugraph/pull/1650)) [@pentschev](https://github.com/pentschev)
+
+## π Documentation
+
+- Docs for RMAT ([#1735](https://github.com/rapidsai/cugraph/pull/1735)) [@BradReesWork](https://github.com/BradReesWork)
+- Doc updates ([#1719](https://github.com/rapidsai/cugraph/pull/1719)) [@BradReesWork](https://github.com/BradReesWork)
+
+## π New Features
+
+- Fea cleanup stream part1 ([#1653](https://github.com/rapidsai/cugraph/pull/1653)) [@ChuckHastings](https://github.com/ChuckHastings)
+
+## π οΈ Improvements
+
+- Pinning cuco to a specific commit hash for release ([#1741](https://github.com/rapidsai/cugraph/pull/1741)) [@rlratzel](https://github.com/rlratzel)
+- Pin max version for `dask` & `distributed` ([#1736](https://github.com/rapidsai/cugraph/pull/1736)) [@galipremsagar](https://github.com/galipremsagar)
+- Fix libfaiss dependency to not expressly depend on conda-forge ([#1728](https://github.com/rapidsai/cugraph/pull/1728)) [@Ethyling](https://github.com/Ethyling)
+- Fix MG_test bug ([#1718](https://github.com/rapidsai/cugraph/pull/1718)) [@jnke2016](https://github.com/jnke2016)
+- Cascaded dispatch for type-erased API ([#1711](https://github.com/rapidsai/cugraph/pull/1711)) [@aschaffer](https://github.com/aschaffer)
+- ReduceV test ([#1710](https://github.com/rapidsai/cugraph/pull/1710)) [@kaatish](https://github.com/kaatish)
+- Removed depricated code ([#1705](https://github.com/rapidsai/cugraph/pull/1705)) [@BradReesWork](https://github.com/BradReesWork)
+- Delete unused/out-dated primitives ([#1704](https://github.com/rapidsai/cugraph/pull/1704)) [@seunghwak](https://github.com/seunghwak)
+- Update primitives to support DCSR (DCSC) segments (Part 2/2) ([#1703](https://github.com/rapidsai/cugraph/pull/1703)) [@seunghwak](https://github.com/seunghwak)
+- Fea speedup compile ([#1702](https://github.com/rapidsai/cugraph/pull/1702)) [@ChuckHastings](https://github.com/ChuckHastings)
+- Update `conda` environment name for CI ([#1699](https://github.com/rapidsai/cugraph/pull/1699)) [@ajschmidt8](https://github.com/ajschmidt8)
+- Count if test ([#1697](https://github.com/rapidsai/cugraph/pull/1697)) [@kaatish](https://github.com/kaatish)
+- replace cudf assert_eq ([#1693](https://github.com/rapidsai/cugraph/pull/1693)) [@jnke2016](https://github.com/jnke2016)
+- Fix int64 vertex_t ([#1691](https://github.com/rapidsai/cugraph/pull/1691)) [@Iroy30](https://github.com/Iroy30)
+- Update primitives to support DCSR (DCSC) segments (Part 1) ([#1690](https://github.com/rapidsai/cugraph/pull/1690)) [@seunghwak](https://github.com/seunghwak)
+- remove hardcoded dtype ([#1689](https://github.com/rapidsai/cugraph/pull/1689)) [@Iroy30](https://github.com/Iroy30)
+- Updating Clang Version to 11.0.0 ([#1688](https://github.com/rapidsai/cugraph/pull/1688)) [@codereport](https://github.com/codereport)
+- `CHECK_CUDA` macros in debug builds ([#1687](https://github.com/rapidsai/cugraph/pull/1687)) [@trxcllnt](https://github.com/trxcllnt)
+- fixing symmetrize_ddf ([#1686](https://github.com/rapidsai/cugraph/pull/1686)) [@jnke2016](https://github.com/jnke2016)
+- Improve Random Walks performance ([#1685](https://github.com/rapidsai/cugraph/pull/1685)) [@aschaffer](https://github.com/aschaffer)
+- Use the 21.08 branch of rapids-cmake as rmm requires it ([#1683](https://github.com/rapidsai/cugraph/pull/1683)) [@robertmaynard](https://github.com/robertmaynard)
+- Delete legacy renumbering implementation ([#1681](https://github.com/rapidsai/cugraph/pull/1681)) [@ChuckHastings](https://github.com/ChuckHastings)
+- Fix vertex partition offsets ([#1680](https://github.com/rapidsai/cugraph/pull/1680)) [@Iroy30](https://github.com/Iroy30)
+- Ues std::optional (or thrust::optional) for optional parameters & first part of DCSR (DCSC) implementation. ([#1676](https://github.com/rapidsai/cugraph/pull/1676)) [@seunghwak](https://github.com/seunghwak)
+- Migrate old graph to legacy directory/namespace ([#1675](https://github.com/rapidsai/cugraph/pull/1675)) [@ChuckHastings](https://github.com/ChuckHastings)
+- Expose epsilon parameter (precision) through python layer ([#1674](https://github.com/rapidsai/cugraph/pull/1674)) [@ChuckHastings](https://github.com/ChuckHastings)
+- Fea hungarian expose precision ([#1673](https://github.com/rapidsai/cugraph/pull/1673)) [@ChuckHastings](https://github.com/ChuckHastings)
+- Branch 21.08 merge 21.06 ([#1672](https://github.com/rapidsai/cugraph/pull/1672)) [@BradReesWork](https://github.com/BradReesWork)
+- Update pins to Dask/Distributed >= 2021.6.0 ([#1666](https://github.com/rapidsai/cugraph/pull/1666)) [@pentschev](https://github.com/pentschev)
+- Fix conflicts in `1643` ([#1651](https://github.com/rapidsai/cugraph/pull/1651)) [@ajschmidt8](https://github.com/ajschmidt8)
+- Rename include/cugraph/patterns to include/cugraph/prims ([#1644](https://github.com/rapidsai/cugraph/pull/1644)) [@seunghwak](https://github.com/seunghwak)
+- Fix merge conflicts in 1631 ([#1639](https://github.com/rapidsai/cugraph/pull/1639)) [@ajschmidt8](https://github.com/ajschmidt8)
+- Update to changed `rmm::device_scalar` API ([#1637](https://github.com/rapidsai/cugraph/pull/1637)) [@harrism](https://github.com/harrism)
+- Fix merge conflicts ([#1614](https://github.com/rapidsai/cugraph/pull/1614)) [@ajschmidt8](https://github.com/ajschmidt8)
+
+# cuGraph 21.06.00 (9 Jun 2021)
+
+## π Bug Fixes
+
+- Delete CUDA_ARCHITECTURES=OFF ([#1638](https://github.com/rapidsai/cugraph/pull/1638)) [@seunghwak](https://github.com/seunghwak)
+- transform_reduce_e bug fixes ([#1633](https://github.com/rapidsai/cugraph/pull/1633)) [@ChuckHastings](https://github.com/ChuckHastings)
+- Correct install path for include folder to avoid double nesting ([#1630](https://github.com/rapidsai/cugraph/pull/1630)) [@dantegd](https://github.com/dantegd)
+- Remove thread local thrust::sort (thrust::sort with the execution policy thrust::seq) from copy_v_transform_reduce_key_aggregated_out_nbr ([#1627](https://github.com/rapidsai/cugraph/pull/1627)) [@seunghwak](https://github.com/seunghwak)
+
+## π New Features
+
+- SG & MG Weakly Connected Components ([#1604](https://github.com/rapidsai/cugraph/pull/1604)) [@seunghwak](https://github.com/seunghwak)
+
+## π οΈ Improvements
+
+- Remove Pascal guard and test cuGraph use of cuco::static_map on Pascal ([#1640](https://github.com/rapidsai/cugraph/pull/1640)) [@seunghwak](https://github.com/seunghwak)
+- Upgraded recipe and dev envs to NCCL 2.9.9 ([#1636](https://github.com/rapidsai/cugraph/pull/1636)) [@rlratzel](https://github.com/rlratzel)
+- Use UCX-Py 0.20 ([#1634](https://github.com/rapidsai/cugraph/pull/1634)) [@jakirkham](https://github.com/jakirkham)
+- Updated dependencies for CalVer ([#1629](https://github.com/rapidsai/cugraph/pull/1629)) [@rlratzel](https://github.com/rlratzel)
+- MG WCC improvements ([#1628](https://github.com/rapidsai/cugraph/pull/1628)) [@seunghwak](https://github.com/seunghwak)
+- Initialize force_atlas2 `old_forces` device_uvector, use new `rmm::exec_policy` ([#1625](https://github.com/rapidsai/cugraph/pull/1625)) [@trxcllnt](https://github.com/trxcllnt)
+- Fix developer guide examples for device_buffer ([#1619](https://github.com/rapidsai/cugraph/pull/1619)) [@harrism](https://github.com/harrism)
+- Pass rmm memory allocator to cuco::static_map ([#1617](https://github.com/rapidsai/cugraph/pull/1617)) [@seunghwak](https://github.com/seunghwak)
+- Undo disabling MG C++ testing outputs for non-root processes ([#1615](https://github.com/rapidsai/cugraph/pull/1615)) [@seunghwak](https://github.com/seunghwak)
+- WCC bindings ([#1612](https://github.com/rapidsai/cugraph/pull/1612)) [@Iroy30](https://github.com/Iroy30)
+- address 'ValueError: Series contains NULL values' from from_cudf_edge⦠([#1610](https://github.com/rapidsai/cugraph/pull/1610)) [@mattf](https://github.com/mattf)
+- Fea rmm device buffer change ([#1609](https://github.com/rapidsai/cugraph/pull/1609)) [@ChuckHastings](https://github.com/ChuckHastings)
+- Update `CHANGELOG.md` links for calver ([#1608](https://github.com/rapidsai/cugraph/pull/1608)) [@ajschmidt8](https://github.com/ajschmidt8)
+- Handle int64 in force atlas wrapper and update to uvector ([#1607](https://github.com/rapidsai/cugraph/pull/1607)) [@hlinsen](https://github.com/hlinsen)
+- Update docs build script ([#1606](https://github.com/rapidsai/cugraph/pull/1606)) [@ajschmidt8](https://github.com/ajschmidt8)
+- WCC performance/memory footprint optimization ([#1605](https://github.com/rapidsai/cugraph/pull/1605)) [@seunghwak](https://github.com/seunghwak)
+- adding test graphs - part 2 ([#1603](https://github.com/rapidsai/cugraph/pull/1603)) [@ChuckHastings](https://github.com/ChuckHastings)
+- Update the Random Walk binding ([#1599](https://github.com/rapidsai/cugraph/pull/1599)) [@Iroy30](https://github.com/Iroy30)
+- Add mnmg out degree ([#1592](https://github.com/rapidsai/cugraph/pull/1592)) [@Iroy30](https://github.com/Iroy30)
+- Update `cugraph` to with newest CMake features, including CPM for dependencies ([#1585](https://github.com/rapidsai/cugraph/pull/1585)) [@robertmaynard](https://github.com/robertmaynard)
+- Implement Graph Batching functionality ([#1580](https://github.com/rapidsai/cugraph/pull/1580)) [@aschaffer](https://github.com/aschaffer)
+- add multi-column support in algorithms - part 2 ([#1571](https://github.com/rapidsai/cugraph/pull/1571)) [@Iroy30](https://github.com/Iroy30)
+
+# cuGraph 0.19.0 (21 Apr 2021)
+
+## π Bug Fixes
+
+- Fixed copyright date and format ([#1526](https://github.com//rapidsai/cugraph/pull/1526)) [@rlratzel](https://github.com/rlratzel)
+- fix mg_renumber non-deterministic errors ([#1523](https://github.com//rapidsai/cugraph/pull/1523)) [@Iroy30](https://github.com/Iroy30)
+- Updated NetworkX version to 2.5.1 ([#1510](https://github.com//rapidsai/cugraph/pull/1510)) [@rlratzel](https://github.com/rlratzel)
+- pascal renumbering fix ([#1505](https://github.com//rapidsai/cugraph/pull/1505)) [@Iroy30](https://github.com/Iroy30)
+- Fix MNMG test failures and skip tests that are not supported on Pascal ([#1498](https://github.com//rapidsai/cugraph/pull/1498)) [@jnke2016](https://github.com/jnke2016)
+- Revert "Update conda recipes pinning of repo dependencies" ([#1493](https://github.com//rapidsai/cugraph/pull/1493)) [@raydouglass](https://github.com/raydouglass)
+- Update conda recipes pinning of repo dependencies ([#1485](https://github.com//rapidsai/cugraph/pull/1485)) [@mike-wendt](https://github.com/mike-wendt)
+- Update to make notebook_list.py compatible with numba 0.53 ([#1455](https://github.com//rapidsai/cugraph/pull/1455)) [@rlratzel](https://github.com/rlratzel)
+- Fix bugs in copy_v_transform_reduce_key_aggregated_out_nbr & groupby_gpuid_and_shuffle ([#1434](https://github.com//rapidsai/cugraph/pull/1434)) [@seunghwak](https://github.com/seunghwak)
+- update default path of setup to use the new directory paths in build β¦ ([#1425](https://github.com//rapidsai/cugraph/pull/1425)) [@ChuckHastings](https://github.com/ChuckHastings)
+
+## π Documentation
+
+- Create C++ documentation ([#1489](https://github.com//rapidsai/cugraph/pull/1489)) [@ChuckHastings](https://github.com/ChuckHastings)
+- Create cuGraph developers guide ([#1431](https://github.com//rapidsai/cugraph/pull/1431)) [@ChuckHastings](https://github.com/ChuckHastings)
+- Add boost 1.0 license file. ([#1401](https://github.com//rapidsai/cugraph/pull/1401)) [@seunghwak](https://github.com/seunghwak)
+
+## π New Features
+
+- Implement C/CUDA RandomWalks functionality ([#1439](https://github.com//rapidsai/cugraph/pull/1439)) [@aschaffer](https://github.com/aschaffer)
+- Add R-mat generator ([#1411](https://github.com//rapidsai/cugraph/pull/1411)) [@seunghwak](https://github.com/seunghwak)
+
+## π οΈ Improvements
+
+- Random Walks - Python Bindings ([#1516](https://github.com//rapidsai/cugraph/pull/1516)) [@jnke2016](https://github.com/jnke2016)
+- Updating RAFT tag ([#1509](https://github.com//rapidsai/cugraph/pull/1509)) [@afender](https://github.com/afender)
+- Clean up nullptr cuda_stream_view arguments ([#1504](https://github.com//rapidsai/cugraph/pull/1504)) [@hlinsen](https://github.com/hlinsen)
+- Reduce the size of the cugraph libraries ([#1503](https://github.com//rapidsai/cugraph/pull/1503)) [@robertmaynard](https://github.com/robertmaynard)
+- Add indirection and replace algorithms with new renumbering ([#1484](https://github.com//rapidsai/cugraph/pull/1484)) [@Iroy30](https://github.com/Iroy30)
+- Multiple graph generator with power law distribution on sizes ([#1483](https://github.com//rapidsai/cugraph/pull/1483)) [@afender](https://github.com/afender)
+- TSP solver bug fix ([#1480](https://github.com//rapidsai/cugraph/pull/1480)) [@hlinsen](https://github.com/hlinsen)
+- Added cmake function and .hpp template for generating version_config.hpp file. ([#1476](https://github.com//rapidsai/cugraph/pull/1476)) [@rlratzel](https://github.com/rlratzel)
+- Fix for bug in SCC on self-loops ([#1475](https://github.com//rapidsai/cugraph/pull/1475)) [@aschaffer](https://github.com/aschaffer)
+- MS BFS python APIs + EgoNet updates ([#1469](https://github.com//rapidsai/cugraph/pull/1469)) [@afender](https://github.com/afender)
+- Removed unused dependencies from libcugraph recipe, moved non-test script code from test script to gpu build script ([#1468](https://github.com//rapidsai/cugraph/pull/1468)) [@rlratzel](https://github.com/rlratzel)
+- Remove literals passed to `device_uvector::set_element_async` ([#1453](https://github.com//rapidsai/cugraph/pull/1453)) [@harrism](https://github.com/harrism)
+- ENH Change conda build directories to work with ccache ([#1452](https://github.com//rapidsai/cugraph/pull/1452)) [@dillon-cullinan](https://github.com/dillon-cullinan)
+- Updating docs ([#1448](https://github.com//rapidsai/cugraph/pull/1448)) [@BradReesWork](https://github.com/BradReesWork)
+- Improve graph primitives performance on graphs with widely varying vertex degrees ([#1447](https://github.com//rapidsai/cugraph/pull/1447)) [@seunghwak](https://github.com/seunghwak)
+- Update Changelog Link ([#1446](https://github.com//rapidsai/cugraph/pull/1446)) [@ajschmidt8](https://github.com/ajschmidt8)
+- Updated NCCL to version 2.8.4 ([#1445](https://github.com//rapidsai/cugraph/pull/1445)) [@BradReesWork](https://github.com/BradReesWork)
+- Update FAISS to 1.7.0 ([#1444](https://github.com//rapidsai/cugraph/pull/1444)) [@BradReesWork](https://github.com/BradReesWork)
+- Update graph partitioning scheme ([#1443](https://github.com//rapidsai/cugraph/pull/1443)) [@seunghwak](https://github.com/seunghwak)
+- Add additional datasets to improve coverage ([#1441](https://github.com//rapidsai/cugraph/pull/1441)) [@jnke2016](https://github.com/jnke2016)
+- Update C++ MG PageRank and SG PageRank, Katz Centrality, BFS, and SSSP to use the new R-mat graph generator ([#1438](https://github.com//rapidsai/cugraph/pull/1438)) [@seunghwak](https://github.com/seunghwak)
+- Remove raft handle duplication ([#1436](https://github.com//rapidsai/cugraph/pull/1436)) [@Iroy30](https://github.com/Iroy30)
+- Streams infra + support in egonet ([#1435](https://github.com//rapidsai/cugraph/pull/1435)) [@afender](https://github.com/afender)
+- Prepare Changelog for Automation ([#1433](https://github.com//rapidsai/cugraph/pull/1433)) [@ajschmidt8](https://github.com/ajschmidt8)
+- Update 0.18 changelog entry ([#1429](https://github.com//rapidsai/cugraph/pull/1429)) [@ajschmidt8](https://github.com/ajschmidt8)
+- Update and Test Renumber bindings ([#1427](https://github.com//rapidsai/cugraph/pull/1427)) [@Iroy30](https://github.com/Iroy30)
+- Update Louvain to use new graph primitives and pattern accelerators ([#1423](https://github.com//rapidsai/cugraph/pull/1423)) [@ChuckHastings](https://github.com/ChuckHastings)
+- Replace rmm::device_vector & thrust::host_vector with rmm::device_uvector & std::vector, respectively. ([#1421](https://github.com//rapidsai/cugraph/pull/1421)) [@seunghwak](https://github.com/seunghwak)
+- Update C++ MG PageRank test ([#1419](https://github.com//rapidsai/cugraph/pull/1419)) [@seunghwak](https://github.com/seunghwak)
+- ENH Build with `cmake --build` & Pass ccache variables to conda recipe & use Ninja in CI ([#1415](https://github.com//rapidsai/cugraph/pull/1415)) [@Ethyling](https://github.com/Ethyling)
+- Adding new primitives: copy_v_transform_reduce_key_aggregated_out_nbr & transform_reduce_by_adj_matrix_row|col_key_e bug fixes ([#1399](https://github.com//rapidsai/cugraph/pull/1399)) [@seunghwak](https://github.com/seunghwak)
+- Add new primitives: compute_in|out_degrees, compute_in|out_weight_sums to graph_view_t ([#1394](https://github.com//rapidsai/cugraph/pull/1394)) [@seunghwak](https://github.com/seunghwak)
+- Rename sort_and_shuffle to groupby_gpuid_and_shuffle ([#1392](https://github.com//rapidsai/cugraph/pull/1392)) [@seunghwak](https://github.com/seunghwak)
+- Matching updates for RAFT comms updates (device_sendrecv, device_multicast_sendrecv, gather, gatherv) ([#1391](https://github.com//rapidsai/cugraph/pull/1391)) [@seunghwak](https://github.com/seunghwak)
+- Fix forward-merge conflicts for #1370 ([#1377](https://github.com//rapidsai/cugraph/pull/1377)) [@ajschmidt8](https://github.com/ajschmidt8)
+- Add utility function for computing a secondary cost for BFS and SSSP output ([#1376](https://github.com//rapidsai/cugraph/pull/1376)) [@hlinsen](https://github.com/hlinsen)
+
+# cuGraph 0.18.0 (24 Feb 2021)
+
+## Bug Fixes π
+
+- Fixed TSP returned routes (#1412) @hlinsen
+- Updated CI scripts to use a different error handling convention, updated LD_LIBRARY_PATH for project flash runs (#1386) @rlratzel
+- Bug fixes for MNMG coarsen_graph, renumber_edgelist, relabel (#1364) @seunghwak
+- Set a specific known working commit hash for gunrock instead of "dev" (#1336) @rlratzel
+- Updated git utils used by copyright.py for compatibility with current CI env (#1325) @rlratzel
+- Fix MNMG Louvain tests on Pascal architecture (#1322) @ChuckHastings
+- FIX Set bash trap after PATH is updated (#1321) @dillon-cullinan
+- Fix graph nodes function and renumbering from series (#1319) @Iroy30
+- Fix Branch 0.18 merge 0.17 (#1314) @BradReesWork
+- Fix EXPERIMENTAL_LOUVAIN_TEST on Pascal (#1312) @ChuckHastings
+- Updated cuxfilter to 0.18, removed datashader indirect dependency in conda dev .yml files (#1311) @rlratzel
+- Update SG PageRank C++ tests (#1307) @seunghwak
+
+## Documentation π
+
+- Enabled MultiGraph class and tests, updated SOURCEBUILD.md to include the latest build.sh options (#1351) @rlratzel
+
+## New Features π
+
+- New EgoNet extractor (#1365) @afender
+- Implement induced subgraph extraction primitive (SG C++) (#1354) @seunghwak
+
+## Improvements π οΈ
+
+- Update stale GHA with exemptions & new labels (#1413) @mike-wendt
+- Add GHA to mark issues/prs as stale/rotten (#1408) @Ethyling
+- update subgraph tests and remove legacy pagerank (#1378) @Iroy30
+- Update the conda environments and README file (#1369) @BradReesWork
+- Prepare Changelog for Automation (#1368) @ajschmidt8
+- Update CMakeLists.txt files for consistency with RAPIDS and to support cugraph as an external project and other tech debt removal (#1367) @rlratzel
+- Use new coarsen_graph primitive in Louvain (#1362) @ChuckHastings
+- Added initial infrastructure for MG C++ testing and a Pagerank MG test using it (#1361) @rlratzel
+- Add SG TSP (#1360) @hlinsen
+- Build a Dendrogram class, adapt Louvain/Leiden/ECG to use it (#1359) @ChuckHastings
+- Auto-label PRs based on their content (#1358) @jolorunyomi
+- Implement MNMG Renumber (#1355) @aschaffer
+- Enabling pytest code coverage output by default (#1352) @jnke2016
+- Added configuration for new cugraph-doc-codeowners review group (#1344) @rlratzel
+- API update to match RAFT PR #120 (#1343) @drobison00
+- Pin gunrock to v1.2 for version 0.18 (#1342) @ChuckHastings
+- Fix #1340 - Use generic from_edgelist() methods (#1341) @miguelusque
+- Using RAPIDS_DATASET_ROOT_DIR env var in place of absolute path to datasets in tests (#1337) @jnke2016
+- Expose dense implementation of Hungarian algorithm (#1333) @ChuckHastings
+- SG Pagerank transition (#1332) @Iroy30
+- improving error checking and docs (#1327) @BradReesWork
+- Fix MNMG cleanup exceptions (#1326) @Iroy30
+- Create labeler.yml (#1318) @jolorunyomi
+- Updates to support nightly MG test automation (#1308) @rlratzel
+- Add C++ graph functions (coarsen_grpah, renumber_edgelist, relabel) and primitvies (transform_reduce_by_adj_matrix_row_key, transform_reduce_by_adj_matrix_col_key, copy_v_transform_reduce_key_aggregated_out_nbr) (#1257) @seunghwak
+>>>>>>> upstream/branch-0.18
+# cuGraph 0.17.0 (10 Dec 2020)
## New Features
- PR #1276 MST
- PR #1245 Add functions to add pandas and numpy compatibility
@@ -10,6 +233,7 @@
- PR #1279 Add self loop check variable in graph
- PR #1277 SciPy sparse matrix input support for WCC, SCC, SSSP, and BFS
- PR #1278 Add support for shortest_path_length and fix graph vertex checks
+- PR #1280 Add Multi(Di)Graph support
## Improvements
- PR #1227 Pin cmake policies to cmake 3.17 version
diff --git a/README.md b/README.md
index 8fee5451ac3..76015f528f6 100644
--- a/README.md
+++ b/README.md
@@ -8,7 +8,7 @@ The [RAPIDS](https://rapids.ai) cuGraph library is a collection of GPU accelerat
**NOTE:** For the latest stable [README.md](https://github.com/rapidsai/cugraph/blob/main/README.md) ensure you are on the latest branch.
-
+As an example, the following Python snippet loads graph data and computes PageRank:
```python
import cugraph
@@ -30,18 +30,30 @@ for i in range(len(df_page)):
" PageRank is " + str(df_page['pagerank'].iloc[i]))
```
+## Getting cuGraph
+There are 3 ways to get cuGraph :
+1. [Quick start with Docker Repo](#quick)
+2. [Conda Installation](#conda)
+3. [Build from Source](#source)
+
+
+---
+# Currently Supported Features
+As of Release 21.08 - including 21.08 nightly
+
## Supported Algorithms
-| Category | Algorithm | Scale | Notes
+| Category | Algorithm | Scale | Notes |
| ------------ | -------------------------------------- | ------------ | ------------------- |
| Centrality | | | |
| | Katz | Multi-GPU | |
| | Betweenness Centrality | Single-GPU | |
| | Edge Betweenness Centrality | Single-GPU | |
| Community | | | |
+| | EgoNet | Single-GPU | |
| | Leiden | Single-GPU | |
-| | Louvain | Multi-GPU | |
+| | Louvain | Multi-GPU | [C++ README](cpp/src/community/README.md#Louvain) |
| | Ensemble Clustering for Graphs | Single-GPU | |
| | Spectral-Clustering - Balanced Cut | Single-GPU | |
| | Spectral-Clustering - Modularity | Single-GPU | |
@@ -49,32 +61,35 @@ for i in range(len(df_page)):
| | Triangle Counting | Single-GPU | |
| | K-Truss | Single-GPU | |
| Components | | | |
-| | Weakly Connected Components | Single-GPU | |
+| | Weakly Connected Components | Multi-GPU | |
| | Strongly Connected Components | Single-GPU | |
| Core | | | |
| | K-Core | Single-GPU | |
| | Core Number | Single-GPU | |
| Layout | | | |
| | Force Atlas 2 | Single-GPU | |
+| Linear Assignment| | | |
+| | Hungarian | Single-GPU | [README](cpp/src/linear_assignment/README-hungarian.md) |
| Link Analysis| | | |
-| | Pagerank | Multi-GPU | |
-| | Personal Pagerank | Multi-GPU | |
-| | HITS | Single-GPU | leverages Gunrock |
+| | Pagerank | Multi-GPU | [C++ README](cpp/src/centrality/README.md#Pagerank) |
+| | Personal Pagerank | Multi-GPU | [C++ README](cpp/src/centrality/README.md#Personalized-Pagerank) |
+| | HITS | Single-GPU | leverages Gunrock |
| Link Prediction | | | |
| | Jaccard Similarity | Single-GPU | |
| | Weighted Jaccard Similarity | Single-GPU | |
| | Overlap Similarity | Single-GPU | |
+| Sampling | | | |
+| | Random Walks (RW) | Single-GPU | |
| Traversal | | | |
-| | Breadth First Search (BFS) | Multi-GPU | |
-| | Single Source Shortest Path (SSSP) | Multi-GPU | |
-| Structure | | | |
-| | Renumbering | Single-GPU | multiple columns, any data type |
-| | Symmetrize | Multi-GPU | |
-| Other | | | |
-| | Hungarian Algorithm | Single-GPU | |
+| | Breadth First Search (BFS) | Multi-GPU | with cutoff support
[C++ README](cpp/src/traversal/README.md#BFS) |
+| | Single Source Shortest Path (SSSP) | Multi-GPU | [C++ README](cpp/src/traversal/README.md#SSSP) |
+| | Traveling Salesperson Problem (TSP) | Single-GPU | |
+| Tree | | | |
| | Minimum Spanning Tree | Single-GPU | |
| | Maximum Spanning Tree | Single-GPU | |
-
+| Other | | | |
+| | Renumbering | Multi-GPU | multiple columns, any data type |
+| | Symmetrize | Multi-GPU | |
| | |
@@ -83,13 +98,16 @@ for i in range(len(df_page)):
| --------------- | --------------------------------------------------- |
| Graph | An undirected Graph |
| DiGraph | A Directed Graph |
-| _Multigraph_ | _coming in 0.18_ |
-| _MultiDigraph_ | _coming in 0.18_ |
+| Multigraph | A Graph with multiple edges between a vertex pair |
+| MultiDigraph | A Directed Graph with multiple edges between a vertex pair |
| | |
+ALL Algorithms support Graphs and MultiGraph (directed and undirected)
+
+
## Supported Data Types
-cuGraph supports the creation of a graph several data types:
+cuGraph supports graph creation with Source and Destination being expressed as:
* cuDF DataFrame
* Pandas DataFrame
@@ -103,11 +121,8 @@ cuGraph tries to match the return type based on the input type. So a NetworkX i
## cuGraph Notice
-The current version of cuGraph has some limitations:
-- Vertex IDs are expected to be contiguous integers starting from 0.
-
-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.
+Vertex IDs are expected to be contiguous integers starting from 0. If your data doesn't match that restriction, we have a solution. cuGraph provides the renumber function, which is by default automatically called when data is 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 either 32- or 64-bit contiguous integers starting from 0.
Additionally, when using the auto-renumbering feature, vertices are automatically un-renumbered in results.
@@ -123,42 +138,31 @@ The amount of memory required is dependent on the graph structure and the analyt
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
-### Intro
-There are 3 ways to get cuGraph :
-1. [Quick start with Docker Demo Repo](#quick)
-2. [Conda Installation](#conda)
-3. [Build from Source](#source)
-
-
-
-
+---
## 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.
+Please see the [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.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
+conda install -c nvidia -c rapidsai -c numba -c conda-forge cugraph cudatoolkit=11.0
+
+# CUDA 11.2
+conda install -c nvidia -c rapidsai -c numba -c conda-forge cugraph cudatoolkit=11.2
```
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)
diff --git a/SOURCEBUILD.md b/SOURCEBUILD.md
index 8acd90c4f7f..47b842a0ce6 100644
--- a/SOURCEBUILD.md
+++ b/SOURCEBUILD.md
@@ -1,25 +1,21 @@
# Building from Source
-The following instructions are for users wishing to build cuGraph from source code. These instructions are tested on supported distributions of Linux, CUDA, and Python - See [RAPIDS Getting Started](https://rapids.ai/start.html) for list of supported environments. Other operating systems _might be_ compatible, but are not currently tested.
+The following instructions are for users wishing to build cuGraph from source code. These instructions are tested on supported distributions of Linux, CUDA, and Python - See [RAPIDS Getting Started](https://rapids.ai/start.html) for list of supported environments. Other operating systems _might be_ compatible, but are not currently tested.
The cuGraph package include both a C/C++ CUDA portion and a python portion. Both libraries need to be installed in order for cuGraph to operate correctly.
## Prerequisites
__Compiler__:
-* `gcc` version 5.4+
-* `nvcc` version 10.0+
-* `cmake` version 3.12+
+* `gcc` version 9.3+
+* `nvcc` version 11.0+
+* `cmake` version 3.20.1+
__CUDA:__
-* CUDA 10.1+
-* NVIDIA driver 396.44+
+* CUDA 11.0+
+* NVIDIA driver 450.80.02+
* Pascal architecture or better
-__Other__
-* `git`
-
-
You can obtain CUDA from [https://developer.nvidia.com/cuda-downloads](https://developer.nvidia.com/cuda-downloads).
@@ -47,17 +43,12 @@ __Create the conda development environment__
```bash
# create the conda environment (assuming in base `cugraph` directory)
-
-
-# for CUDA 10.1
-conda env create --name cugraph_dev --file conda/environments/cugraph_dev_cuda10.1.yml
-
-# for CUDA 10.2
-conda env create --name cugraph_dev --file conda/environments/cugraph_dev_cuda10.2.yml
-
-# for CUDA 11
+# for CUDA 11.0
conda env create --name cugraph_dev --file conda/environments/cugraph_dev_cuda11.0.yml
+# for CUDA 11.2
+conda env create --name cugraph_dev --file conda/environments/cugraph_dev_cuda11.2.yml
+
# activate the environment
conda activate cugraph_dev
@@ -70,15 +61,12 @@ conda deactivate
```bash
-# 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
+# for CUDA 11.0
conda env update --name cugraph_dev --file conda/environments/cugraph_dev_cuda11.0.yml
+# for CUDA 11.2
+conda env update --name cugraph_dev --file conda/environments/cugraph_dev_cuda11.2.yml
+
conda activate cugraph_dev
```
@@ -97,17 +85,21 @@ There are several other options available on the build script for advanced users
`build.sh` options:
```bash
build.sh [ ...] [ ...]
- clean - remove all existing build artifacts and configuration (start over)
- libcugraph - build the cugraph C++ code
- cugraph - build the cugraph Python package
-
+ where is:
+ clean - remove all existing build artifacts and configuration (start over)
+ libcugraph - build the cugraph C++ code
+ cugraph - build the cugraph Python package
+ docs - build the docs
and is:
-v - verbose build mode
-g - build for debug
-n - no install step
+ --allgpuarch - build for all supported GPU architectures
--show_depr_warn - show cmake deprecation warnings
-h - print this text
+ default action (no args) is to build and install 'libcugraph' then 'cugraph' then 'docs' targets
+
examples:
$ ./build.sh clean # remove prior build artifacts (start over)
$ ./build.sh libcugraph -v # compile and install libcugraph with verbose output
@@ -189,7 +181,7 @@ Run either the C++ or the Python tests with datasets
```bash
cd $CUGRAPH_HOME/datasets
- source get_test_data.sh #This takes about 10 minutes and download 1GB data (>5 GB uncompressed)
+ source get_test_data.sh #This takes about 10 minutes and downloads 1GB data (>5 GB uncompressed)
```
Run the C++ tests on large input:
@@ -228,8 +220,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.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
+export PATH=/usr/local/cuda-11.0/bin:$PATH # or cuda-11.1 if using CUDA 11.1 and cuda-11.2 if using CUDA 11.2, respectively
+export LD_LIBRARY_PATH=/usr/local/cuda-11.0/lib64:$LD_LIBRARY_PATH # or cuda-11.1 if using CUDA 11.1 and cuda-11.2 if using CUDA 11.2, respectively
```
```
diff --git a/benchmarks/bench_algos.py b/benchmarks/bench_algos.py
index 9be636ca480..5284ffbd37b 100644
--- a/benchmarks/bench_algos.py
+++ b/benchmarks/bench_algos.py
@@ -1,4 +1,4 @@
-# Copyright (c) 2020, NVIDIA CORPORATION.
+# Copyright (c) 2020-2021, NVIDIA CORPORATION.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
@@ -32,6 +32,7 @@ def setFixtureParamNames(*args, **kwargs):
import cugraph
from cugraph.structure.number_map import NumberMap
from cugraph.tests import utils
+from cugraph.utilities.utils import is_device_version_less_than
import rmm
from .params import FIXTURE_PARAMS
@@ -50,9 +51,9 @@ def createGraph(csvFileName, graphType=None):
# complexity lower, and assume tests have coverage to verify
# correctness for those combinations.
if "/directed/" in csvFileName:
- graphType = cugraph.structure.graph.DiGraph
+ graphType = cugraph.structure.graph_classes.DiGraph
else:
- graphType = cugraph.structure.graph.Graph
+ graphType = cugraph.structure.graph_classes.Graph
return cugraph.from_cudf_edgelist(
utils.read_csv_file(csvFileName),
@@ -121,7 +122,7 @@ def graphWithAdjListComputed(request):
csvFileName = request.param[0]
reinitRMM(request.param[1], request.param[2])
- G = createGraph(csvFileName, cugraph.structure.graph.Graph)
+ G = createGraph(csvFileName, cugraph.structure.graph_classes.Graph)
G.view_adj_list()
return G
@@ -165,7 +166,7 @@ def bench_create_graph(gpubenchmark, edgelistCreated):
gpubenchmark(cugraph.from_cudf_edgelist,
edgelistCreated,
source="0", destination="1",
- create_using=cugraph.structure.graph.Graph,
+ create_using=cugraph.structure.graph_classes.Graph,
renumber=False)
@@ -182,7 +183,7 @@ def bench_create_digraph(gpubenchmark, edgelistCreated):
gpubenchmark(cugraph.from_cudf_edgelist,
edgelistCreated,
source="0", destination="1",
- create_using=cugraph.structure.graph.DiGraph,
+ create_using=cugraph.structure.graph_classes.DiGraph,
renumber=False)
@@ -212,6 +213,8 @@ def bench_jaccard(gpubenchmark, graphWithAdjListComputed):
gpubenchmark(cugraph.jaccard, graphWithAdjListComputed)
+@pytest.mark.skipif(
+ is_device_version_less_than((7, 0)), reason="Not supported on Pascal")
def bench_louvain(gpubenchmark, graphWithAdjListComputed):
gpubenchmark(cugraph.louvain, graphWithAdjListComputed)
diff --git a/build.sh b/build.sh
index b3d3463ed4e..506cc482c59 100755
--- a/build.sh
+++ b/build.sh
@@ -1,6 +1,6 @@
#!/bin/bash
-# Copyright (c) 2019-2020, NVIDIA CORPORATION.
+# Copyright (c) 2019-2021, NVIDIA CORPORATION.
# cugraph build script
@@ -19,18 +19,21 @@ ARGS=$*
REPODIR=$(cd $(dirname $0); pwd)
LIBCUGRAPH_BUILD_DIR=${LIBCUGRAPH_BUILD_DIR:=${REPODIR}/cpp/build}
-VALIDARGS="clean libcugraph cugraph docs -v -g -n --allgpuarch --show_depr_warn -h --help"
+VALIDARGS="clean uninstall libcugraph cugraph cpp-mgtests docs -v -g -n --allgpuarch --buildfaiss --show_depr_warn -h --help"
HELP="$0 [ ...] [ ...]
where is:
clean - remove all existing build artifacts and configuration (start over)
+ uninstall - uninstall libcugraph and cugraph from a prior build/install (see also -n)
libcugraph - build the cugraph C++ code
cugraph - build the cugraph Python package
+ cpp-mgtests - build libcugraph mnmg tests. Builds MPI communicator, adding MPI as a dependency.
docs - build the docs
and is:
-v - verbose build mode
-g - build for debug
- -n - no install step
+ -n - do not install after a successful build
--allgpuarch - build for all supported GPU architectures
+ --buildfaiss - build faiss statically into cugraph
--show_depr_warn - show cmake deprecation warnings
-h - print this text
@@ -44,11 +47,13 @@ CUGRAPH_BUILD_DIR=${REPODIR}/python/build
BUILD_DIRS="${LIBCUGRAPH_BUILD_DIR} ${CUGRAPH_BUILD_DIR}"
# Set defaults for vars modified by flags to this script
-VERBOSE=""
+VERBOSE_FLAG=""
BUILD_TYPE=Release
INSTALL_TARGET=install
BUILD_DISABLE_DEPRECATION_WARNING=ON
-GPU_ARCH=""
+BUILD_CPP_MG_TESTS=OFF
+BUILD_STATIC_FAISS=OFF
+BUILD_ALL_GPU_ARCH=0
# Set defaults for vars that may not have been defined externally
# FIXME: if PREFIX is not set, check CONDA_PREFIX, but there is no fallback
@@ -82,7 +87,7 @@ fi
# Process flags
if hasArg -v; then
- VERBOSE=1
+ VERBOSE_FLAG="-v"
fi
if hasArg -g; then
BUILD_TYPE=Debug
@@ -91,18 +96,48 @@ if hasArg -n; then
INSTALL_TARGET=""
fi
if hasArg --allgpuarch; then
- GPU_ARCH="-DGPU_ARCHS=ALL"
+ BUILD_ALL_GPU_ARCH=1
+fi
+if hasArg --buildfaiss; then
+ BUILD_STATIC_FAISS=ON
fi
if hasArg --show_depr_warn; then
BUILD_DISABLE_DEPRECATION_WARNING=OFF
fi
+if hasArg cpp-mgtests; then
+ BUILD_CPP_MG_TESTS=ON
+fi
+
+# If clean or uninstall given, run them prior to any other steps
+if hasArg uninstall; then
+ # uninstall libcugraph
+ if [[ "$INSTALL_PREFIX" != "" ]]; then
+ rm -rf ${INSTALL_PREFIX}/include/cugraph
+ rm -f ${INSTALL_PREFIX}/lib/libcugraph.so
+ fi
+ # This may be redundant given the above, but can also be used in case
+ # there are other installed files outside of the locations above.
+ if [ -e ${LIBCUGRAPH_BUILD_DIR}/install_manifest.txt ]; then
+ xargs rm -f < ${LIBCUGRAPH_BUILD_DIR}/install_manifest.txt > /dev/null 2>&1
+ fi
+ # uninstall cugraph installed from a prior "setup.py install"
+ pip uninstall -y cugraph
+fi
-# If clean given, run it prior to any other steps
if hasArg clean; then
- # FIXME: ideally the "setup.py clean" command below would also be run to
- # remove all the "inplace" python build artifacts, but currently, running
- # any setup.py command has side effects (eg. cloning repos).
- #(cd ${REPODIR}/python && python setup.py clean)
+ # remove artifacts generated inplace
+ # FIXME: ideally the "setup.py clean" command would be used for this, but
+ # currently running any setup.py command has side effects (eg. cloning
+ # repos).
+ # (cd ${REPODIR}/python && python setup.py clean)
+ if [[ -d ${REPODIR}/python ]]; then
+ pushd ${REPODIR}/python > /dev/null
+ rm -rf dist dask-worker-space cugraph/raft *.egg-info
+ find . -name "__pycache__" -type d -exec rm -rf {} \; > /dev/null 2>&1
+ find . -name "*.cpp" -type f -delete
+ find . -name "*.cpython*.so" -type f -delete
+ popd > /dev/null
+ fi
# If the dirs to clean are mounted dirs in a container, the contents should
# be removed but the mounted dirs will remain. The find removes all
@@ -119,18 +154,23 @@ fi
################################################################################
# Configure, build, and install libcugraph
if buildAll || hasArg libcugraph; then
- if [[ ${GPU_ARCH} == "" ]]; then
+ if (( ${BUILD_ALL_GPU_ARCH} == 0 )); then
+ CUGRAPH_CMAKE_CUDA_ARCHITECTURES="NATIVE"
echo "Building for the architecture of the GPU in the system..."
else
+ CUGRAPH_CMAKE_CUDA_ARCHITECTURES="ALL"
echo "Building for *ALL* supported GPU architectures..."
fi
mkdir -p ${LIBCUGRAPH_BUILD_DIR}
cd ${LIBCUGRAPH_BUILD_DIR}
cmake -DCMAKE_INSTALL_PREFIX=${INSTALL_PREFIX} \
- ${GPU_ARCH} \
- -DDISABLE_DEPRECATION_WARNING=${BUILD_DISABLE_DEPRECATION_WARNING} \
- -DCMAKE_BUILD_TYPE=${BUILD_TYPE} ${REPODIR}/cpp
- make -j${PARALLEL_LEVEL} VERBOSE=${VERBOSE} ${INSTALL_TARGET}
+ -DCMAKE_CUDA_ARCHITECTURES=${CUGRAPH_CMAKE_CUDA_ARCHITECTURES} \
+ -DDISABLE_DEPRECATION_WARNING=${BUILD_DISABLE_DEPRECATION_WARNING} \
+ -DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
+ -DBUILD_STATIC_FAISS=${BUILD_STATIC_FAISS} \
+ -DBUILD_CUGRAPH_MG_TESTS=${BUILD_CPP_MG_TESTS} \
+ ${REPODIR}/cpp
+ cmake --build "${LIBCUGRAPH_BUILD_DIR}" -j${PARALLEL_LEVEL} --target ${INSTALL_TARGET} ${VERBOSE_FLAG}
fi
# Build and install the cugraph Python package
@@ -152,10 +192,11 @@ if buildAll || hasArg docs; then
cd ${LIBCUGRAPH_BUILD_DIR}
cmake -DCMAKE_INSTALL_PREFIX=${INSTALL_PREFIX} \
-DDISABLE_DEPRECATION_WARNING=${BUILD_DISABLE_DEPRECATION_WARNING} \
- -DCMAKE_BUILD_TYPE=${BUILD_TYPE} ${REPODIR}/cpp
+ -DCMAKE_BUILD_TYPE=${BUILD_TYPE} ${REPODIR}/cpp \
+ -DBUILD_STATIC_FAISS=${BUILD_STATIC_FAISS}
fi
cd ${LIBCUGRAPH_BUILD_DIR}
- make -j${PARALLEL_LEVEL} VERBOSE=${VERBOSE} docs_cugraph
- cd ${REPODIR}/docs
+ cmake --build "${LIBCUGRAPH_BUILD_DIR}" -j${PARALLEL_LEVEL} --target docs_cugraph ${VERBOSE_FLAG}
+ cd ${REPODIR}/docs/cugraph
make html
fi
diff --git a/ci/benchmark/build.sh b/ci/benchmark/build.sh
index 5f74dca4044..f8100222c12 100644
--- a/ci/benchmark/build.sh
+++ b/ci/benchmark/build.sh
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
-# Copyright (c) 2018-2020, NVIDIA CORPORATION.
+# Copyright (c) 2018-2021, NVIDIA CORPORATION.
##########################################
# cuGraph Benchmark test script for CI #
##########################################
@@ -20,18 +20,18 @@ function cleanup {
rm -f testoutput.txt
}
-# Set cleanup trap for Jenkins
-if [ ! -z "$JENKINS_HOME" ] ; then
- gpuci_logger "Jenkins environment detected, setting cleanup trap"
- trap cleanup EXIT
-fi
-
# Set path, build parallel level, and CUDA version
cd $WORKSPACE
export PATH=/opt/conda/bin:/usr/local/cuda/bin:$PATH
export PARALLEL_LEVEL=${PARALLEL_LEVEL:-4}
export CUDA_REL=${CUDA_VERSION%.*}
+# Set cleanup trap for Jenkins
+if [ ! -z "$JENKINS_HOME" ] ; then
+ gpuci_logger "Jenkins environment detected, setting cleanup trap"
+ trap cleanup EXIT
+fi
+
# Set home
export HOME=$WORKSPACE
@@ -68,13 +68,13 @@ CUGRAPH_DEPS=(cudf rmm)
LIBCUGRAPH_DEPS=(cudf rmm)
gpuci_logger "Install required packages"
-gpuci_conda_retry install -c nvidia -c rapidsai -c rapidsai-nightly -c conda-forge -c defaults \
+gpuci_conda_retry install -c nvidia -c rapidsai -c rapidsai-nightly -c conda-forge \
"cudf=${MINOR_VERSION}" \
"rmm=${MINOR_VERSION}" \
"cudatoolkit=$CUDA_REL" \
"dask-cudf=${MINOR_VERSION}" \
"dask-cuda=${MINOR_VERSION}" \
- "ucx-py=${MINOR_VERSION}" \
+ "ucx-py=0.21.*" \
"ucx-proc=*=gpu" \
"rapids-build-env=${MINOR_VERSION}" \
rapids-pytest-benchmark
diff --git a/ci/checks/style.sh b/ci/checks/style.sh
index 978ac03d85b..81388fa7b20 100755
--- a/ci/checks/style.sh
+++ b/ci/checks/style.sh
@@ -1,5 +1,5 @@
#!/bin/bash
-# Copyright (c) 2018-2020, NVIDIA CORPORATION.
+# Copyright (c) 2018-2021, NVIDIA CORPORATION.
########################
# cuGraph Style Tester #
########################
@@ -18,7 +18,8 @@ ERRORCODE=0
PATH=/conda/bin:$PATH
# Activate common conda env
-source activate gdf
+. /opt/conda/etc/profile.d/conda.sh
+conda activate rapids
# Run flake8 and get results/return code
FLAKE=`flake8 --config=python/.flake8 python`
@@ -52,13 +53,14 @@ COPYRIGHT=`env PYTHONPATH=ci/utils python ci/checks/copyright.py --git-modified-
CR_RETVAL=$?
ERRORCODE=$((ERRORCODE | ${CR_RETVAL}))
-# Output results if failure otherwise show pass
if [ "$CR_RETVAL" != "0" ]; then
echo -e "\n\n>>>> FAILED: copyright check; begin output\n\n"
echo -e "$COPYRIGHT"
echo -e "\n\n>>>> FAILED: copyright check; end output\n\n"
else
- echo -e "\n\n>>>> PASSED: copyright check\n\n"
+ echo -e "\n\n>>>> PASSED: copyright check; begin debug output\n\n"
+ echo -e "$COPYRIGHT"
+ echo -e "\n\n>>>> PASSED: copyright check; end debug output\n\n"
fi
exit ${ERRORCODE}
diff --git a/ci/cpu/build.sh b/ci/cpu/build.sh
index 2c6dc899be2..4f46938ee49 100755
--- a/ci/cpu/build.sh
+++ b/ci/cpu/build.sh
@@ -1,5 +1,5 @@
#!/bin/bash
-# Copyright (c) 2018-2020, NVIDIA CORPORATION.
+# Copyright (c) 2018-2021, NVIDIA CORPORATION.
#########################################
# cuGraph CPU conda build script for CI #
#########################################
@@ -24,6 +24,10 @@ fi
export GPUCI_CONDA_RETRY_MAX=1
export GPUCI_CONDA_RETRY_SLEEP=30
+# Use Ninja to build
+export CMAKE_GENERATOR="Ninja"
+export CONDA_BLD_DIR="${WORKSPACE}/.conda-bld"
+
################################################################################
# SETUP - Check environment
################################################################################
@@ -35,6 +39,11 @@ gpuci_logger "Activate conda env"
. /opt/conda/etc/profile.d/conda.sh
conda activate rapids
+# Remove rapidsai-nightly channel if we are building main branch
+if [ "$SOURCE_BRANCH" = "main" ]; then
+ conda config --system --remove channels rapidsai-nightly
+fi
+
gpuci_logger "Check versions"
python --version
$CC --version
@@ -55,18 +64,20 @@ conda config --set ssl_verify False
gpuci_logger "Build conda pkg for libcugraph"
if [ "$BUILD_LIBCUGRAPH" == '1' ]; then
if [[ -z "$PROJECT_FLASH" || "$PROJECT_FLASH" == "0" ]]; then
- conda build conda/recipes/libcugraph
+ gpuci_conda_retry build --no-build-id --croot ${CONDA_BLD_DIR} conda/recipes/libcugraph
else
- conda build --dirty --no-remove-work-dir conda/recipes/libcugraph
+ gpuci_conda_retry build --no-build-id --croot ${CONDA_BLD_DIR} --dirty --no-remove-work-dir conda/recipes/libcugraph
+ mkdir -p ${CONDA_BLD_DIR}/libcugraph/work
+ cp -r ${CONDA_BLD_DIR}/work/* ${CONDA_BLD_DIR}/libcugraph/work
fi
fi
gpuci_logger "Build conda pkg for cugraph"
if [ "$BUILD_CUGRAPH" == "1" ]; then
if [[ -z "$PROJECT_FLASH" || "$PROJECT_FLASH" == "0" ]]; then
- conda build conda/recipes/cugraph --python=$PYTHON
+ gpuci_conda_retry build --croot ${CONDA_BLD_DIR} 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
+ gpuci_conda_retry build --croot ${CONDA_BLD_DIR} conda/recipes/cugraph -c ci/artifacts/cugraph/cpu/.conda-bld/ --dirty --no-remove-work-dir --python=$PYTHON
fi
fi
diff --git a/ci/cpu/prebuild.sh b/ci/cpu/prebuild.sh
index ee471329b35..9f2629d153c 100644
--- a/ci/cpu/prebuild.sh
+++ b/ci/cpu/prebuild.sh
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
-# Copyright (c) 2018-2020, NVIDIA CORPORATION.
+# Copyright (c) 2018-2021, NVIDIA CORPORATION.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
@@ -18,12 +18,6 @@ if [[ -z "$PROJECT_FLASH" || "$PROJECT_FLASH" == "0" ]]; then
export BUILD_LIBCUGRAPH=1
fi
-if [[ "$CUDA" == "10.1" ]]; then
- export UPLOAD_CUGRAPH=1
-else
- export UPLOAD_CUGRAPH=0
-fi
-
if [[ "$PYTHON" == "3.7" ]]; then
export UPLOAD_LIBCUGRAPH=1
else
diff --git a/ci/cpu/upload.sh b/ci/cpu/upload.sh
index 0fca82216c3..11f28366c5f 100644
--- a/ci/cpu/upload.sh
+++ b/ci/cpu/upload.sh
@@ -1,4 +1,5 @@
#!/bin/bash
+# Copyright (c) 2018-2021, NVIDIA CORPORATION.
#
# Adopted from https://github.com/tmcdonell/travis-scripts/blob/dfaac280ac2082cd6bcaba3217428347899f2975/update-accelerate-buildbot.sh
@@ -29,8 +30,8 @@ fi
gpuci_logger "Get conda file output locations"
-export LIBCUGRAPH_FILE=`conda build conda/recipes/libcugraph --output`
-export CUGRAPH_FILE=`conda build conda/recipes/cugraph --python=$PYTHON --output`
+export LIBCUGRAPH_FILE=`conda build --no-build-id --croot ${CONDA_BLD_DIR} conda/recipes/libcugraph --output`
+export CUGRAPH_FILE=`conda build --croot ${CONDA_BLD_DIR} conda/recipes/cugraph --python=$PYTHON --output`
################################################################################
# UPLOAD - Conda packages
@@ -42,13 +43,13 @@ if [[ "$BUILD_LIBCUGRAPH" == "1" && "$UPLOAD_LIBCUGRAPH" == "1" ]]; then
test -e ${LIBCUGRAPH_FILE}
echo "Upload libcugraph"
echo ${LIBCUGRAPH_FILE}
- gpuci_retry anaconda -t ${MY_UPLOAD_KEY} upload -u ${CONDA_USERNAME:-rapidsai} ${LABEL_OPTION} --skip-existing ${LIBCUGRAPH_FILE}
+ gpuci_retry anaconda -t ${MY_UPLOAD_KEY} upload -u ${CONDA_USERNAME:-rapidsai} ${LABEL_OPTION} --skip-existing ${LIBCUGRAPH_FILE} --no-progress
fi
-if [[ "$BUILD_CUGRAPH" == "1" && "$UPLOAD_CUGRAPH" == "1" ]]; then
+if [[ "$BUILD_CUGRAPH" == "1" ]]; then
test -e ${CUGRAPH_FILE}
echo "Upload cugraph"
echo ${CUGRAPH_FILE}
- gpuci_retry anaconda -t ${MY_UPLOAD_KEY} upload -u ${CONDA_USERNAME:-rapidsai} ${LABEL_OPTION} --skip-existing ${CUGRAPH_FILE}
+ gpuci_retry anaconda -t ${MY_UPLOAD_KEY} upload -u ${CONDA_USERNAME:-rapidsai} ${LABEL_OPTION} --skip-existing ${CUGRAPH_FILE} --no-progress
fi
diff --git a/ci/docs/build.sh b/ci/docs/build.sh
index 6ce223d8b2b..2135ff04b45 100644
--- a/ci/docs/build.sh
+++ b/ci/docs/build.sh
@@ -1,5 +1,5 @@
#!/bin/bash
-# Copyright (c) 2020, NVIDIA CORPORATION.
+# Copyright (c) 2021, NVIDIA CORPORATION.
#################################
# cuGraph Docs build script for CI #
#################################
@@ -15,7 +15,6 @@ export PATH=/conda/bin:/usr/local/cuda/bin:$PATH
export HOME=$WORKSPACE
export PROJECT_WORKSPACE=/rapids/cugraph
export LIBCUDF_KERNEL_CACHE_PATH="$HOME/.jitify-cache"
-export NIGHTLY_VERSION=$(echo $BRANCH_VERSION | awk -F. '{print $2}')
export PROJECTS=(cugraph libcugraph)
gpuci_logger "Check environment"
@@ -28,11 +27,6 @@ gpuci_logger "Activate conda env"
. /opt/conda/etc/profile.d/conda.sh
conda activate rapids
-# TODO: Move installs to docs-build-env meta package
-gpuci_conda_retry install -c anaconda markdown beautifulsoup4 jq
-pip install sphinx-markdown-tables
-
-
gpuci_logger "Check versions"
python --version
$CC --version
@@ -47,10 +41,10 @@ conda list --show-channel-urls
gpuci_logger "Build Doxygen docs"
cd $PROJECT_WORKSPACE/cpp/build
make docs_cugraph
-
+
# Build Python docs
gpuci_logger "Build Sphinx docs"
-cd $PROJECT_WORKSPACE/docs
+cd $PROJECT_WORKSPACE/docs/cugraph
make html
#Commit to Website
@@ -60,10 +54,10 @@ for PROJECT in ${PROJECTS[@]}; do
if [ ! -d "api/$PROJECT/$BRANCH_VERSION" ]; then
mkdir -p api/$PROJECT/$BRANCH_VERSION
fi
- rm -rf $DOCS_WORKSPACE/api/$PROJECT/$BRANCH_VERSION/*
+ rm -rf $DOCS_WORKSPACE/api/$PROJECT/$BRANCH_VERSION/*
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
+mv $PROJECT_WORKSPACE/docs/cugraph/build/html/* $DOCS_WORKSPACE/api/cugraph/$BRANCH_VERSION
diff --git a/ci/getGTestTimes.sh b/ci/getGTestTimes.sh
deleted file mode 100755
index 8a3752d76e2..00000000000
--- a/ci/getGTestTimes.sh
+++ /dev/null
@@ -1,46 +0,0 @@
-#!/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
-# printing all tests grouped by test binary with tests sorted by runtime within
-# the group.
-#
-# To use this script, capture the test run output to a file then run this script
-# with the file as the first arg, or just redirect test output to this script.
-
-awk '/^Running GoogleTest .+$/ {
- testbinary = $3
- }
- /^\[ OK \].+$/ {
- testtime = substr($(NF-1),2)
- newtestdata = testbinary ":" substr($0,14)
- alltestdata = alltestdata newtestdata "\n"
- testdata[testbinary] = testdata[testbinary] newtestdata "\n"
- totaltime = totaltime + testtime
- }
- END {
- # Print all tests sorted by time
- system("echo \"" alltestdata "\" | sort -r -t\\( -nk2")
- print "\n================================================================================"
- # Print test binaries with tests sorted by time
- print "Tests grouped by test binary:"
- for (testbinary in testdata) {
- print testbinary
- system("echo \"" testdata[testbinary] "\" | sort -r -t\\( -nk2")
- }
- print "\n================================================================================"
- print totaltime " milliseconds = " totaltime/60000 " minutes"
- }
-' $1
diff --git a/ci/gpu/build.sh b/ci/gpu/build.sh
index 9dd6e14181e..02e139fc05e 100755
--- a/ci/gpu/build.sh
+++ b/ci/gpu/build.sh
@@ -1,10 +1,10 @@
#!/usr/bin/env bash
-# Copyright (c) 2018-2020, NVIDIA CORPORATION.
+# Copyright (c) 2018-2021, NVIDIA CORPORATION.
##########################################
# cuGraph GPU build & testscript for CI #
##########################################
-set -e
-set -o pipefail
+set -e # abort the script on error, this will change for running tests (see below)
+set -o pipefail # piped commands propagate their error
NUMARGS=$#
ARGS=$*
@@ -16,6 +16,7 @@ function hasArg {
export PATH=/opt/conda/bin:/usr/local/cuda/bin:$PATH
export PARALLEL_LEVEL=${PARALLEL_LEVEL:-4}
export CUDA_REL=${CUDA_VERSION%.*}
+export CONDA_ARTIFACT_PATH=${WORKSPACE}/ci/artifacts/cugraph/cpu/.conda-bld/
function cleanup {
gpuci_logger "Removing datasets and temp files"
@@ -61,7 +62,7 @@ gpuci_conda_retry install -y \
"cudatoolkit=$CUDA_REL" \
"dask-cudf=${MINOR_VERSION}" \
"dask-cuda=${MINOR_VERSION}" \
- "ucx-py=${MINOR_VERSION}" \
+ "ucx-py=0.21.*" \
"ucx-proc=*=gpu" \
"rapids-build-env=$MINOR_VERSION.*" \
"rapids-notebook-env=$MINOR_VERSION.*" \
@@ -71,10 +72,6 @@ gpuci_conda_retry install -y \
# gpuci_conda_retry remove --force rapids-build-env rapids-notebook-env
# gpuci_conda_retry install -y "your-pkg=1.0.0"
-gpuci_logger "Install the master version of dask and distributed"
-pip install "git+https://github.com/dask/distributed.git" --upgrade --no-deps
-pip install "git+https://github.com/dask/dask.git" --upgrade --no-deps
-
gpuci_logger "Check versions"
python --version
$CC --version
@@ -90,18 +87,44 @@ conda list --show-channel-urls
################################################################################
if [[ -z "$PROJECT_FLASH" || "$PROJECT_FLASH" == "0" ]]; then
- gpuci_logger "Build from source"
- $WORKSPACE/build.sh -v clean libcugraph cugraph --allgpuarch
+ gpuci_logger "Build from source"
+ $WORKSPACE/build.sh -v clean libcugraph cugraph
+else
+ export LIBCUGRAPH_BUILD_DIR="$WORKSPACE/ci/artifacts/cugraph/cpu/conda_work/cpp/build"
+
+ # Faiss patch
+ echo "Update libcugraph.so"
+ cd $LIBCUGRAPH_BUILD_DIR
+ chrpath -d libcugraph.so
+ patchelf --replace-needed `patchelf --print-needed libcugraph.so | grep faiss` libfaiss.so libcugraph.so
+
+ CONDA_FILE=`find ${CONDA_ARTIFACT_PATH} -name "libcugraph*.tar.bz2"`
+ CONDA_FILE=`basename "$CONDA_FILE" .tar.bz2` #get filename without extension
+ CONDA_FILE=${CONDA_FILE//-/=} #convert to conda install
+ echo "Installing $CONDA_FILE"
+ conda install -c ${CONDA_ARTIFACT_PATH} "$CONDA_FILE"
+
+ gpuci_logger "Install the master version of dask and distributed"
+ pip install "git+https://github.com/dask/distributed.git" --upgrade --no-deps
+ pip install "git+https://github.com/dask/dask.git" --upgrade --no-deps
+
+ echo "Build cugraph..."
+ $WORKSPACE/build.sh cugraph
fi
################################################################################
# TEST - Run GoogleTest and py.tests for libcugraph and cuGraph
################################################################################
-set +e -Eo pipefail
-EXITCODE=0
+# Switch to +e to allow failing commands to continue the script, which is needed
+# so all testing commands run regardless of pass/fail. This requires the desired
+# exit code to be managed using the ERR trap.
+set +e # allow script to continue on error
+set -E # ERR traps are inherited by subcommands
trap "EXITCODE=1" ERR
+EXITCODE=0
+
if hasArg --skip-tests; then
gpuci_logger "Skipping Tests"
else
@@ -117,18 +140,19 @@ else
TEST_MODE_FLAG=""
fi
+ gpuci_logger "Running cuGraph test.sh..."
${WORKSPACE}/ci/test.sh ${TEST_MODE_FLAG} | tee testoutput.txt
+ gpuci_logger "Ran cuGraph test.sh : return code was: $?, gpu/build.sh exit code is now: $EXITCODE"
- echo -e "\nTOP 20 SLOWEST TESTS:\n"
- # Wrap in echo to prevent non-zero exit since this command is non-essential
- echo "$(${WORKSPACE}/ci/getGTestTimes.sh testoutput.txt | head -20)"
-
+ gpuci_logger "Running cuGraph notebook test script..."
${WORKSPACE}/ci/gpu/test-notebooks.sh 2>&1 | tee nbtest.log
+ gpuci_logger "Ran cuGraph notebook test script : return code was: $?, gpu/build.sh exit code is now: $EXITCODE"
python ${WORKSPACE}/ci/utils/nbtestlog2junitxml.py nbtest.log
fi
-if [ -n "\${CODECOV_TOKEN}" ]; then
- codecov -t \$CODECOV_TOKEN
+if [ -n "${CODECOV_TOKEN}" ]; then
+ codecov -t $CODECOV_TOKEN
fi
+gpuci_logger "gpu/build.sh returning value: $EXITCODE"
return ${EXITCODE}
diff --git a/ci/gpu/notebook_list.py b/ci/gpu/notebook_list.py
new file mode 100644
index 00000000000..23a198830a8
--- /dev/null
+++ b/ci/gpu/notebook_list.py
@@ -0,0 +1,56 @@
+# Copyright (c) 2021, NVIDIA CORPORATION.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# 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 re
+import sys
+import glob
+
+from numba import cuda
+
+cuda_version_string = ".".join([str(n) for n in cuda.runtime.get_version()])
+#
+# Not strictly true... however what we mean is
+# Pascal or earlier
+#
+pascal = False
+device = cuda.get_current_device()
+# check for the attribute using both pre and post numba 0.53 names
+cc = getattr(device, 'COMPUTE_CAPABILITY', None) or \
+ getattr(device, 'compute_capability')
+if (cc[0] < 7):
+ pascal = True
+
+for filename in glob.iglob('**/*.ipynb', recursive=True):
+ skip = False
+ for line in open(filename, 'r'):
+ if re.search('# Skip notebook test', line):
+ skip = True
+ print(f'SKIPPING {filename} (marked as skip)', file=sys.stderr)
+ break;
+ elif re.search('dask', line):
+ print(f'SKIPPING {filename} (suspected Dask usage, not currently automatable)', file=sys.stderr)
+ skip = True
+ break;
+ elif pascal and re.search('# Does not run on Pascal', line):
+ print(f'SKIPPING {filename} (does not run on Pascal)', file=sys.stderr)
+ skip = True
+ break;
+ elif re.search('# Does not run on CUDA ', line) and \
+ (cuda_version_string in line):
+ print(f'SKIPPING {filename} (does not run on CUDA {cuda_version_string})',
+ file=sys.stderr)
+ skip = True
+ break;
+
+ if not skip:
+ print(filename)
diff --git a/ci/gpu/test-notebooks.sh b/ci/gpu/test-notebooks.sh
index 389d3be0bfd..650132f116d 100755
--- a/ci/gpu/test-notebooks.sh
+++ b/ci/gpu/test-notebooks.sh
@@ -1,5 +1,5 @@
#!/bin/bash
-# Copyright (c) 2019-2020, NVIDIA CORPORATION.
+# Copyright (c) 2019-2021, NVIDIA CORPORATION.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
@@ -12,23 +12,27 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-#RAPIDS_DIR=/rapids
+# Any failing command will set EXITCODE to non-zero
+set -e # abort the script on error, this will change for running tests (see below)
+set -o pipefail # piped commands propagate their error
+set -E # ERR traps are inherited by subcommands
+trap "EXITCODE=1" ERR
+
NOTEBOOKS_DIR=${WORKSPACE}/notebooks
NBTEST=${WORKSPACE}/ci/utils/nbtest.sh
LIBCUDF_KERNEL_CACHE_PATH=${WORKSPACE}/.jitcache
+EXITCODE=0
cd ${NOTEBOOKS_DIR}
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 bfs_benchmark.ipynb louvain_benchmark.ipynb pagerank_benchmark.ipynb sssp_benchmark.ipynb release.ipynb nx_cugraph_bc_benchmarking.ipynb"
-
## Check env
env
-EXITCODE=0
+# Do not abort the script on error. This allows all tests to run regardless of
+# pass/fail but relies on the ERR trap above to manage the EXITCODE for the
+# script.
+set +e
# Always run nbtest in all TOPLEVEL_NB_FOLDERS, set EXITCODE to failure
# if any run fails
@@ -37,29 +41,20 @@ for folder in ${TOPLEVEL_NB_FOLDERS}; do
echo "FOLDER: ${folder}"
echo "========================================"
cd ${NOTEBOOKS_DIR}/${folder}
- for nb in $(find . -name "*.ipynb"); do
+ NBLIST=$(python ${WORKSPACE}/ci/gpu/notebook_list.py)
+ for nb in ${NBLIST}; do
nbBasename=$(basename ${nb})
- # Skip all NBs that use dask (in the code or even in their name)
- if ((echo ${nb}|grep -qi dask) || \
- (grep -q dask ${nb})); then
- echo "--------------------------------------------------------------------------------"
- echo "SKIPPING: ${nb} (suspected Dask usage, not currently automatable)"
- echo "--------------------------------------------------------------------------------"
- elif (echo " ${SKIPNBS} " | grep -q " ${nbBasename} "); then
- echo "--------------------------------------------------------------------------------"
- echo "SKIPPING: ${nb} (listed in skip list)"
- echo "--------------------------------------------------------------------------------"
- else
- cd $(dirname ${nb})
- nvidia-smi
- ${NBTEST} ${nbBasename}
- EXITCODE=$((EXITCODE | $?))
- rm -rf ${LIBCUDF_KERNEL_CACHE_PATH}/*
- cd ${NOTEBOOKS_DIR}/${folder}
- fi
+ cd $(dirname ${nb})
+ nvidia-smi
+ ${NBTEST} ${nbBasename}
+ echo "Ran nbtest for $nb : return code was: $?, test script exit code is now: $EXITCODE"
+ echo
+ rm -rf ${LIBCUDF_KERNEL_CACHE_PATH}/*
+ cd ${NOTEBOOKS_DIR}/${folder}
done
done
nvidia-smi
+echo "Notebook test script exiting with value: $EXITCODE"
exit ${EXITCODE}
diff --git a/ci/release/update-version.sh b/ci/release/update-version.sh
index d853c3693c6..2ff14c6c6e9 100755
--- a/ci/release/update-version.sh
+++ b/ci/release/update-version.sh
@@ -1,5 +1,5 @@
#!/bin/bash
-# Copyright (c) 2018-2020, NVIDIA CORPORATION.
+# Copyright (c) 2018-2021, NVIDIA CORPORATION.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
@@ -13,42 +13,25 @@
# limitations under the License.
## Usage
-# bash update-version.sh
-# where is either `major`, `minor`, `patch`
+# bash update-version.sh
-set -e
-# Grab argument for release type
-RELEASE_TYPE=$1
+# Format is YY.MM.PP - no leading 'v' or trailing 'a'
+NEXT_FULL_TAG=$1
-# Get current version and calculate next versions
-CURRENT_TAG=`git tag | grep -xE 'v[0-9\.]+' | sort --version-sort | tail -n 1 | tr -d 'v'`
-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]}'`
+# Get current version
+CURRENT_TAG=$(git tag --merged HEAD | grep -xE '^v.*' | sort --version-sort | tail -n 1 | tr -d 'v')
+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))
-NEXT_FULL_TAG=""
-NEXT_SHORT_TAG=""
-# Determine release type
-if [ "$RELEASE_TYPE" == "major" ]; then
- NEXT_FULL_TAG="${NEXT_MAJOR}.0.0"
- NEXT_SHORT_TAG="${NEXT_MAJOR}.0"
-elif [ "$RELEASE_TYPE" == "minor" ]; then
- NEXT_FULL_TAG="${CURRENT_MAJOR}.${NEXT_MINOR}.0"
- NEXT_SHORT_TAG="${CURRENT_MAJOR}.${NEXT_MINOR}"
-elif [ "$RELEASE_TYPE" == "patch" ]; then
- NEXT_FULL_TAG="${CURRENT_MAJOR}.${CURRENT_MINOR}.${NEXT_PATCH}"
- NEXT_SHORT_TAG="${CURRENT_MAJOR}.${CURRENT_MINOR}"
-else
- echo "Incorrect release type; use 'major', 'minor', or 'patch' as an argument"
- exit 1
-fi
+#Get . for next version
+NEXT_MAJOR=$(echo $NEXT_FULL_TAG | awk '{split($0, a, "."); print a[1]}')
+NEXT_MINOR=$(echo $NEXT_FULL_TAG | awk '{split($0, a, "."); print a[2]}')
+NEXT_SHORT_TAG=${NEXT_MAJOR}.${NEXT_MINOR}
-echo "Preparing '$RELEASE_TYPE' release [$CURRENT_TAG -> $NEXT_FULL_TAG]"
+echo "Preparing release $CURRENT_TAG => $NEXT_FULL_TAG"
# Inplace sed replace; workaround for Linux and Mac
function sed_runner() {
@@ -59,13 +42,13 @@ function sed_runner() {
sed_runner 's/'"CUGRAPH VERSION .* LANGUAGES C CXX CUDA)"'/'"CUGRAPH VERSION ${NEXT_FULL_TAG} LANGUAGES C CXX CUDA)"'/g' cpp/CMakeLists.txt
# 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
+sed_runner 's/version = .*/version = '"'${NEXT_SHORT_TAG}'"'/g' docs/cugraph/source/conf.py
+sed_runner 's/release = .*/release = '"'${NEXT_FULL_TAG}'"'/g' docs/cugraph/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};
+ sed_runner "s/cuxfilter=${CURRENT_SHORT_TAG}/cuxfilter=${NEXT_SHORT_TAG}/g" ${FILE};
done
diff --git a/ci/test.sh b/ci/test.sh
index db9390461c0..31660cd15ec 100755
--- a/ci/test.sh
+++ b/ci/test.sh
@@ -1,5 +1,5 @@
#!/bin/bash
-# Copyright (c) 2019-2020, NVIDIA CORPORATION.
+# Copyright (c) 2019-2021, NVIDIA CORPORATION.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
@@ -12,9 +12,11 @@
# 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
-set -o pipefail
+# Any failing command will set EXITCODE to non-zero
+set -e # abort the script on error, this will change for running tests (see below)
+set -o pipefail # piped commands propagate their error
+set -E # ERR traps are inherited by subcommands
+trap "EXITCODE=1" ERR
NUMARGS=$#
ARGS=$*
@@ -22,7 +24,7 @@ THISDIR=$(cd $(dirname $0);pwd)
CUGRAPH_ROOT=$(cd ${THISDIR}/..;pwd)
GTEST_ARGS="--gtest_output=xml:${CUGRAPH_ROOT}/test-results/"
DOWNLOAD_MODE=""
-ERRORCODE=0
+EXITCODE=0
export RAPIDS_DATASET_ROOT_DIR=${CUGRAPH_ROOT}/datasets
@@ -50,47 +52,41 @@ else
echo "Download datasets..."
cd ${RAPIDS_DATASET_ROOT_DIR}
bash ./get_test_data.sh ${DOWNLOAD_MODE}
- ERRORCODE=$((ERRORCODE | $?))
- # no need to run tests if dataset download fails
- if (( ${ERRORCODE} != 0 )); then
- exit ${ERRORCODE}
- fi
fi
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"
+ export LD_LIBRARY_PATH="$WORKSPACE/ci/artifacts/cugraph/cpu/conda_work/cpp/build:$CONDA_PREFIX/lib:$LD_LIBRARY_PATH"
cd $WORKSPACE/ci/artifacts/cugraph/cpu/conda_work/cpp/build
fi
-for gt in gtests/*; do
- test_name=$(basename $gt)
- echo "Running GoogleTest $test_name"
- ${gt} ${GTEST_FILTER} ${GTEST_ARGS}
- ERRORCODE=$((ERRORCODE | $?))
-done
+# Do not abort the script on error from this point on. This allows all tests to
+# run regardless of pass/fail, but relies on the ERR trap above to manage the
+# EXITCODE for the script.
+set +e
-if [[ "$PROJECT_FLASH" == "1" ]]; then
- CONDA_FILE=`find $WORKSPACE/ci/artifacts/cugraph/cpu/conda-bld/ -name "libcugraph*.tar.bz2"`
- CONDA_FILE=`basename "$CONDA_FILE" .tar.bz2` #get filename without extension
- CONDA_FILE=${CONDA_FILE//-/=} #convert to conda install
- echo "Installing $CONDA_FILE"
- conda install -c $WORKSPACE/ci/artifacts/cugraph/cpu/conda-bld/ "$CONDA_FILE"
-
- export LIBCUGRAPH_BUILD_DIR="$WORKSPACE/ci/artifacts/cugraph/cpu/conda_work/cpp/build"
- echo "Build cugraph..."
- $WORKSPACE/build.sh cugraph
+if (python ${CUGRAPH_ROOT}/ci/utils/is_pascal.py); then
+ echo "WARNING: skipping C++ tests on Pascal GPU arch."
+else
+ echo "C++ gtests for cuGraph..."
+ for gt in tests/*_TEST; do
+ test_name=$(basename $gt)
+ echo "Running gtest $test_name"
+ ${gt} ${GTEST_FILTER} ${GTEST_ARGS}
+ echo "Ran gtest $test_name : return code was: $?, test script exit code is now: $EXITCODE"
+ done
fi
echo "Python pytest for cuGraph..."
cd ${CUGRAPH_ROOT}/python
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 --benchmark-disable
-ERRORCODE=$((ERRORCODE | $?))
+echo "Ran Python pytest for cugraph : return code was: $?, test script exit code is now: $EXITCODE"
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 | $?))
+echo "Ran Python benchmarks for cuGraph (running as tests) : return code was: $?, test script exit code is now: $EXITCODE"
-exit ${ERRORCODE}
+echo "Test script exiting with value: $EXITCODE"
+exit ${EXITCODE}
diff --git a/ci/utils/git_helpers.py b/ci/utils/git_helpers.py
index 83ad73fe283..a0c413b75f4 100644
--- a/ci/utils/git_helpers.py
+++ b/ci/utils/git_helpers.py
@@ -1,4 +1,4 @@
-# Copyright (c) 2019-2020, NVIDIA CORPORATION.
+# Copyright (c) 2019-2021, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -59,14 +59,24 @@ def uncommittedFiles():
return ret
-def changedFilesBetween(b1, b2):
- """Returns a list of files changed between branches b1 and b2"""
+def changedFilesBetween(baseName, branchName, commitHash):
+ """
+ Returns a list of files changed between branches baseName and latest commit
+ of branchName.
+ """
current = branch()
- __git("checkout", "--quiet", b1)
- __git("checkout", "--quiet", b2)
- files = __gitdiff("--name-only", "--ignore-submodules", "%s...%s" %
- (b1, b2))
- __git("checkout", "--quiet", current)
+ # checkout "base" branch
+ __git("checkout", "--force", baseName)
+ # checkout branch for comparing
+ __git("checkout", "--force", branchName)
+ # checkout latest commit from branch
+ __git("checkout", "-fq", commitHash)
+
+ files = __gitdiff("--name-only", "--ignore-submodules",
+ f"{baseName}..{branchName}")
+
+ # restore the original branch
+ __git("checkout", "--force", current)
return files.splitlines()
@@ -87,10 +97,10 @@ def changesInFileBetween(file, b1, b2, pathFilter=None):
def modifiedFiles(pathFilter=None):
"""
- If inside a CI-env (ie. currentBranch=current-pr-branch and the env-var
- PR_TARGET_BRANCH is defined), then lists out all files modified between
- these 2 branches. Else, lists out all the uncommitted files in the current
- branch.
+ If inside a CI-env (ie. TARGET_BRANCH and COMMIT_HASH are defined, and
+ current branch is "current-pr-branch"), then lists out all files modified
+ between these 2 branches. Else, lists out all the uncommitted files in the
+ current branch.
Such utility function is helpful while putting checker scripts as part of
cmake, as well as CI process. This way, during development, only the files
@@ -98,15 +108,26 @@ def modifiedFiles(pathFilter=None):
process ALL files modified by the dev, as submiited in the PR, will be
checked. This happens, all the while using the same script.
"""
- if "PR_TARGET_BRANCH" in os.environ and branch() == "current-pr-branch":
- allFiles = changedFilesBetween(os.environ["PR_TARGET_BRANCH"],
- branch())
+ targetBranch = os.environ.get("TARGET_BRANCH")
+ commitHash = os.environ.get("COMMIT_HASH")
+ currentBranch = branch()
+ print(f" [DEBUG] TARGET_BRANCH={targetBranch}, COMMIT_HASH={commitHash}, "
+ f"currentBranch={currentBranch}")
+
+ if targetBranch and commitHash and (currentBranch == "current-pr-branch"):
+ print(" [DEBUG] Assuming a CI environment.")
+ allFiles = changedFilesBetween(targetBranch, currentBranch, commitHash)
else:
+ print(" [DEBUG] Did not detect CI environment.")
allFiles = uncommittedFiles()
+
files = []
for f in allFiles:
if pathFilter is None or pathFilter(f):
files.append(f)
+
+ filesToCheckString = "\n\t".join(files) if files else ""
+ print(f" [DEBUG] Found files to check:\n\t{filesToCheckString}\n")
return files
diff --git a/ci/utils/is_pascal.py b/ci/utils/is_pascal.py
new file mode 100644
index 00000000000..e55a3153a12
--- /dev/null
+++ b/ci/utils/is_pascal.py
@@ -0,0 +1,39 @@
+# Copyright (c) 2021, NVIDIA CORPORATION.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# 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 re
+import sys
+import glob
+
+from numba import cuda
+
+# FIXME: consolidate this code with ci/gpu/notebook_list.py
+
+#
+# Not strictly true... however what we mean is
+# Pascal or earlier
+#
+pascal = False
+
+device = cuda.get_current_device()
+# check for the attribute using both pre and post numba 0.53 names
+cc = getattr(device, 'COMPUTE_CAPABILITY', None) or \
+ getattr(device, 'compute_capability')
+if (cc[0] < 7):
+ pascal = True
+
+# Return zero (success) if pascal is True
+if pascal:
+ sys.exit(0)
+else:
+ sys.exit(1)
diff --git a/ci/utils/nbtest.sh b/ci/utils/nbtest.sh
index 8c86baeaa09..ae8b52df106 100755
--- a/ci/utils/nbtest.sh
+++ b/ci/utils/nbtest.sh
@@ -1,5 +1,5 @@
#!/bin/bash
-# Copyright (c) 2019-2020, NVIDIA CORPORATION.
+# Copyright (c) 2019-2021, NVIDIA CORPORATION.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
@@ -12,6 +12,19 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+# Any failing command will set EXITCODE to non-zero
+set +e # do not abort the script on error
+set -o pipefail # piped commands propagate their error
+set -E # ERR traps are inherited by subcommands
+trap "EXITCODE=1" ERR
+
+# Prepend the following code to all scripts generated from nbconvert. This
+# allows all cell and line magic code to run and update the namespace as if
+# running in jupyter, but will also tolerate failures due to running in a
+# non-jupyter env.
+# Note: depending on the assumptions of the notebook script, ignoring failures
+# may not be acceptable (meaning the converted notebook simply cannot run
+# outside of jupyter as-is), hence the warning.
MAGIC_OVERRIDE_CODE="
def my_run_line_magic(*args, **kwargs):
g=globals()
@@ -58,7 +71,6 @@ for nb in $*; do
NBEXITCODE=$?
echo EXIT CODE: ${NBEXITCODE}
echo
- EXITCODE=$((EXITCODE | ${NBEXITCODE}))
done
exit ${EXITCODE}
diff --git a/conda/environments/builddocs.yml b/conda/environments/builddocs.yml
deleted file mode 100644
index 89bd44a5542..00000000000
--- a/conda/environments/builddocs.yml
+++ /dev/null
@@ -1,19 +0,0 @@
-name: builddocs
-channels:
-- rapidsai
-- pytorch
-- conda-forge
-- numba
-- defaults
-dependencies:
-- python=3.6*
-- cugraph=0.8*
-- cudatoolkit=9.2
-- cudf=0.8*
-- pyarrow=0.12.1.*
-- cython=0.29*
-- pip:
- - numpydoc
- - sphinx
- - sphinx-rtd-theme
- - sphinxcontrib-websupport
diff --git a/conda/environments/cugraph_dev_cuda10.2.yml b/conda/environments/cugraph_dev_cuda10.2.yml
deleted file mode 100644
index 6526dd73f98..00000000000
--- a/conda/environments/cugraph_dev_cuda10.2.yml
+++ /dev/null
@@ -1,47 +0,0 @@
-name: cugraph_dev
-channels:
-- rapidsai
-- nvidia
-- rapidsai-nightly
-- conda-forge
-dependencies:
-- cudf=0.17.*
-- libcudf=0.17.*
-- rmm=0.17.*
-- cuxfilter=0.17.*
-- librmm=0.17.*
-- dask>=2.12.0
-- distributed>=2.12.0
-- dask-cuda=0.17*
-- dask-cudf=0.17*
-- nccl>=2.7
-- ucx-py=0.17*
-- ucx-proc=*=gpu
-- scipy
-- networkx
-- python-louvain
-- cudatoolkit=10.2
-- clang=8.0.1
-- clang-tools=8.0.1
-- cmake>=3.12
-- python>=3.6,<3.9
-- notebook>=0.5.0
-- boost
-- cython>=0.29,<0.30
-- pytest
-- scikit-learn>=0.23.1
-- colorcet
-- holoviews
-- datashader
-- sphinx
-- sphinx_rtd_theme
-- sphinxcontrib-websupport
-- sphinx-markdown-tables
-- nbsphinx
-- numpydoc
-- ipython
-- recommonmark
-- pip
-- libcypher-parser
-- rapids-pytest-benchmark
-- doxygen
diff --git a/conda/environments/cugraph_dev_cuda11.0.yml b/conda/environments/cugraph_dev_cuda11.0.yml
index 5016eb9405c..d19ac1bd00e 100644
--- a/conda/environments/cugraph_dev_cuda11.0.yml
+++ b/conda/environments/cugraph_dev_cuda11.0.yml
@@ -5,43 +5,43 @@ channels:
- rapidsai-nightly
- conda-forge
dependencies:
-- cudf=0.17.*
-- libcudf=0.17.*
-- rmm=0.17.*
-- cuxfilter=0.17.*
-- librmm=0.17.*
-- dask>=2.12.0
-- distributed>=2.12.0
-- dask-cuda=0.17*
-- dask-cudf=0.17*
-- nccl>=2.7
-- ucx-py=0.17*
+- cudatoolkit=11.0
+- cudf=21.08.*
+- libcudf=21.08.*
+- rmm=21.08.*
+- librmm=21.08.*
+- dask>=2021.6.0,<=2021.07.1
+- distributed>=2021.6.0,<=2021.07.1
+- dask-cuda=21.08.*
+- dask-cudf=21.08.*
+- nccl>=2.9.9
+- ucx-py=0.21.*
- ucx-proc=*=gpu
- scipy
-- networkx
-- python-louvain
-- cudatoolkit=11.0
-- clang=8.0.1
-- clang-tools=8.0.1
-- cmake>=3.12
+- networkx>=2.5.1
+- clang=11.0.0
+- clang-tools=11.0.0
+- cmake>=3.20.1
- python>=3.6,<3.9
- notebook>=0.5.0
- boost
- cython>=0.29,<0.30
- pytest
+- libfaiss=1.7.0
+- faiss-proc=*=cuda
- scikit-learn>=0.23.1
-- colorcet
-- datashader
-- holoviews
- sphinx
- sphinx_rtd_theme
- sphinxcontrib-websupport
- sphinx-markdown-tables
+- sphinx-copybutton
- nbsphinx
- numpydoc
- ipython
- recommonmark
- pip
-- libcypher-parser
- rapids-pytest-benchmark
- doxygen
+- pytest-cov
+- gtest
+- gmock
diff --git a/conda/environments/cugraph_dev_cuda10.1.yml b/conda/environments/cugraph_dev_cuda11.2.yml
similarity index 50%
rename from conda/environments/cugraph_dev_cuda10.1.yml
rename to conda/environments/cugraph_dev_cuda11.2.yml
index 9b4274abef5..7d2f3d26ef5 100644
--- a/conda/environments/cugraph_dev_cuda10.1.yml
+++ b/conda/environments/cugraph_dev_cuda11.2.yml
@@ -5,43 +5,43 @@ channels:
- rapidsai-nightly
- conda-forge
dependencies:
-- cudf=0.17.*
-- libcudf=0.17.*
-- rmm=0.17.*
-- cuxfilter=0.17.*
-- librmm=0.17.*
-- dask>=2.12.0
-- distributed>=2.12.0
-- dask-cuda=0.17*
-- dask-cudf=0.17*
-- nccl>=2.7
-- ucx-py=0.17*
+- cudatoolkit=11.2
+- cudf=21.08.*
+- libcudf=21.08.*
+- rmm=21.08.*
+- librmm=21.08.*
+- dask>=2021.6.0,<=2021.07.1
+- distributed>=2021.6.0,<=2021.07.1
+- dask-cuda=21.08.*
+- dask-cudf=21.08.*
+- nccl>=2.9.9
+- ucx-py=0.21.*
- ucx-proc=*=gpu
- scipy
-- networkx
-- python-louvain
-- cudatoolkit=10.1
-- clang=8.0.1
-- clang-tools=8.0.1
-- cmake>=3.12
+- networkx>=2.5.1
+- clang=11.0.0
+- clang-tools=11.0.0
+- cmake>=3.20.1
- python>=3.6,<3.9
- notebook>=0.5.0
- boost
- cython>=0.29,<0.30
- pytest
+- libfaiss=1.7.0
+- faiss-proc=*=cuda
- scikit-learn>=0.23.1
-- colorcet
-- holoviews
-- datashader
- sphinx
- sphinx_rtd_theme
- sphinxcontrib-websupport
- sphinx-markdown-tables
+- sphinx-copybutton
- nbsphinx
- numpydoc
- ipython
- recommonmark
- pip
-- libcypher-parser
- rapids-pytest-benchmark
- doxygen
+- pytest-cov
+- gtest
+- gmock
diff --git a/conda/recipes/cugraph/meta.yaml b/conda/recipes/cugraph/meta.yaml
index 90f5bed942a..b335ec7753e 100644
--- a/conda/recipes/cugraph/meta.yaml
+++ b/conda/recipes/cugraph/meta.yaml
@@ -1,20 +1,21 @@
-# Copyright (c) 2018, NVIDIA CORPORATION.
+# Copyright (c) 2018-2021, NVIDIA CORPORATION.
# Usage:
-# conda build -c nvidia -c rapidsai -c conda-forge -c defaults .
+# conda build -c nvidia -c rapidsai -c conda-forge .
{% 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 cuda_version='.'.join(environ.get('CUDA', 'unknown').split('.')[:2]) %}
{% set py_version=environ.get('CONDA_PY', 36) %}
package:
name: cugraph
version: {{ version }}
source:
- path: ../../..
+ git_url: ../../..
build:
number: {{ GIT_DESCRIBE_NUMBER }}
- string: py{{ py_version }}_{{ GIT_DESCRIBE_HASH }}_{{ GIT_DESCRIBE_NUMBER }}
+ string: cuda{{ cuda_version }}_py{{ py_version }}_{{ GIT_DESCRIBE_HASH }}_{{ GIT_DESCRIBE_NUMBER }}
script_env:
- CC
- CXX
@@ -27,27 +28,23 @@ requirements:
- cython>=0.29,<0.30
- libcugraph={{ version }}
- cudf={{ minor_version }}
- - ucx-py {{ minor_version }}
+ - ucx-py 0.21
- ucx-proc=*=gpu
+ - cudatoolkit {{ cuda_version }}.*
run:
- python x.x
- libcugraph={{ version }}
- cudf={{ minor_version }}
- dask-cudf {{ minor_version }}
- dask-cuda {{ minor_version }}
- - dask>=2.12.0
- - distributed>=2.12.0
- - nccl>=2.7
- - ucx-py {{ minor_version }}
+ - dask>=2021.6.0,<=2021.07.1
+ - distributed>=2021.6.0,<=2021.07.1
+ - ucx-py 0.21
- ucx-proc=*=gpu
-
-#test:
-# commands:
-# - test -f $PREFIX/include/cugraph.h
-
+ - {{ pin_compatible('cudatoolkit', max_pin='x.x') }}
about:
home: http://rapids.ai/
license: Apache-2.0
license_file: ../../../LICENSE
- summary: libcugraph library
+ summary: cuGraph library
diff --git a/conda/recipes/libcugraph/meta.yaml b/conda/recipes/libcugraph/meta.yaml
index 211ec920d27..570a0ec09b2 100644
--- a/conda/recipes/libcugraph/meta.yaml
+++ b/conda/recipes/libcugraph/meta.yaml
@@ -1,7 +1,7 @@
-# Copyright (c) 2018, NVIDIA CORPORATION.
+# Copyright (c) 2018-2021, NVIDIA CORPORATION.
# Usage:
-# conda build -c nvidia -c rapidsai -c conda-forge -c defaults .
+# conda build -c nvidia -c rapidsai -c conda-forge .
{% 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 cuda_version='.'.join(environ.get('CUDA', '9.2').split('.')[:2]) %}
@@ -21,28 +21,32 @@ build:
- CUDAHOSTCXX
- PARALLEL_LEVEL
- VERSION_SUFFIX
+ - CCACHE_DIR
+ - CCACHE_NOHASHDIR
+ - CCACHE_COMPILERCHECK
+ - CMAKE_GENERATOR
+ - CMAKE_C_COMPILER_LAUNCHER
+ - CMAKE_CXX_COMPILER_LAUNCHER
+ - CMAKE_CUDA_COMPILER_LAUNCHER
requirements:
build:
- - cmake>=3.12.4
- - libcudf={{ minor_version }}
+ - cmake>=3.20.1
- cudatoolkit {{ cuda_version }}.*
+ - librmm {{ minor_version }}.*
- boost-cpp>=1.66
- - libcypher-parser
- - nccl>=2.7
- - ucx-py {{ minor_version }}
+ - nccl>=2.9.9
- ucx-proc=*=gpu
+ - gtest
+ - gmock
+ - faiss-proc=*=cuda
+ - libfaiss 1.7.0 *_cuda
run:
- - libcudf={{ minor_version }}
- {{ pin_compatible('cudatoolkit', max_pin='x.x') }}
- - nccl>=2.7
- - ucx-py {{ minor_version }}
+ - nccl>=2.9.9
- ucx-proc=*=gpu
-
-#test:
-# commands:
-# - test -f $PREFIX/include/cugraph.h
-
+ - faiss-proc=*=cuda
+ - libfaiss 1.7.0 *_cuda
about:
home: http://rapids.ai/
diff --git a/conda_build.sh b/conda_build.sh
index 4643e302f5c..1254b7d8d5a 100755
--- a/conda_build.sh
+++ b/conda_build.sh
@@ -1,13 +1,15 @@
#!/usr/bin/env bash
+# Copyright (c) 2021, NVIDIA CORPORATION
+
set -xe
CUDA_REL=${CUDA_VERSION%.*}
conda install conda-build anaconda-client conda-verify -y
-conda build -c nvidia -c rapidsai -c rapidsai-nightly/label/cuda${CUDA_REL} -c conda-forge -c defaults --python=${PYTHON} conda/recipes/cugraph
+conda build -c nvidia -c rapidsai -c rapidsai-nightly/label/cuda${CUDA_REL} -c conda-forge --python=${PYTHON} conda/recipes/cugraph
if [ "$UPLOAD_PACKAGE" == '1' ]; then
- export UPLOADFILE=`conda build -c nvidia -c rapidsai -c conda-forge -c defaults --python=${PYTHON} conda/recipes/cugraph --output`
+ export UPLOADFILE=`conda build -c nvidia -c rapidsai -c conda-forge --python=${PYTHON} conda/recipes/cugraph --output`
SOURCE_BRANCH=main
test -e ${UPLOADFILE}
@@ -26,7 +28,7 @@ if [ "$UPLOAD_PACKAGE" == '1' ]; then
echo "Upload"
echo ${UPLOADFILE}
- anaconda -t ${MY_UPLOAD_KEY} upload -u ${CONDA_USERNAME:-rapidsai} ${LABEL_OPTION} --force ${UPLOADFILE}
+ anaconda -t ${MY_UPLOAD_KEY} upload -u ${CONDA_USERNAME:-rapidsai} ${LABEL_OPTION} --force ${UPLOADFILE} --no-progress
else
echo "Skipping upload"
fi
diff --git a/cpp/.clang-format b/cpp/.clang-format
index 6f48df58b74..0c05436e922 100644
--- a/cpp/.clang-format
+++ b/cpp/.clang-format
@@ -6,16 +6,22 @@ Language: Cpp
AccessModifierOffset: -1
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: true
+AlignConsecutiveBitFields: true
AlignConsecutiveDeclarations: false
+AlignConsecutiveMacros: true
AlignEscapedNewlines: Left
AlignOperands: true
AlignTrailingComments: true
+AllowAllArgumentsOnNextLine: true
+AllowAllConstructorInitializersOnNextLine: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: true
AllowShortCaseLabelsOnASingleLine: true
+AllowShortEnumsOnASingleLine: true
AllowShortFunctionsOnASingleLine: All
AllowShortIfStatementsOnASingleLine: true
-AllowShortLoopsOnASingleLine: true
+AllowShortLambdasOnASingleLine: true
+AllowShortLoopsOnASingleLine: false
# This is deprecated
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
@@ -40,14 +46,14 @@ BraceWrapping:
SplitEmptyFunction: false
SplitEmptyRecord: false
SplitEmptyNamespace: false
+BreakAfterJavaFieldAnnotations: false
BreakBeforeBinaryOperators: None
BreakBeforeBraces: WebKit
BreakBeforeInheritanceComma: false
-BreakInheritanceList: BeforeColon
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: false
BreakConstructorInitializers: BeforeColon
-BreakAfterJavaFieldAnnotations: false
+BreakInheritanceList: BeforeColon
BreakStringLiterals: true
ColumnLimit: 100
CommentPragmas: '^ IWYU pragma:'
@@ -57,7 +63,7 @@ ConstructorInitializerAllOnOneLineOrOnePerLine: true
ConstructorInitializerIndentWidth: 2
ContinuationIndentWidth: 2
Cpp11BracedListStyle: true
-DerivePointerAlignment: true
+DerivePointerAlignment: false
DisableFormat: false
ExperimentalAutoDetectBinPacking: false
FixNamespaceComments: true
@@ -139,18 +145,20 @@ SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeParens: ControlStatements
SpaceBeforeRangeBasedForLoopColon: true
+SpaceBeforeSquareBrackets: false
+SpaceInEmptyBlock: false
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 2
SpacesInAngles: false
+SpacesInConditionalStatement: false
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
-Standard: Cpp11
+Standard: c++17
StatementMacros:
- Q_UNUSED
- QT_REQUIRE_VERSION
# Be consistent with indent-width, even for people who use tab for indentation!
TabWidth: 2
UseTab: Never
-
diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt
index 8504f0c7b87..9fcb40b1eba 100644
--- a/cpp/CMakeLists.txt
+++ b/cpp/CMakeLists.txt
@@ -1,5 +1,5 @@
#=============================================================================
-# Copyright (c) 2018-2020, NVIDIA CORPORATION.
+# Copyright (c) 2018-2021, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -14,401 +14,265 @@
# limitations under the License.
#=============================================================================
-cmake_minimum_required(VERSION 3.12..3.17 FATAL_ERROR)
+cmake_minimum_required(VERSION 3.20.1 FATAL_ERROR)
+include(FetchContent)
+FetchContent_Declare(
+ rapids-cmake
+ GIT_REPOSITORY https://github.com/rapidsai/rapids-cmake.git
+ GIT_TAG origin/branch-21.08
+ )
+FetchContent_MakeAvailable(rapids-cmake)
-project(CUGRAPH VERSION 0.17.0 LANGUAGES C CXX CUDA)
+include(rapids-cmake)
+include(rapids-cpm)
+include(rapids-cuda)
+include(rapids-export)
+include(rapids-find)
-###################################################################################################
-# - build type ------------------------------------------------------------------------------------
+rapids_cuda_init_architectures(CUGRAPH)
-# Set a default build type if none was specified
-set(DEFAULT_BUILD_TYPE "Release")
-
-if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
- message(STATUS "Setting build type to '${DEFAULT_BUILD_TYPE}' since none specified.")
- set(CMAKE_BUILD_TYPE "${DEFAULT_BUILD_TYPE}" CACHE
- STRING "Choose the type of build." FORCE)
- # Set the possible values of build type for cmake-gui
- set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS
- "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
-endif()
+project(CUGRAPH VERSION 21.08.00 LANGUAGES C CXX CUDA)
-###################################################################################################
-# - compiler options ------------------------------------------------------------------------------
+# Remove the following archs from CMAKE_CUDA_ARCHITECTURES that
+# cuhornet currently doesn't support
+#
+# < 60
+# >= 86
+set(supported_archs "60" "62" "70" "72" "75" "80")
+foreach( arch IN LISTS CMAKE_CUDA_ARCHITECTURES)
+ string(REPLACE "-real" "" arch ${arch})
+ if( arch IN_LIST supported_archs )
+ list(APPEND usable_arch_values ${arch})
+ endif()
+endforeach()
+# Make sure everything but the 'newest' arch
+# is marked as `-real` so we only generate PTX for
+# arch > 80
+list(POP_BACK usable_arch_values latest_arch)
+list(TRANSFORM usable_arch_values APPEND "-real")
+list(APPEND usable_arch_values ${latest_arch})
-set(CMAKE_CXX_STANDARD 14)
-set(CMAKE_C_COMPILER $ENV{CC})
-set(CMAKE_CXX_COMPILER $ENV{CXX})
-set(CMAKE_CXX_STANDARD_REQUIRED ON)
+set(CMAKE_CUDA_ARCHITECTURES ${usable_arch_values})
-set(CMAKE_CUDA_STANDARD 14)
-set(CMAKE_CUDA_STANDARD_REQUIRED ON)
-if(CMAKE_COMPILER_IS_GNUCXX)
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror -Wno-error=deprecated-declarations")
-endif(CMAKE_COMPILER_IS_GNUCXX)
+# Write the version header
+include(cmake/Modules/Version.cmake)
+write_version()
-find_package(CUDA)
+###################################################################################################
+# - build type ------------------------------------------------------------------------------------
-# Configure GPU arch to build
-set(GUNROCK_GENCODE_SM60 "OFF")
-set(GUNROCK_GENCODE_SM61 "OFF")
-set(GUNROCK_GENCODE_SM70 "OFF")
-set(GUNROCK_GENCODE_SM72 "OFF")
-set(GUNROCK_GENCODE_SM75 "OFF")
-set(GUNROCK_GENCODE_SM80 "OFF")
+# Set a default build type if none was specified
+rapids_cmake_build_type(Release)
-# ARCHS handling:
-#
-if("${GPU_ARCHS}" STREQUAL "")
- include(cmake/EvalGpuArchs.cmake)
- evaluate_gpu_archs(GPU_ARCHS)
-endif()
+##############################################################################
+# - User Options ------------------------------------------------------------
+option(BUILD_CUGRAPH_MG_TESTS "Build cuGraph multigpu algorithm tests" OFF)
+set(BLAS_LIBRARIES "" CACHE STRING "Location of BLAS library for FAISS build.")
+option(BUILD_STATIC_FAISS "Build the FAISS library for nearest neighbors search on GPU" OFF)
+option(CMAKE_CUDA_LINEINFO "Enable the -lineinfo option for nvcc (useful for cuda-memcheck / profiler" OFF)
+option(BUILD_TESTS "Configure CMake to build tests" ON)
-# CUDA 11 onwards cub ships with CTK
-if((CUDA_VERSION_MAJOR EQUAL 11) OR (CUDA_VERSION_MAJOR GREATER 11))
- set(CUB_IS_PART_OF_CTK ON)
-else()
- set(CUB_IS_PART_OF_CTK OFF)
-endif()
+###################################################################################################
+# - compiler options ------------------------------------------------------------------------------
-if("${GPU_ARCHS}" STREQUAL "ALL")
- set(GPU_ARCHS "60")
- if((CUDA_VERSION_MAJOR EQUAL 9) OR (CUDA_VERSION_MAJOR GREATER 9))
- set(GPU_ARCHS "${GPU_ARCHS};70")
- endif()
- if((CUDA_VERSION_MAJOR EQUAL 10) OR (CUDA_VERSION_MAJOR GREATER 10))
- set(GPU_ARCHS "${GPU_ARCHS};75")
- endif()
- if((CUDA_VERSION_MAJOR EQUAL 11) OR (CUDA_VERSION_MAJOR GREATER 11))
- set(GPU_ARCHS "${GPU_ARCHS};80")
- endif()
-endif()
+rapids_find_package(CUDAToolkit REQUIRED
+ BUILD_EXPORT_SET cugraph-exports
+ INSTALL_EXPORT_SET cugraph-exports
+ )
-message("-- Building for GPU_ARCHS = ${GPU_ARCHS}")
-foreach(arch ${GPU_ARCHS})
- set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -gencode arch=compute_${arch},code=sm_${arch}")
- set(GUNROCK_GENCODE_SM${arch} "ON")
-endforeach()
+set(CUGRAPH_CXX_FLAGS "")
+set(CUGRAPH_CUDA_FLAGS "")
+
+if(CMAKE_COMPILER_IS_GNUCXX)
+ list(APPEND CUGRAPH_CXX_FLAGS -Werror -Wno-error=deprecated-declarations)
+endif(CMAKE_COMPILER_IS_GNUCXX)
-list(GET GPU_ARCHS -1 ptx)
-set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -gencode arch=compute_${ptx},code=compute_${ptx}")
-set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} --expt-extended-lambda --expt-relaxed-constexpr")
-set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -Werror=cross-execution-space-call -Wno-deprecated-declarations -Xptxas --disable-warnings")
-set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -Xcompiler -Wall,-Wno-error=sign-compare,-Wno-error=unused-but-set-variable")
+message("-- Building for GPU_ARCHS = ${CMAKE_CUDA_ARCHITECTURES}")
+list(APPEND CUGRAPH_CUDA_FLAGS --expt-extended-lambda --expt-relaxed-constexpr)
+list(APPEND CUGRAPH_CUDA_FLAGS -Werror=cross-execution-space-call -Wno-deprecated-declarations -Xptxas=--disable-warnings)
+list(APPEND CUGRAPH_CUDA_FLAGS -Xcompiler=-Wall,-Wno-error=sign-compare,-Wno-error=unused-but-set-variable)
+list(APPEND CUGRAPH_CUDA_FLAGS -Xfatbin=-compress-all)
# Option to enable line info in CUDA device compilation to allow introspection when profiling /
# memchecking
-option(CMAKE_CUDA_LINEINFO "Enable the -lineinfo option for nvcc (useful for cuda-memcheck / profiler" OFF)
if (CMAKE_CUDA_LINEINFO)
- set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -lineinfo")
+ list(APPEND CUGRAPH_CUDA_FLAGS -lineinfo)
endif(CMAKE_CUDA_LINEINFO)
# Debug options
if(CMAKE_BUILD_TYPE MATCHES Debug)
message(STATUS "Building with debugging flags")
- set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -G -Xcompiler -rdynamic")
+ list(APPEND CUGRAPH_CUDA_FLAGS -G -Xcompiler=-rdynamic)
endif(CMAKE_BUILD_TYPE MATCHES Debug)
-# To apply RUNPATH to transitive dependencies (this is a temporary solution)
-set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--disable-new-dtags")
-set(CMAKE_EXE_LINKER_FLAGS "-Wl,--disable-new-dtags")
-
-option(BUILD_TESTS "Configure CMake to build tests"
- ON)
-
-###################################################################################################
-# - cmake modules ---------------------------------------------------------------------------------
-
-set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules/" ${CMAKE_MODULE_PATH})
-
-include(FeatureSummary)
-include(CheckIncludeFiles)
-include(CheckLibraryExists)
-if(BUILD_TESTS)
- include(CTest)
-endif(BUILD_TESTS)
-
-###################################################################################################
-# - find boost ------------------------------------------------------------------------------------
-
-find_package(Boost REQUIRED)
-if(Boost_FOUND)
- message(STATUS "Boost found in ${Boost_INCLUDE_DIRS}")
-else()
- message(FATAL_ERROR "Boost not found, please check your settings.")
-endif(Boost_FOUND)
-
###################################################################################################
# - find openmp -----------------------------------------------------------------------------------
find_package(OpenMP)
if(OpenMP_FOUND)
# find_package(OPenMP) does not automatically add OpenMP flags to CUDA
- set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -Xcompiler=${OpenMP_CXX_FLAGS}")
+ list(APPEND CUGRAPH_CUDA_FLAGS -Xcompiler=${OpenMP_CXX_FLAGS})
endif(OpenMP_FOUND)
###################################################################################################
-# - find gtest ------------------------------------------------------------------------------------
+# - find blas -------------------------------------------------------------------------------------
-if(BUILD_TESTS)
- include(ConfigureGoogleTest)
-
- if(GTEST_FOUND)
- message(STATUS
- "Google C++ Testing Framework (Google Test) found in ${GTEST_ROOT}")
- else()
- message(AUTHOR_WARNING
- "Google C++ Testing Framework (Google Test) not found: automated tests are disabled.")
- endif(GTEST_FOUND)
-endif(BUILD_TESTS)
-
-###################################################################################################
-# - RMM -------------------------------------------------------------------------------------------
-
-find_path(RMM_INCLUDE "rmm"
- HINTS
- "$ENV{RMM_ROOT}/include"
- "$ENV{CONDA_PREFIX}/include/rmm"
- "$ENV{CONDA_PREFIX}/include")
-
-message(STATUS "RMM: RMM_INCLUDE set to ${RMM_INCLUDE}")
-
-###################################################################################################
-# - Fetch Content ---------------------------------------------------------------------------------
-include(FetchContent)
-
-# - THRUST/CUB
-message("Fetching Thrust")
-
-FetchContent_Declare(
- thrust
- GIT_REPOSITORY https://github.com/thrust/thrust.git
- # August 28, 2020
- GIT_TAG 52a8bda46c5c2128414d1d47f546b486ff0be2f0
-)
-
-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}")
-
-# - cuco
-message("Fetching cuco")
-
-FetchContent_Declare(
- cuco
- GIT_REPOSITORY https://github.com/NVIDIA/cuCollections.git
- GIT_TAG d965ed8dea8f56da8e260a6130dddf3ca351c45f
-)
-
-FetchContent_GetProperties(cuco)
-if(NOT cuco_POPULATED)
- FetchContent_Populate(cuco)
-endif()
-set(CUCO_INCLUDE_DIR "${cuco_SOURCE_DIR}/include")
-
-# - libcudacxx
-# NOTE: This is necessary because libcudacxx is not supported in
-# debian cuda 10.2 packages. Once 10.2 is deprecated
-# we should not need this any longer.
-message("Fetching libcudacxx")
-
-FetchContent_Declare(
- libcudacxx
- GIT_REPOSITORY https://github.com/NVIDIA/libcudacxx.git
- GIT_TAG 1.3.0
- GIT_SHALLOW true
-)
-
-FetchContent_GetProperties(libcudacxx)
-if(NOT libcudacxx_POPULATED)
- message("populating libcudacxx")
- FetchContent_Populate(libcudacxx)
+if(NOT DEFINED BLAS_LIBRARIES)
+ find_package( BLAS REQUIRED )
+else()
+ message(STATUS "Manually setting BLAS to ${BLAS_LIBRARIES}")
endif()
-set(LIBCUDACXX_INCLUDE_DIR "${libcudacxx_SOURCE_DIR}/include")
-message("set LIBCUDACXX_INCLUDE_DIR to: ${LIBCUDACXX_INCLUDE_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")
-
-
-ExternalProject_Add(cuhornet
- GIT_REPOSITORY https://github.com/rapidsai/cuhornet.git
- GIT_TAG 9cb8e8803852bd895a9c95c0fe778ad6eeefa7ad
- PREFIX ${CUHORNET_DIR}
- CONFIGURE_COMMAND ""
- BUILD_COMMAND ""
- INSTALL_COMMAND ""
-)
+# - find CPM based dependencies ------------------------------------------------------------------
-# - GUNROCK
-set(GUNROCK_DIR ${CMAKE_CURRENT_BINARY_DIR}/gunrock CACHE STRING "Path to gunrock repo")
-set(GUNROCK_INCLUDE_DIR ${GUNROCK_DIR}/src/gunrock_ext CACHE STRING "Path to gunrock includes")
-
-ExternalProject_Add(gunrock_ext
- GIT_REPOSITORY https://github.com/gunrock/gunrock.git
- GIT_TAG dev
- PREFIX ${GUNROCK_DIR}
- CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=
- -DGUNROCK_BUILD_SHARED_LIBS=OFF
- -DGUNROCK_BUILD_TESTS=OFF
- -DCUDA_AUTODETECT_GENCODE=OFF
- -DGUNROCK_GENCODE_SM60=${GUNROCK_GENCODE_SM60}
- -DGUNROCK_GENCODE_SM61=${GUNROCK_GENCODE_SM61}
- -DGUNROCK_GENCODE_SM70=${GUNROCK_GENCODE_SM70}
- -DGUNROCK_GENCODE_SM72=${GUNROCK_GENCODE_SM72}
- -DGUNROCK_GENCODE_SM75=${GUNROCK_GENCODE_SM75}
- -DGUNROCK_GENCODE_SM80=${GUNROCK_GENCODE_SM80}
- ${GUNROCK_GENCODE}
- BUILD_BYPRODUCTS ${GUNROCK_DIR}/src/gunrock_ext-build/lib/libgunrock.a
- INSTALL_COMMAND ""
-)
-
-add_library(gunrock STATIC IMPORTED)
-
-add_dependencies(gunrock gunrock_ext)
-
-set_property(TARGET gunrock PROPERTY IMPORTED_LOCATION ${GUNROCK_DIR}/src/gunrock_ext-build/lib/libgunrock.a)
-
-# - NCCL
-if(NOT NCCL_PATH)
- find_package(NCCL REQUIRED)
-else()
- message("-- Manually set NCCL PATH to ${NCCL_PATH}")
- set(NCCL_INCLUDE_DIRS ${NCCL_PATH}/include)
- set(NCCL_LIBRARIES ${NCCL_PATH}/lib/libnccl.so)
-endif(NOT NCCL_PATH)
-# - raft - (header only) -----------------------------------------------------
+rapids_cpm_init()
-# Only cloned if RAFT_PATH env variable is not defined
-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}")
+include(cmake/thirdparty/get_thrust.cmake)
+include(cmake/thirdparty/get_faiss.cmake)
+include(cmake/thirdparty/get_nccl.cmake)
+include(cmake/thirdparty/get_rmm.cmake)
- ExternalProject_Add(raft
- DOWNLOAD_COMMAND ""
- SOURCE_DIR ${RAFT_DIR}
- CONFIGURE_COMMAND ""
- BUILD_COMMAND ""
- INSTALL_COMMAND "")
+include(cmake/thirdparty/get_raft.cmake)
-else(DEFINED ENV{RAFT_PATH})
- message(STATUS "RAFT_PATH environment variable NOT detected, cloning RAFT")
- set(RAFT_DIR ${CMAKE_CURRENT_BINARY_DIR}/raft CACHE STRING "Path to RAFT repo")
+include(cmake/thirdparty/get_cuco.cmake)
+include(cmake/thirdparty/get_cuhornet.cmake)
- ExternalProject_Add(raft
- GIT_REPOSITORY https://github.com/rapidsai/raft.git
- GIT_TAG f75d7b437bf1da3df749108161b8a0505fb6b7b3
- PREFIX ${RAFT_DIR}
- CONFIGURE_COMMAND ""
- BUILD_COMMAND ""
- INSTALL_COMMAND "")
+include(cmake/thirdparty/get_gunrock.cmake)
- # Redefining RAFT_DIR so it coincides with the one inferred by env variable.
- set(RAFT_DIR "${RAFT_DIR}/src/raft/")
-endif(DEFINED ENV{RAFT_PATH})
+if(BUILD_TESTS)
+ include(cmake/thirdparty/get_gtest.cmake)
+endif()
###################################################################################################
# - library targets -------------------------------------------------------------------------------
-# target_link_directories is added in cmake 3.13, and cmake advises to use this instead of
-# link_directoires (we should switch to target_link_directories once 3.13 becomes the minimum
-# required version).
-link_directories(
- # CMAKE_CUDA_IMPLICIT_LINK_DIRECTORIES is an undocumented/unsupported variable containing the
- # link directories for nvcc.
- "${CMAKE_CUDA_IMPLICIT_LINK_DIRECTORIES}")
-
add_library(cugraph SHARED
+ src/detail/utility_wrappers.cu
+ src/detail/shuffle_wrappers.cu
src/utilities/spmv_1D.cu
src/utilities/cython.cu
+ src/utilities/path_retrieval.cu
+ src/utilities/graph_bcast.cu
src/structure/graph.cu
src/linear_assignment/hungarian.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/traversal/tsp.cu
src/link_prediction/jaccard.cu
src/link_prediction/overlap.cu
src/layout/force_atlas2.cu
- src/converters/renumber.cu
src/converters/COOtoCSR.cu
src/community/spectral_clustering.cu
src/community/louvain.cu
src/community/leiden.cu
src/community/ktruss.cu
- src/community/ECG.cu
+ src/community/ecg.cu
src/community/triangles_counting.cu
src/community/extract_subgraph_by_vertex.cu
+ src/community/egonet.cu
+ src/sampling/random_walks.cu
src/cores/core_number.cu
src/traversal/two_hop_neighbors.cu
src/components/connectivity.cu
src/centrality/katz_centrality.cu
src/centrality/betweenness_centrality.cu
+ src/generators/generate_rmat_edgelist.cu
+ src/generators/generator_tools.cu
+ src/generators/simple_generators.cu
+ src/generators/erdos_renyi_generator.cu
src/experimental/graph.cu
src/experimental/graph_view.cu
+ src/experimental/coarsen_graph.cu
+ src/experimental/renumber_edgelist.cu
+ src/experimental/renumber_utils.cu
+ src/experimental/relabel.cu
+ src/experimental/induced_subgraph.cu
src/experimental/bfs.cu
src/experimental/sssp.cu
src/experimental/pagerank.cu
src/experimental/katz_centrality.cu
+ src/serialization/serializer.cu
src/tree/mst.cu
+ src/components/weakly_connected_components.cu
+ src/structure/create_graph_from_edgelist.cpp
+ src/utilities/host_barrier.cpp
+ src/visitors/graph_envelope.cpp
+ src/visitors/visitors_factory.cpp
+ src/visitors/bfs_visitor.cpp
)
-#
-# NOTE: This dependency will force the building of cugraph to
-# wait until after cugunrock is constructed.
-#
-add_dependencies(cugraph gunrock_ext)
-add_dependencies(cugraph raft)
+set_target_properties(cugraph
+ PROPERTIES BUILD_RPATH "\$ORIGIN"
+ INSTALL_RPATH "\$ORIGIN"
+ # set target compile options
+ CXX_STANDARD 17
+ CXX_STANDARD_REQUIRED ON
+ CUDA_STANDARD 17
+ CUDA_STANDARD_REQUIRED ON
+ INTERFACE_POSITION_INDEPENDENT_CODE ON
+)
+
+target_compile_options(cugraph
+ PRIVATE "$<$:${CUGRAPH_CXX_FLAGS}>"
+ "$<$:${CUGRAPH_CUDA_FLAGS}>"
+)
+
+# Per-thread default stream option see https://docs.nvidia.com/cuda/cuda-runtime-api/stream-sync-behavior.html
+# The per-thread default stream does not synchronize with other streams
+target_compile_definitions(cugraph PUBLIC CUDA_API_PER_THREAD_DEFAULT_STREAM)
+
+file(WRITE "${CUGRAPH_BINARY_DIR}/fatbin.ld"
+[=[
+SECTIONS
+{
+ .nvFatBinSegment : { *(.nvFatBinSegment) }
+ .nv_fatbin : { *(.nv_fatbin) }
+}
+]=])
+target_link_options(cugraph PRIVATE "${CUGRAPH_BINARY_DIR}/fatbin.ld")
+
+add_library(cugraph::cugraph ALIAS cugraph)
###################################################################################################
# - include paths ---------------------------------------------------------------------------------
target_include_directories(cugraph
PRIVATE
- "${THRUST_INCLUDE_DIR}"
- "${CUCO_INCLUDE_DIR}"
- "${LIBCUDACXX_INCLUDE_DIR}"
- "${CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES}"
- "${Boost_INCLUDE_DIRS}"
- "${RMM_INCLUDE}"
- "${CMAKE_CURRENT_SOURCE_DIR}/../thirdparty"
- "${CUHORNET_INCLUDE_DIR}/hornet/include"
- "${CUHORNET_INCLUDE_DIR}/hornetsnest/include"
- "${CUHORNET_INCLUDE_DIR}/xlib/include"
- "${CUHORNET_INCLUDE_DIR}/primitives"
- "${CMAKE_CURRENT_SOURCE_DIR}/src"
- "${GUNROCK_INCLUDE_DIR}"
- "${NCCL_INCLUDE_DIRS}"
- "${RAFT_DIR}/cpp/include"
+ "${CMAKE_CURRENT_SOURCE_DIR}/../thirdparty"
+ "${CMAKE_CURRENT_SOURCE_DIR}/src"
+ "${NCCL_INCLUDE_DIRS}"
PUBLIC
- "${CMAKE_CURRENT_SOURCE_DIR}/include"
+ "$"
+ "$"
)
###################################################################################################
# - link libraries --------------------------------------------------------------------------------
-
-target_link_libraries(cugraph PRIVATE
- gunrock cublas cusparse curand cusolver cudart cuda ${NCCL_LIBRARIES})
+target_link_libraries(cugraph
+ PUBLIC
+ rmm::rmm
+ cugraph::Thrust
+ raft::raft
+ PRIVATE
+ cuco::cuco
+ CUDA::cublas
+ CUDA::curand
+ CUDA::cusolver
+ CUDA::cusparse
+ cugraph::cuHornet
+ FAISS::FAISS
+ gunrock
+ NCCL::NCCL
+)
if(OpenMP_CXX_FOUND)
target_link_libraries(cugraph PRIVATE
@@ -461,39 +325,76 @@ target_link_libraries(cugraph PRIVATE
${OpenMP_CXX_LIB_NAMES})
endif(OpenMP_CXX_FOUND)
+
###################################################################################################
# - generate tests --------------------------------------------------------------------------------
if(BUILD_TESTS)
- if(GTEST_FOUND)
- # target_link_directories is added in cmake 3.13, and cmake advises to use this instead of
- # link_directoires (we should switch to target_link_directories once 3.13 becomes the
- # minimum required version).
- link_directories(${GTEST_LIBRARY_DIR})
- add_subdirectory(${CMAKE_SOURCE_DIR}/tests)
- endif(GTEST_FOUND)
+ include(CTest)
+ add_subdirectory(tests)
endif(BUILD_TESTS)
###################################################################################################
# - install targets -------------------------------------------------------------------------------
-install(TARGETS cugraph LIBRARY
- DESTINATION lib)
+include(CPack)
+
+install(TARGETS cugraph
+ DESTINATION lib
+ EXPORT cugraph-exports)
+
+install(DIRECTORY include/cugraph/
+ DESTINATION include/cugraph)
+
+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/include/cugraph/version_config.hpp
+ DESTINATION include/cugraph)
-install(DIRECTORY include/
- DESTINATION include/cugraph)
+################################################################################################
+# - install export -------------------------------------------------------------------------------
+set(doc_string
+[=[
+Provide targets for cuGraph.
+
+cuGraph library is a collection of GPU accelerated graph algorithms that process data found in
+[GPU DataFrames](https://github.com/rapidsai/cudf).
+
+]=])
+
+set(code_string
+[=[
+thrust_create_target(cugraph::Thrust FROM_OPTIONS)
+]=])
+
+ rapids_export(INSTALL cugraph
+ EXPORT_SET cugraph-exports
+ GLOBAL_TARGETS cugraph
+ NAMESPACE cugraph::
+ DOCUMENTATION doc_string
+ FINAL_CODE_BLOCK code_string
+ )
+
+################################################################################################
+# - build export -------------------------------------------------------------------------------
+rapids_export(BUILD cugraph
+ EXPORT_SET cugraph-exports
+ GLOBAL_TARGETS cugraph
+ NAMESPACE cugraph::
+ DOCUMENTATION doc_string
+ FINAL_CODE_BLOCK code_string
+ )
-install(DIRECTORY ${RAFT_DIR}/cpp/include/raft/
- DESTINATION include/cugraph/raft)
###################################################################################################
# - make documentation ----------------------------------------------------------------------------
# requires doxygen and graphviz to be installed
# from build directory, run make docs_cugraph
-# doc targets for cuGraph
-add_custom_command(OUTPUT CUGRAPH_DOXYGEN
- WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/doxygen
- COMMAND doxygen Doxyfile
- VERBATIM)
+# doc targets for cugraph
+find_package(Doxygen 1.8.11)
+if(Doxygen_FOUND)
+ add_custom_command(OUTPUT CUGRAPH_DOXYGEN
+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/doxygen
+ COMMAND doxygen Doxyfile
+ VERBATIM)
-add_custom_target(docs_cugraph DEPENDS CUGRAPH_DOXYGEN)
+ add_custom_target(docs_cugraph DEPENDS CUGRAPH_DOXYGEN)
+endif()
diff --git a/cpp/cmake/EvalGpuArchs.cmake b/cpp/cmake/EvalGpuArchs.cmake
deleted file mode 100644
index f3918542db9..00000000000
--- a/cpp/cmake/EvalGpuArchs.cmake
+++ /dev/null
@@ -1,68 +0,0 @@
-# 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.
-#
-
-function(evaluate_gpu_archs gpu_archs)
- set(eval_file ${PROJECT_BINARY_DIR}/eval_gpu_archs.cu)
- set(eval_exe ${PROJECT_BINARY_DIR}/eval_gpu_archs)
- file(WRITE ${eval_file}
- "
-#include
-#include
-#include
-using namespace std;
-int main(int argc, char** argv) {
- set archs;
- int nDevices;
- if((cudaGetDeviceCount(&nDevices) == cudaSuccess) && (nDevices > 0)) {
- for(int dev=0;dev::const_iterator itr=archs.begin();itr!=archs.end();++itr) {
- printf(first? \"%s\" : \";%s\", itr->c_str());
- first = false;
- }
- }
- printf(\"\\n\");
- return 0;
-}
-")
- execute_process(
- COMMAND ${CUDA_NVCC_EXECUTABLE}
- -o ${eval_exe}
- --run
- ${eval_file}
- OUTPUT_VARIABLE __gpu_archs
- OUTPUT_STRIP_TRAILING_WHITESPACE)
- set(__gpu_archs_filtered "${__gpu_archs}")
- foreach(arch ${__gpu_archs})
- if (arch VERSION_LESS 60)
- list(REMOVE_ITEM __gpu_archs_filtered ${arch})
- endif()
- endforeach()
- if (NOT __gpu_archs_filtered)
- message(FATAL_ERROR "No supported GPU arch found on this system")
- endif()
- message("Auto detection of gpu-archs: ${__gpu_archs_filtered}")
- set(${gpu_archs} ${__gpu_archs_filtered} PARENT_SCOPE)
-endfunction(evaluate_gpu_archs)
diff --git a/cpp/cmake/Modules/ConfigureArrow.cmake b/cpp/cmake/Modules/ConfigureArrow.cmake
deleted file mode 100644
index b27e53dd415..00000000000
--- a/cpp/cmake/Modules/ConfigureArrow.cmake
+++ /dev/null
@@ -1,98 +0,0 @@
-set(ARROW_ROOT ${CMAKE_BINARY_DIR}/arrow)
-
-set(ARROW_CMAKE_ARGS " -DARROW_WITH_LZ4=OFF"
- " -DARROW_WITH_ZSTD=OFF"
- " -DARROW_WITH_BROTLI=OFF"
- " -DARROW_WITH_SNAPPY=OFF"
- " -DARROW_WITH_ZLIB=OFF"
- " -DARROW_BUILD_STATIC=ON"
- " -DARROW_BUILD_SHARED=OFF"
- " -DARROW_BOOST_USE_SHARED=ON"
- " -DARROW_BUILD_TESTS=OFF"
- " -DARROW_TEST_LINKAGE=OFF"
- " -DARROW_TEST_MEMCHECK=OFF"
- " -DARROW_BUILD_BENCHMARKS=OFF"
- " -DARROW_IPC=ON"
- " -DARROW_COMPUTE=OFF"
- " -DARROW_CUDA=OFF"
- " -DARROW_JEMALLOC=OFF"
- " -DARROW_BOOST_VENDORED=OFF"
- " -DARROW_PYTHON=OFF"
- " -DARROW_USE_GLOG=OFF"
- " -DCMAKE_VERBOSE_MAKEFILE=ON")
-
-configure_file("${CMAKE_SOURCE_DIR}/cmake/Templates/Arrow.CMakeLists.txt.cmake"
- "${ARROW_ROOT}/CMakeLists.txt")
-
-file(MAKE_DIRECTORY "${ARROW_ROOT}/build")
-file(MAKE_DIRECTORY "${ARROW_ROOT}/install")
-
-execute_process(
- COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" .
- RESULT_VARIABLE ARROW_CONFIG
- WORKING_DIRECTORY ${ARROW_ROOT})
-
-if(ARROW_CONFIG)
- message(FATAL_ERROR "Configuring Arrow failed: " ${ARROW_CONFIG})
-endif(ARROW_CONFIG)
-
-set(PARALLEL_BUILD -j)
-if($ENV{PARALLEL_LEVEL})
- set(NUM_JOBS $ENV{PARALLEL_LEVEL})
- set(PARALLEL_BUILD "${PARALLEL_BUILD}${NUM_JOBS}")
-endif($ENV{PARALLEL_LEVEL})
-
-if(${NUM_JOBS})
- if(${NUM_JOBS} EQUAL 1)
- message(STATUS "ARROW BUILD: Enabling Sequential CMake build")
- elseif(${NUM_JOBS} GREATER 1)
- message(STATUS "ARROW BUILD: Enabling Parallel CMake build with ${NUM_JOBS} jobs")
- endif(${NUM_JOBS} EQUAL 1)
-else()
- message(STATUS "ARROW BUILD: Enabling Parallel CMake build with all threads")
-endif(${NUM_JOBS})
-
-execute_process(
- COMMAND ${CMAKE_COMMAND} --build .. -- ${PARALLEL_BUILD}
- RESULT_VARIABLE ARROW_BUILD
- WORKING_DIRECTORY ${ARROW_ROOT}/build)
-
-if(ARROW_BUILD)
- message(FATAL_ERROR "Building Arrow failed: " ${ARROW_BUILD})
-endif(ARROW_BUILD)
-
-set(ARROW_GENERATED_IPC_DIR
- "${ARROW_ROOT}/build/src/arrow/ipc")
-
-configure_file(${ARROW_GENERATED_IPC_DIR}/File_generated.h ${CMAKE_SOURCE_DIR}/include/cudf/ipc_generated/File_generated.h COPYONLY)
-configure_file(${ARROW_GENERATED_IPC_DIR}/Message_generated.h ${CMAKE_SOURCE_DIR}/include/cudf/ipc_generated/Message_generated.h COPYONLY)
-configure_file(${ARROW_GENERATED_IPC_DIR}/Schema_generated.h ${CMAKE_SOURCE_DIR}/include/cudf/ipc_generated/Schema_generated.h COPYONLY)
-configure_file(${ARROW_GENERATED_IPC_DIR}/Tensor_generated.h ${CMAKE_SOURCE_DIR}/include/cudf/ipc_generated/Tensor_generated.h COPYONLY)
-
-message(STATUS "Arrow installed here: " ${ARROW_ROOT}/install)
-set(ARROW_LIBRARY_DIR "${ARROW_ROOT}/install/lib")
-set(ARROW_INCLUDE_DIR "${ARROW_ROOT}/install/include")
-
-find_library(ARROW_LIB arrow
- NO_DEFAULT_PATH
- HINTS "${ARROW_LIBRARY_DIR}")
-
-if(ARROW_LIB)
- message(STATUS "Arrow library: " ${ARROW_LIB})
- set(ARROW_FOUND TRUE)
-endif(ARROW_LIB)
-
-set(FLATBUFFERS_ROOT "${ARROW_ROOT}/build/flatbuffers_ep-prefix/src/flatbuffers_ep-install")
-
-message(STATUS "FlatBuffers installed here: " ${FLATBUFFERS_ROOT})
-set(FLATBUFFERS_INCLUDE_DIR "${FLATBUFFERS_ROOT}/include")
-set(FLATBUFFERS_LIBRARY_DIR "${FLATBUFFERS_ROOT}/lib")
-
-add_definitions(-DARROW_METADATA_V4)
-add_definitions(-DARROW_VERSION=1210)
-
-
-
-
-
-
diff --git a/cpp/cmake/Modules/ConfigureGoogleTest.cmake b/cpp/cmake/Modules/ConfigureGoogleTest.cmake
deleted file mode 100644
index 9fac40f4649..00000000000
--- a/cpp/cmake/Modules/ConfigureGoogleTest.cmake
+++ /dev/null
@@ -1,49 +0,0 @@
-set(GTEST_ROOT "${CMAKE_BINARY_DIR}/googletest")
-
-set(GTEST_CMAKE_ARGS "")
- #" -Dgtest_build_samples=ON"
- #" -DCMAKE_VERBOSE_MAKEFILE=ON")
-
-configure_file("${CMAKE_SOURCE_DIR}/cmake/Templates/GoogleTest.CMakeLists.txt.cmake"
- "${GTEST_ROOT}/CMakeLists.txt")
-
-file(MAKE_DIRECTORY "${GTEST_ROOT}/build")
-file(MAKE_DIRECTORY "${GTEST_ROOT}/install")
-
-execute_process(COMMAND ${CMAKE_COMMAND} -G ${CMAKE_GENERATOR} .
- RESULT_VARIABLE GTEST_CONFIG
- WORKING_DIRECTORY ${GTEST_ROOT})
-
-if(GTEST_CONFIG)
- message(FATAL_ERROR "Configuring GoogleTest failed: " ${GTEST_CONFIG})
-endif(GTEST_CONFIG)
-
-set(PARALLEL_BUILD -j)
-if($ENV{PARALLEL_LEVEL})
- set(NUM_JOBS $ENV{PARALLEL_LEVEL})
- set(PARALLEL_BUILD "${PARALLEL_BUILD}${NUM_JOBS}")
-endif($ENV{PARALLEL_LEVEL})
-
-if(${NUM_JOBS})
- if(${NUM_JOBS} EQUAL 1)
- message(STATUS "GTEST BUILD: Enabling Sequential CMake build")
- elseif(${NUM_JOBS} GREATER 1)
- message(STATUS "GTEST BUILD: Enabling Parallel CMake build with ${NUM_JOBS} jobs")
- endif(${NUM_JOBS} EQUAL 1)
-else()
- message(STATUS "GTEST BUILD: Enabling Parallel CMake build with all threads")
-endif(${NUM_JOBS})
-
-execute_process(COMMAND ${CMAKE_COMMAND} --build .. -- ${PARALLEL_BUILD}
- RESULT_VARIABLE GTEST_BUILD
- WORKING_DIRECTORY ${GTEST_ROOT}/build)
-
-if(GTEST_BUILD)
- message(FATAL_ERROR "Building GoogleTest failed: " ${GTEST_BUILD})
-endif(GTEST_BUILD)
-
-message(STATUS "GoogleTest installed here: " ${GTEST_ROOT}/install)
-set(GTEST_INCLUDE_DIR "${GTEST_ROOT}/install/include")
-set(GTEST_LIBRARY_DIR "${GTEST_ROOT}/install/lib")
-set(GTEST_FOUND TRUE)
-
diff --git a/cpp/cmake/Modules/FindNCCL.cmake b/cpp/cmake/Modules/FindNCCL.cmake
deleted file mode 100644
index 0f673707444..00000000000
--- a/cpp/cmake/Modules/FindNCCL.cmake
+++ /dev/null
@@ -1,116 +0,0 @@
-# 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.
-#
-
-# Based on FindPNG.cmake from cmake 3.14.3
-
-#[=======================================================================[.rst:
-FindNCCL
---------
-
-Find libnccl, the NVIDIA Collective Communication Library. A hint to find NCCL
-can be provided by setting NCCL_INSTALL_DIR.
-
-Imported targets
-^^^^^^^^^^^^^^^^
-
-This module defines the following :prop_tgt:`IMPORTED` target:
-
-``NCCL::NCCL``
- The libnccl library, if found.
-
-Result variables
-^^^^^^^^^^^^^^^^
-
-This module will set the following variables in your project:
-
-``NCCL_INCLUDE_DIRS``
- where to find nccl.h , etc.
-``NCCL_LIBRARIES``
- the libraries to link against to use NCCL.
-``NCCL_FOUND``
- If false, do not try to use NCCL.
-``NCCL_VERSION_STRING``
- the version of the NCCL library found
-
-#]=======================================================================]
-
-find_path(NCCL_NCCL_INCLUDE_DIR nccl.h HINTS ${NCCL_INSTALL_DIR} PATH_SUFFIXES include)
-
-#TODO: Does this need to support finding the static library?
-
-list(APPEND NCCL_NAMES nccl libnccl)
-set(_NCCL_VERSION_SUFFIXES 2)
-
-foreach(v IN LISTS _NCCL_VERSION_SUFFIXES)
- list(APPEND NCCL_NAMES nccl${v} libnccl${v})
-endforeach()
-unset(_NCCL_VERSION_SUFFIXES)
-# For compatibility with versions prior to this multi-config search, honor
-# any NCCL_LIBRARY that is already specified and skip the search.
-if(NOT NCCL_LIBRARY)
- find_library(NCCL_LIBRARY_RELEASE NAMES ${NCCL_NAMES} HINTS ${NCCL_INSTALL_DIR} PATH_SUFFIXES lib)
- include(${CMAKE_ROOT}/Modules/SelectLibraryConfigurations.cmake)
- select_library_configurations(NCCL)
- mark_as_advanced(NCCL_LIBRARY_RELEASE)
-endif()
-unset(NCCL_NAMES)
-
-# Set by select_library_configurations(), but we want the one from
-# find_package_handle_standard_args() below.
-unset(NCCL_FOUND)
-
-if (NCCL_LIBRARY AND NCCL_NCCL_INCLUDE_DIR)
- set(NCCL_INCLUDE_DIRS ${NCCL_NCCL_INCLUDE_DIR} )
- set(NCCL_LIBRARY ${NCCL_LIBRARY})
-
- if(NOT TARGET NCCL::NCCL)
- add_library(NCCL::NCCL UNKNOWN IMPORTED)
- set_target_properties(NCCL::NCCL PROPERTIES
- INTERFACE_INCLUDE_DIRECTORIES "${NCCL_INCLUDE_DIRS}")
- if(EXISTS "${NCCL_LIBRARY}")
- set_target_properties(NCCL::NCCL PROPERTIES
- IMPORTED_LINK_INTERFACE_LANGUAGES "C"
- IMPORTED_LOCATION "${NCCL_LIBRARY}")
- endif()
- endif()
-endif ()
-
-if (NCCL_NCCL_INCLUDE_DIR AND EXISTS "${NCCL_NCCL_INCLUDE_DIR}/nccl.h")
- file(STRINGS "${NCCL_NCCL_INCLUDE_DIR}/nccl.h" nccl_major_version_str REGEX "^#define[ \t]+NCCL_MAJOR[ \t]+[0-9]+")
- string(REGEX REPLACE "^#define[ \t]+NCCL_MAJOR[ \t]+([0-9]+)" "\\1" nccl_major_version_str "${nccl_major_version_str}")
-
- file(STRINGS "${NCCL_NCCL_INCLUDE_DIR}/nccl.h" nccl_minor_version_str REGEX "^#define[ \t]+NCCL_MINOR[ \t]+[0-9]+")
- string(REGEX REPLACE "^#define[ \t]+NCCL_MINOR[ \t]+([0-9]+)" "\\1" nccl_minor_version_str "${nccl_minor_version_str}")
-
- file(STRINGS "${NCCL_NCCL_INCLUDE_DIR}/nccl.h" nccl_patch_version_str REGEX "^#define[ \t]+NCCL_PATCH[ \t]+[0-9]+")
- string(REGEX REPLACE "^#define[ \t]+NCCL_PATCH[ \t]+([0-9]+)" "\\1" nccl_patch_version_str "${nccl_patch_version_str}")
-
- file(STRINGS "${NCCL_NCCL_INCLUDE_DIR}/nccl.h" nccl_suffix_version_str REGEX "^#define[ \t]+NCCL_SUFFIX[ \t]+\".*\"")
- string(REGEX REPLACE "^#define[ \t]+NCCL_SUFFIX[ \t]+\"(.*)\"" "\\1" nccl_suffix_version_str "${nccl_suffix_version_str}")
-
- set(NCCL_VERSION_STRING "${nccl_major_version_str}.${nccl_minor_version_str}.${nccl_patch_version_str}${nccl_suffix_version_str}")
-
- unset(nccl_major_version_str)
- unset(nccl_minor_version_str)
- unset(nccl_patch_version_str)
- unset(nccl_suffix_version_str)
-endif ()
-
-include(${CMAKE_ROOT}/Modules/FindPackageHandleStandardArgs.cmake)
-find_package_handle_standard_args(NCCL
- REQUIRED_VARS NCCL_LIBRARY NCCL_NCCL_INCLUDE_DIR
- VERSION_VAR NCCL_VERSION_STRING)
-
-mark_as_advanced(NCCL_NCCL_INCLUDE_DIR NCCL_LIBRARY)
diff --git a/cpp/cmake/Modules/Version.cmake b/cpp/cmake/Modules/Version.cmake
new file mode 100644
index 00000000000..15046784175
--- /dev/null
+++ b/cpp/cmake/Modules/Version.cmake
@@ -0,0 +1,18 @@
+# Copyright (c) 2021, NVIDIA CORPORATION.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
+# in compliance with the License. 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 version_config.hpp from the version found in CMakeLists.txt
+function(write_version)
+ message(STATUS "CUGRAPH VERSION: ${CUGRAPH_VERSION}")
+ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/version_config.hpp.in
+ ${CMAKE_CURRENT_BINARY_DIR}/include/cugraph/version_config.hpp @ONLY)
+endfunction(write_version)
diff --git a/cpp/cmake/Templates/Arrow.CMakeLists.txt.cmake b/cpp/cmake/Templates/Arrow.CMakeLists.txt.cmake
deleted file mode 100644
index b1eaf3f0efa..00000000000
--- a/cpp/cmake/Templates/Arrow.CMakeLists.txt.cmake
+++ /dev/null
@@ -1,19 +0,0 @@
-cmake_minimum_required(VERSION 3.12)
-
-include(ExternalProject)
-
-ExternalProject_Add(Arrow
- GIT_REPOSITORY https://github.com/apache/arrow.git
- GIT_TAG apache-arrow-0.12.1
- SOURCE_DIR "${ARROW_ROOT}/arrow"
- SOURCE_SUBDIR "cpp"
- BINARY_DIR "${ARROW_ROOT}/build"
- INSTALL_DIR "${ARROW_ROOT}/install"
- CMAKE_ARGS ${ARROW_CMAKE_ARGS} -DCMAKE_INSTALL_PREFIX=${ARROW_ROOT}/install)
-
-
-
-
-
-
-
diff --git a/cpp/cmake/Templates/GoogleTest.CMakeLists.txt.cmake b/cpp/cmake/Templates/GoogleTest.CMakeLists.txt.cmake
deleted file mode 100644
index 66e1dc85a50..00000000000
--- a/cpp/cmake/Templates/GoogleTest.CMakeLists.txt.cmake
+++ /dev/null
@@ -1,19 +0,0 @@
-cmake_minimum_required(VERSION 3.12)
-
-include(ExternalProject)
-
-ExternalProject_Add(GoogleTest
- GIT_REPOSITORY https://github.com/google/googletest.git
- GIT_TAG release-1.8.0
- SOURCE_DIR "${GTEST_ROOT}/googletest"
- BINARY_DIR "${GTEST_ROOT}/build"
- INSTALL_DIR "${GTEST_ROOT}/install"
- CMAKE_ARGS ${GTEST_CMAKE_ARGS} -DCMAKE_INSTALL_PREFIX=${GTEST_ROOT}/install)
-
-
-
-
-
-
-
-
diff --git a/cpp/cmake/thirdparty/get_cuco.cmake b/cpp/cmake/thirdparty/get_cuco.cmake
new file mode 100644
index 00000000000..7b9ab17bef6
--- /dev/null
+++ b/cpp/cmake/thirdparty/get_cuco.cmake
@@ -0,0 +1,37 @@
+#=============================================================================
+# Copyright (c) 2021, NVIDIA CORPORATION.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# 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.
+#=============================================================================
+
+function(find_and_configure_cuco VERSION)
+
+ if(TARGET cuco::cuco)
+ return()
+ endif()
+
+ rapids_cpm_find(cuco ${VERSION}
+ GLOBAL_TARGETS cuco cuco::cuco
+ CPM_ARGS
+ GIT_REPOSITORY https://github.com/NVIDIA/cuCollections.git
+ GIT_TAG b1fea0cbe4c384160740af00f7c8760846539abb
+ OPTIONS "BUILD_TESTS OFF"
+ "BUILD_BENCHMARKS OFF"
+ "BUILD_EXAMPLES OFF"
+ )
+
+ add_library(cuco::cuco ALIAS cuco)
+
+endfunction()
+
+find_and_configure_cuco(0.0.1)
diff --git a/cpp/cmake/thirdparty/get_cuhornet.cmake b/cpp/cmake/thirdparty/get_cuhornet.cmake
new file mode 100644
index 00000000000..28c83161ff4
--- /dev/null
+++ b/cpp/cmake/thirdparty/get_cuhornet.cmake
@@ -0,0 +1,45 @@
+#=============================================================================
+# Copyright (c) 2021, NVIDIA CORPORATION.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# 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.
+#=============================================================================
+
+function(find_and_configure_cuhornet)
+
+ # We are not using the cuhornet CMake targets, so no need to call `add_subdirectory()`,
+ # or to use CPM
+ FetchContent_Declare(
+ cuhornet
+ GIT_REPOSITORY https://github.com/rapidsai/cuhornet.git
+ GIT_TAG 261399356e62bd76fa7628880f1a847aee713eed
+ SOURCE_SUBDIR hornet
+ )
+ FetchContent_GetProperties(cuhornet)
+
+ if(NOT cuhornet_POPULATED)
+ FetchContent_Populate(cuhornet)
+ endif()
+
+ if(NOT TARGET cugraph::cuHornet)
+ add_library(cugraph::cuHornet IMPORTED INTERFACE GLOBAL)
+ target_include_directories(cugraph::cuHornet INTERFACE
+ "${cuhornet_SOURCE_DIR}/hornet/include"
+ "${cuhornet_SOURCE_DIR}/hornetsnest/include"
+ "${cuhornet_SOURCE_DIR}/xlib/include"
+ "${cuhornet_SOURCE_DIR}/primitives"
+ )
+ endif()
+endfunction()
+
+
+find_and_configure_cuhornet()
diff --git a/cpp/cmake/thirdparty/get_faiss.cmake b/cpp/cmake/thirdparty/get_faiss.cmake
new file mode 100644
index 00000000000..a65401579cb
--- /dev/null
+++ b/cpp/cmake/thirdparty/get_faiss.cmake
@@ -0,0 +1,53 @@
+#=============================================================================
+# Copyright (c) 2021, NVIDIA CORPORATION.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# 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.
+#=============================================================================
+
+function(find_and_configure_faiss)
+ set(oneValueArgs VERSION PINNED_TAG)
+ cmake_parse_arguments(PKG "${options}" "${oneValueArgs}"
+ "${multiValueArgs}" ${ARGN} )
+
+ rapids_find_generate_module(FAISS
+ HEADER_NAMES faiss/IndexFlat.h
+ LIBRARY_NAMES faiss
+ )
+
+ rapids_cpm_find(FAISS ${PKG_VERSION}
+ GLOBAL_TARGETS faiss
+ CPM_ARGS
+ GIT_REPOSITORY https://github.com/facebookresearch/faiss.git
+ GIT_TAG ${PKG_PINNED_TAG}
+ OPTIONS
+ "FAISS_ENABLE_PYTHON OFF"
+ "BUILD_SHARED_LIBS OFF"
+ "CUDAToolkit_ROOT ${CUDAToolkit_LIBRARY_DIR}"
+ "FAISS_ENABLE_GPU ON"
+ "BUILD_TESTING OFF"
+ "CMAKE_MESSAGE_LOG_LEVEL VERBOSE"
+ )
+
+ if(FAISS_ADDED)
+ set(FAISS_GPU_HEADERS ${FAISS_SOURCE_DIR} PARENT_SCOPE)
+ endif()
+
+ if(TARGET faiss AND NOT TARGET FAISS::FAISS)
+ add_library(FAISS::FAISS ALIAS faiss)
+ endif()
+
+endfunction()
+
+find_and_configure_faiss(VERSION 1.7.0
+ PINNED_TAG bde7c0027191f29c9dadafe4f6e68ca0ee31fb30
+ )
diff --git a/cpp/cmake/thirdparty/get_gtest.cmake b/cpp/cmake/thirdparty/get_gtest.cmake
new file mode 100644
index 00000000000..e413cad7601
--- /dev/null
+++ b/cpp/cmake/thirdparty/get_gtest.cmake
@@ -0,0 +1,43 @@
+#=============================================================================
+# Copyright (c) 2021, NVIDIA CORPORATION.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# 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.
+#=============================================================================
+
+function(find_and_configure_gtest VERSION)
+
+ if(TARGET GTest::gtest)
+ return()
+ endif()
+
+ rapids_cpm_find(GTest ${VERSION}
+ GLOBAL_TARGETS gmock gmock_main gtest gtest_main GTest::gmock GTest::gtest GTest::gtest_main
+ CPM_ARGS
+ GIT_REPOSITORY https://github.com/google/googletest.git
+ GIT_TAG release-${VERSION}
+ GIT_SHALLOW TRUE
+ OPTIONS "INSTALL_GTEST ON"
+ # googletest >= 1.10.0 provides a cmake config file -- use it if it exists
+ FIND_PACKAGE_ARGUMENTS "CONFIG"
+ )
+
+ if(NOT TARGET GTest::gtest)
+ add_library(GTest::gmock ALIAS gmock)
+ add_library(GTest::gmock_main ALIAS gmock_main)
+ add_library(GTest::gtest ALIAS gtest)
+ add_library(GTest::gtest_main ALIAS gtest_main)
+ endif()
+
+endfunction()
+
+find_and_configure_gtest(1.10.0)
diff --git a/cpp/cmake/thirdparty/get_gunrock.cmake b/cpp/cmake/thirdparty/get_gunrock.cmake
new file mode 100644
index 00000000000..056cd4bd5ea
--- /dev/null
+++ b/cpp/cmake/thirdparty/get_gunrock.cmake
@@ -0,0 +1,64 @@
+#=============================================================================
+# Copyright (c) 2021, NVIDIA CORPORATION.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# 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.
+#=============================================================================
+
+function(find_and_configure_gunrock VERSION)
+
+ if(NOT TARGET gunrock)
+ set(GUNROCK_GENCODE_SM60 OFF)
+ set(GUNROCK_GENCODE_SM61 OFF)
+ set(GUNROCK_GENCODE_SM70 OFF)
+ set(GUNROCK_GENCODE_SM72 OFF)
+ set(GUNROCK_GENCODE_SM75 OFF)
+ set(GUNROCK_GENCODE_SM80 OFF)
+
+ foreach(arch IN LISTS CMAKE_CUDA_ARCHITECTURES)
+ string(REPLACE "-real" "" arch ${arch})
+ set(GUNROCK_GENCODE_SM${arch} "ON")
+ endforeach()
+
+ # FIXME: gunrock is still using ExternalProject instead of CPM, as version 1.2
+ # doesn't work with CPM
+
+ include(ExternalProject)
+
+ set(GUNROCK_DIR ${CMAKE_CURRENT_BINARY_DIR}/gunrock)
+ ExternalProject_Add(gunrock_ext
+ GIT_REPOSITORY https://github.com/gunrock/gunrock.git
+ GIT_TAG v${VERSION}
+ PREFIX ${GUNROCK_DIR}
+ CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=
+ -DGUNROCK_BUILD_SHARED_LIBS=OFF
+ -DGUNROCK_BUILD_TESTS=OFF
+ -DCUDA_AUTODETECT_GENCODE=OFF
+ -DGUNROCK_GENCODE_SM60=${GUNROCK_GENCODE_SM60}
+ -DGUNROCK_GENCODE_SM61=${GUNROCK_GENCODE_SM61}
+ -DGUNROCK_GENCODE_SM70=${GUNROCK_GENCODE_SM70}
+ -DGUNROCK_GENCODE_SM72=${GUNROCK_GENCODE_SM72}
+ -DGUNROCK_GENCODE_SM75=${GUNROCK_GENCODE_SM75}
+ -DGUNROCK_GENCODE_SM80=${GUNROCK_GENCODE_SM80}
+ BUILD_BYPRODUCTS ${GUNROCK_DIR}/src/gunrock_ext-build/lib/libgunrock.a
+ INSTALL_COMMAND ""
+ )
+
+ add_library(gunrock STATIC IMPORTED)
+ add_dependencies(gunrock gunrock_ext)
+ set_property(TARGET gunrock PROPERTY IMPORTED_LOCATION "${GUNROCK_DIR}/src/gunrock_ext-build/lib/libgunrock.a")
+ target_include_directories(gunrock INTERFACE "${GUNROCK_DIR}/src/gunrock_ext")
+ endif()
+endfunction()
+
+
+find_and_configure_gunrock(1.2)
diff --git a/cpp/cmake/thirdparty/get_nccl.cmake b/cpp/cmake/thirdparty/get_nccl.cmake
new file mode 100644
index 00000000000..30ec976f27c
--- /dev/null
+++ b/cpp/cmake/thirdparty/get_nccl.cmake
@@ -0,0 +1,42 @@
+#=============================================================================
+# Copyright (c) 2021, NVIDIA CORPORATION.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# 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.
+#=============================================================================
+
+function(find_and_configure_nccl)
+
+ if(TARGET NCCL::NCCL)
+ return()
+ endif()
+
+ set(oneValueArgs VERSION PINNED_TAG)
+ cmake_parse_arguments(PKG "${options}" "${oneValueArgs}"
+ "${multiValueArgs}" ${ARGN} )
+
+ rapids_find_generate_module(NCCL
+ HEADER_NAMES nccl.h
+ LIBRARY_NAMES nccl
+ )
+
+ # Currently NCCL has no CMake build-system so we require
+ # it built and installed on the machine already
+ rapids_find_package(NCCL REQUIRED)
+
+endfunction()
+
+find_and_configure_nccl()
+
+
+
+
diff --git a/cpp/cmake/thirdparty/get_raft.cmake b/cpp/cmake/thirdparty/get_raft.cmake
new file mode 100644
index 00000000000..a819d7158e1
--- /dev/null
+++ b/cpp/cmake/thirdparty/get_raft.cmake
@@ -0,0 +1,47 @@
+#=============================================================================
+# Copyright (c) 2021, NVIDIA CORPORATION.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# 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.
+#=============================================================================
+
+function(find_and_configure_raft)
+
+ set(oneValueArgs VERSION FORK PINNED_TAG)
+ cmake_parse_arguments(PKG "" "${oneValueArgs}" "" ${ARGN} )
+
+ rapids_cpm_find(raft ${PKG_VERSION}
+ GLOBAL_TARGETS raft::raft
+ BUILD_EXPORT_SET cugraph-exports
+ INSTALL_EXPORT_SET cugraph-exports
+ CPM_ARGS
+ GIT_REPOSITORY https://github.com/${PKG_FORK}/raft.git
+ GIT_TAG ${PKG_PINNED_TAG}
+ SOURCE_SUBDIR cpp
+ OPTIONS "BUILD_TESTS OFF"
+ )
+
+ message(VERBOSE "CUGRAPH: Using RAFT located in ${raft_SOURCE_DIR}")
+
+endfunction()
+
+set(CUGRAPH_MIN_VERSION_raft "${CUGRAPH_VERSION_MAJOR}.${CUGRAPH_VERSION_MINOR}.00")
+set(CUGRAPH_BRANCH_VERSION_raft "${CUGRAPH_VERSION_MAJOR}.${CUGRAPH_VERSION_MINOR}")
+
+
+# Change pinned tag and fork here to test a commit in CI
+# To use a different RAFT locally, set the CMake variable
+# RPM_raft_SOURCE=/path/to/local/raft
+find_and_configure_raft(VERSION ${CUGRAPH_MIN_VERSION_raft}
+ FORK rapidsai
+ PINNED_TAG branch-${CUGRAPH_BRANCH_VERSION_raft}
+ )
diff --git a/cpp/cmake/thirdparty/get_rmm.cmake b/cpp/cmake/thirdparty/get_rmm.cmake
new file mode 100644
index 00000000000..aecb6489f92
--- /dev/null
+++ b/cpp/cmake/thirdparty/get_rmm.cmake
@@ -0,0 +1,47 @@
+#=============================================================================
+# Copyright (c) 2021, NVIDIA CORPORATION.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# 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.
+#=============================================================================
+
+function(find_and_configure_rmm VERSION)
+
+ if(${VERSION} MATCHES [=[([0-9]+)\.([0-9]+)\.([0-9]+)]=])
+ set(MAJOR_AND_MINOR "${CMAKE_MATCH_1}.${CMAKE_MATCH_2}")
+ else()
+ set(MAJOR_AND_MINOR "${VERSION}")
+ endif()
+
+ if(TARGET rmm::rmm)
+ return()
+ endif()
+
+ rapids_cpm_find(rmm ${VERSION}
+ GLOBAL_TARGETS rmm::rmm
+ BUILD_EXPORT_SET cugraph-exports
+ INSTALL_EXPORT_SET cugraph-exports
+ CPM_ARGS
+ GIT_REPOSITORY https://github.com/rapidsai/rmm.git
+ GIT_TAG branch-${MAJOR_AND_MINOR}
+ GIT_SHALLOW TRUE
+ OPTIONS "BUILD_TESTS OFF"
+ "BUILD_BENCHMARKS OFF"
+ "CUDA_STATIC_RUNTIME ${CUDA_STATIC_RUNTIME}"
+ "DISABLE_DEPRECATION_WARNING ${DISABLE_DEPRECATION_WARNING}"
+ )
+
+endfunction()
+
+set(CUGRAPH_MIN_VERSION_rmm "${CUGRAPH_VERSION_MAJOR}.${CUGRAPH_VERSION_MINOR}.00")
+
+find_and_configure_rmm(${CUGRAPH_MIN_VERSION_rmm})
diff --git a/cpp/cmake/thirdparty/get_thrust.cmake b/cpp/cmake/thirdparty/get_thrust.cmake
new file mode 100644
index 00000000000..86fcffed5d2
--- /dev/null
+++ b/cpp/cmake/thirdparty/get_thrust.cmake
@@ -0,0 +1,29 @@
+#=============================================================================
+# Copyright (c) 2021, NVIDIA CORPORATION.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# 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.
+#=============================================================================
+
+function(find_and_configure_thrust VERSION)
+
+ rapids_cpm_find(Thrust ${VERSION}
+ CPM_ARGS
+ GIT_REPOSITORY https://github.com/thrust/thrust.git
+ GIT_TAG ${VERSION}
+ )
+
+ thrust_create_target(cugraph::Thrust FROM_OPTIONS)
+
+endfunction()
+
+find_and_configure_thrust(1.12.0)
diff --git a/cpp/cmake/version_config.hpp.in b/cpp/cmake/version_config.hpp.in
new file mode 100644
index 00000000000..c669d1b97f3
--- /dev/null
+++ b/cpp/cmake/version_config.hpp.in
@@ -0,0 +1,20 @@
+/*
+ * Copyright (c) 2021, NVIDIA CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * 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
+
+#define CUGRAPH_VERSION_MAJOR @CUGRAPH_VERSION_MAJOR@
+#define CUGRAPH_VERSION_MINOR @CUGRAPH_VERSION_MINOR@
+#define CUGRAPH_VERSION_PATCH @CUGRAPH_VERSION_PATCH@
diff --git a/cpp/docs/DEVELOPER_GUIDE.md b/cpp/docs/DEVELOPER_GUIDE.md
new file mode 100644
index 00000000000..b369183a262
--- /dev/null
+++ b/cpp/docs/DEVELOPER_GUIDE.md
@@ -0,0 +1,281 @@
+# cuGraph C++ Developer Guide
+
+This document serves as a guide for contributors to cuGraph C++ code. Developers should also refer
+to these additional files for further documentation of cuGraph best practices.
+
+* [Documentation Guide](TODO) for guidelines on documenting cuGraph code.
+* [Testing Guide](TODO) for guidelines on writing unit tests.
+* [Benchmarking Guide](TODO) for guidelines on writing unit benchmarks.
+
+# Overview
+
+cuGraph includes a C++ library that provides GPU-accelerated graph algorithms for processing
+sparse graphs.
+
+## Lexicon
+
+This section defines terminology used within cuGraph
+
+### COO
+
+COOrdinate format is one of the standard formats for representing graph data. In COO format the
+graph is represented as an array of source vertex ids, an array of destination vertex ids, and an
+optional array of edge weights. Edge i is identified by source_vertex_id[i], destination_vertex_id[i]
+and weight[i].
+
+### MORE
+
+# Directory Structure and File Naming
+
+External/public cuGraph APIs are grouped based on functionality into an appropriately titled
+header file in `cugraph/cpp/include/`. For example, `cugraph/cpp/include/graph.hpp`
+contains the definition of the (legacy) graph objects. Note the `.hpp`
+file extension used to indicate a C++ header file.
+
+Header files should use the `#pragma once` include guard.
+
+## File extensions
+
+- `.hpp` : C++ header files
+- `.cpp` : C++ source files
+- `.cu` : CUDA C++ source files
+- `.cuh` : Headers containing CUDA device code
+
+Header files and source files should use `.hpp` and `.cpp` extensions unless they must
+be compiled by nvcc. `.cu` and `.cuh` files are more expensive to compile, so we want
+to minimize the use of these files to only when necessary. A good indicator of the need
+to use a `.cu` or `.cuh` file is the inclusion of `__device__` and other
+symbols that are only recognized by `nvcc`. Another indicator is Thrust
+algorithm APIs with a device execution policy (always `rmm::exec_policy` in cuGraph).
+
+## Code and Documentation Style and Formatting
+
+cuGraph code uses [snake_case](https://en.wikipedia.org/wiki/Snake_case) for all names except in a
+few cases: unit tests and test case names may use Pascal case, aka
+[UpperCamelCase](https://en.wikipedia.org/wiki/Camel_case). We do not use
+[Hungarian notation](https://en.wikipedia.org/wiki/Hungarian_notation), except for the following examples:
+ * device data variables should be prefaced by d_ if it makes the intent clearer
+ * host data variables should be prefaced by h_ if it makes the intent clearer
+ * template parameters defining a type should be suffixed with _t
+ * private member variables are typically suffixed with an underscore
+
+```c++
+template
+void algorithm_function(graph_t const &g)
+{
+ ...
+}
+
+template
+class utility_class
+{
+ ...
+ private:
+ vertex_t num_vertices_{};
+}
+```
+
+C++ formatting is enforced using `clang-format`. You should configure `clang-format` on your
+machine to use the `cugraph/cpp/.clang-format` configuration file, and run `clang-format` on all
+changed code before committing it. The easiest way to do this is to configure your editor to
+"format on save".
+
+Aspects of code style not discussed in this document and not automatically enforceable are typically
+caught during code review, or not enforced.
+
+### C++ Guidelines
+
+In general, we recommend following
+[C++ Core Guidelines](https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines). We also
+recommend watching Sean Parent's [C++ Seasoning talk](https://www.youtube.com/watch?v=W2tWOdzgXHA),
+and we try to follow his rules: "No raw loops. No raw pointers. No raw synchronization primitives."
+
+ * Prefer algorithms from STL and Thrust to raw loops.
+ * Prefer cugraph and RMM to raw pointers and raw memory allocation.
+
+Documentation is discussed in the [Documentation Guide](TODO).
+
+### Includes
+
+The following guidelines apply to organizing `#include` lines.
+
+ * Group includes by library (e.g. cuGraph, RMM, Thrust, STL). `clang-format` will respect the
+ groupings and sort the individual includes within a group lexicographically.
+ * Separate groups by a blank line.
+ * Order the groups from "nearest" to "farthest". In other words, local includes, then includes
+ from other RAPIDS libraries, then includes from related libraries, like ``, then
+ includes from dependencies installed with cuGraph, and then standard headers (for example ``,
+ ``).
+ * Use <> instead of "" unless the header is in the same directory as the source file.
+ * Tools like `clangd` often auto-insert includes when they can, but they usually get the grouping
+ and brackets wrong.
+ * Always check that includes are only necessary for the file in which they are included.
+ Try to avoid excessive including especially in header files. Double check this when you remove
+ code.
+
+# cuGraph Data Structures
+
+Application data in cuGraph is contained in graph objects, but there are a variety of other
+data structures you will use when developing cuGraph code.
+
+## Views and Ownership
+
+Resource ownership is an essential concept in cuGraph. In short, an "owning" object owns a
+resource (such as device memory). It acquires that resource during construction and releases the
+resource in destruction ([RAII](https://en.cppreference.com/w/cpp/language/raii)). A "non-owning"
+object does not own resources. Any class in cuGraph with the `*_view` suffix is non-owning.
+
+## `rmm::device_memory_resource`
+
+cuGraph allocates all device memory via RMM memory resources (MR). See the
+[RMM documentation](https://github.com/rapidsai/rmm/blob/main/README.md) for details.
+
+## Streams
+
+CUDA streams are not yet exposed in external cuGraph APIs.
+
+We are currently investigating the best technique for exposing this.
+
+### Memory Management
+
+cuGraph code generally eschews raw pointers and direct memory allocation. Use RMM classes built to
+use `device_memory_resource`(*)s for device memory allocation with automated lifetime management.
+
+#### `rmm::device_buffer`
+Allocates a specified number of bytes of untyped, uninitialized device memory using a
+`device_memory_resource`. If no resource is explicitly provided, uses
+`rmm::mr::get_current_device_resource()`.
+
+`rmm::device_buffer` is movable and copyable on a stream. A copy performs a deep copy of the
+`device_buffer`'s device memory on the specified stream, whereas a move moves ownership of the
+device memory from one `device_buffer` to another.
+
+```c++
+// Allocates at least 100 bytes of uninitialized device memory
+// using the specified resource and stream
+rmm::device_buffer buff(100, stream, mr);
+void * raw_data = buff.data(); // Raw pointer to underlying device memory
+
+// Deep copies `buff` into `copy` on `stream`
+rmm::device_buffer copy(buff, stream);
+
+// Moves contents of `buff` into `moved_to`
+rmm::device_buffer moved_to(std::move(buff));
+
+custom_memory_resource *mr...;
+// Allocates 100 bytes from the custom_memory_resource
+rmm::device_buffer custom_buff(100, mr, stream);
+```
+
+#### `rmm::device_uvector`
+
+Similar to a `rmm::device_vector`, allocates a contiguous set of elements in device memory but with
+key differences:
+- As an optimization, elements are uninitialized and no synchronization occurs at construction.
+This limits the types `T` to trivially copyable types.
+- All operations are stream ordered (i.e., they accept a `cuda_stream_view` specifying the stream
+on which the operation is performed).
+
+## Namespaces
+
+### External
+All public cuGraph APIs should be placed in the `cugraph` namespace. Example:
+```c++
+namespace cugraph{
+ void public_function(...);
+} // namespace cugraph
+```
+
+### Internal
+
+Many functions are not meant for public use, so place them in either the `detail` or an *anonymous*
+namespace, depending on the situation.
+
+#### `detail` namespace
+
+Functions or objects that will be used across *multiple* translation units (i.e., source files),
+should be exposed in an internal header file and placed in the `detail` namespace. Example:
+
+```c++
+// some_utilities.hpp
+namespace cugraph{
+namespace detail{
+void reusable_helper_function(...);
+} // namespace detail
+} // namespace cugraph
+```
+
+#### Anonymous namespace
+
+Functions or objects that will only be used in a *single* translation unit should be defined in an
+*anonymous* namespace in the source file where it is used. Example:
+
+```c++
+// some_file.cpp
+namespace{
+void isolated_helper_function(...);
+} // anonymous namespace
+```
+
+[**Anonymous namespaces should *never* be used in a header file.**](https://wiki.sei.cmu.edu/confluence/display/cplusplus/DCL59-CPP.+Do+not+define+an+unnamed+namespace+in+a+header+file)
+
+# Error Handling
+
+cuGraph follows conventions (and provides utilities) enforcing compile-time and run-time
+conditions and detecting and handling CUDA errors. Communication of errors is always via C++
+exceptions.
+
+## Runtime Conditions
+
+Use the `CUGRAPH_EXPECTS` macro to enforce runtime conditions necessary for correct execution.
+
+Example usage:
+```c++
+CUGRAPH_EXPECTS(lhs.type() == rhs.type(), "Column type mismatch");
+```
+
+The first argument is the conditional expression expected to resolve to `true` under normal
+conditions. If the conditional evaluates to `false`, then an error has occurred and an instance of `cugraph::logic_error` is thrown. The second argument to `CUGRAPH_EXPECTS` is a short description of the
+error that has occurred and is used for the exception's `what()` message.
+
+There are times where a particular code path, if reached, should indicate an error no matter what.
+For example, often the `default` case of a `switch` statement represents an invalid alternative.
+Use the `CUGRAPH_FAIL` macro for such errors. This is effectively the same as calling
+`CUGRAPH_EXPECTS(false, reason)`.
+
+Example:
+```c++
+CUGRAPH_FAIL("This code path should not be reached.");
+```
+
+### CUDA Error Checking
+
+Use the `CUDA_TRY` macro to check for the successful completion of CUDA runtime API functions. This
+macro throws a `cugraph::cuda_error` exception if the CUDA API return value is not `cudaSuccess`. The
+thrown exception includes a description of the CUDA error code in it's `what()` message.
+
+Example:
+
+```c++
+CUDA_TRY( cudaMemcpy(&dst, &src, num_bytes) );
+```
+
+## Compile-Time Conditions
+
+Use `static_assert` to enforce compile-time conditions. For example,
+
+```c++
+template
+void trivial_types_only(T t){
+ static_assert(std::is_trivial::value, "This function requires a trivial type.");
+...
+}
+```
+
+# Data Types
+
+TBD
+
+# Type Dispatcher
+
+TBD
diff --git a/cpp/include/algorithms.hpp b/cpp/include/cugraph/algorithms.hpp
similarity index 69%
rename from cpp/include/algorithms.hpp
rename to cpp/include/cugraph/algorithms.hpp
index a57e550521e..2e0d0f055c8 100644
--- a/cpp/include/algorithms.hpp
+++ b/cpp/include/cugraph/algorithms.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020, NVIDIA CORPORATION.
+ * Copyright (c) 2020-2021, NVIDIA CORPORATION.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,84 +15,16 @@
*/
#pragma once
-#include
-#include
-#include
-#include
+#include
+#include
+#include
-namespace cugraph {
+#include
+#include
-/**
- * @brief Find the PageRank vertex values for a graph.
- *
- * cuGraph computes an approximation of the Pagerank eigenvector using the power method.
- * The number of iterations depends on the properties of the network itself; it increases
- * 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.
+#include
- *
- * @throws cugraph::logic_error with a custom message when an error
- occurs.
- *
- * @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 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 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
- random vertex. Alpha should be greater than 0.0 and strictly lower than 1.0.
- * The initial guess must not be the vector of 0s. Any value other
- than 1 or 0 is treated as an invalid value.
- * @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) 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.
- * 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
- default value, which is 500.
- * @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(raft::handle_t const &handle,
- GraphCSCView const &graph,
- WT *pagerank,
- VT personalization_subset_size = 0,
- VT *personalization_subset = nullptr,
- WT *personalization_values = nullptr,
- double alpha = 0.85,
- double tolerance = 1e-5,
- int64_t max_iter = 500,
- bool has_guess = false);
+namespace cugraph {
/**
* @brief Compute jaccard similarity coefficient for all vertices
@@ -113,7 +45,7 @@ void pagerank(raft::handle_t const &handle,
* caller
*/
template
-void jaccard(GraphCSRView const &graph, WT const *weights, WT *result);
+void jaccard(legacy::GraphCSRView const& graph, WT const* weights, WT* result);
/**
* @brief Compute jaccard similarity coefficient for selected vertex pairs
@@ -137,12 +69,12 @@ void jaccard(GraphCSRView const &graph, WT const *weights, WT *resul
* caller
*/
template
-void jaccard_list(GraphCSRView const &graph,
- WT const *weights,
+void jaccard_list(legacy::GraphCSRView const& graph,
+ WT const* weights,
ET num_pairs,
- VT const *first,
- VT const *second,
- WT *result);
+ VT const* first,
+ VT const* second,
+ WT* result);
/**
* @brief Compute overlap coefficient for all vertices in the graph
@@ -163,7 +95,7 @@ void jaccard_list(GraphCSRView const &graph,
* caller
*/
template
-void overlap(GraphCSRView const &graph, WT const *weights, WT *result);
+void overlap(legacy::GraphCSRView const& graph, WT const* weights, WT* result);
/**
* @brief Compute overlap coefficient for select pairs of vertices
@@ -187,12 +119,12 @@ void overlap(GraphCSRView const &graph, WT const *weights, WT *resul
* caller
*/
template
-void overlap_list(GraphCSRView const &graph,
- WT const *weights,
+void overlap_list(legacy::GraphCSRView const& graph,
+ WT const* weights,
ET num_pairs,
- VT const *first,
- VT const *second,
- WT *result);
+ VT const* first,
+ VT const* second,
+ WT* result);
/**
*
@@ -210,6 +142,8 @@ void overlap_list(GraphCSRView const &graph,
* @tparam weight_t Type of edge weights. 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 COO. Graph is considered undirected. Edge weights are used for this
* algorithm and set to 1 by default.
@@ -246,11 +180,12 @@ void overlap_list(GraphCSRView const &graph,
*
*/
template
-void force_atlas2(GraphCOOView &graph,
- float *pos,
+void force_atlas2(raft::handle_t const& handle,
+ legacy::GraphCOOView& graph,
+ float* pos,
const int max_iter = 500,
- float *x_start = nullptr,
- float *y_start = nullptr,
+ float* x_start = nullptr,
+ float* y_start = nullptr,
bool outbound_attraction_distribution = true,
bool lin_log_mode = false,
bool prevent_overlapping = false,
@@ -262,7 +197,45 @@ void force_atlas2(GraphCOOView &graph,
bool strong_gravity_mode = false,
const float gravity = 1.0,
bool verbose = false,
- internals::GraphBasedDimRedCallback *callback = nullptr);
+ internals::GraphBasedDimRedCallback* callback = nullptr);
+
+/**
+ * @brief Finds an approximate solution to the traveling salesperson problem (TSP).
+ * cuGraph computes an approximation of the TSP problem using hill climbing
+ * optimization.
+ *
+ * The current implementation does not support a weighted graph.
+ *
+ * @throws cugraph::logic_error when an error occurs.
+ * @param[in] handle Library handle (RAFT). If a communicator is set in the
+ * handle, the multi GPU version will be selected.
+ * @param[in] vtx_ptr Device array containing the vertex identifiers used
+ * to initialize the route.
+ * @param[in] x_pos Device array containing starting x-axis positions.
+ * @param[in] y_pos Device array containing starting y-axis positions.
+ * @param[in] nodes Number of cities.
+ * @param[in] restarts Number of starts to try. The more restarts,
+ * the better the solution will be approximated. The number of restarts depends on the problem
+ * size and should be kept low for instances above 2k cities.
+ * @param[in] beam_search Specify if the initial solution should use KNN
+ * for an approximation solution.
+ * @param[in] k Beam width to use in the search.
+ * @param[in] nstart Start from a specific position.
+ * @param[in] verbose Logs configuration and iterative improvement.
+ * @param[out] route Device array containing the returned route.
+ *
+ */
+float traveling_salesperson(raft::handle_t const& handle,
+ int const* vtx_ptr,
+ float const* x_pos,
+ float const* y_pos,
+ int nodes,
+ int restarts,
+ bool beam_search,
+ int k,
+ int nstart,
+ bool verbose,
+ int* route);
/**
* @brief Compute betweenness centrality for a graph
@@ -302,14 +275,14 @@ void force_atlas2(GraphCOOView &graph,
*
*/
template
-void betweenness_centrality(const raft::handle_t &handle,
- GraphCSRView const &graph,
- result_t *result,
+void betweenness_centrality(const raft::handle_t& handle,
+ legacy::GraphCSRView const& graph,
+ result_t* result,
bool normalized = true,
bool endpoints = false,
- weight_t const *weight = nullptr,
+ weight_t const* weight = nullptr,
vertex_t k = 0,
- vertex_t const *vertices = nullptr);
+ vertex_t const* vertices = nullptr);
/**
* @brief Compute edge betweenness centrality for a graph
@@ -346,13 +319,13 @@ void betweenness_centrality(const raft::handle_t &handle,
*
*/
template
-void edge_betweenness_centrality(const raft::handle_t &handle,
- GraphCSRView const &graph,
- result_t *result,
+void edge_betweenness_centrality(const raft::handle_t& handle,
+ legacy::GraphCSRView const& graph,
+ result_t* result,
bool normalized = true,
- weight_t const *weight = nullptr,
+ weight_t const* weight = nullptr,
vertex_t k = 0,
- vertex_t const *vertices = nullptr);
+ vertex_t const* vertices = nullptr);
enum class cugraph_cc_t {
CUGRAPH_WEAK = 0, ///> Weakly Connected Components
@@ -390,9 +363,9 @@ enum class cugraph_cc_t {
* associated with vertex id i.
*/
template
-void connected_components(GraphCSRView const &graph,
+void connected_components(legacy::GraphCSRView const& graph,
cugraph_cc_t connectivity_type,
- VT *labels);
+ VT* labels);
/**
* @brief Compute k truss for a graph
@@ -419,10 +392,10 @@ void connected_components(GraphCSRView const &graph,
*
*/
template
-std::unique_ptr> k_truss_subgraph(
- GraphCOOView const &graph,
+std::unique_ptr> k_truss_subgraph(
+ legacy::GraphCOOView const& graph,
int k,
- rmm::mr::device_memory_resource *mr = rmm::mr::get_current_device_resource());
+ rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());
/**
* @brief Compute the Katz centrality for the nodes of the graph G
@@ -457,8 +430,8 @@ std::unique_ptr> k_truss_subgraph(
* @param[in] normalized If True normalize the resulting katz centrality values
*/
template
-void katz_centrality(GraphCSRView const &graph,
- result_t *result,
+void katz_centrality(legacy::GraphCSRView const& graph,
+ result_t* result,
double alpha,
int max_iter,
double tol,
@@ -475,7 +448,7 @@ void katz_centrality(GraphCSRView const &graph,
*/
/* ----------------------------------------------------------------------------*/
template
-void core_number(GraphCSRView const &graph, VT *core_number);
+void core_number(legacy::GraphCSRView const& graph, VT* core_number);
/**
* @brief Compute K Core of the graph G
@@ -499,13 +472,13 @@ void core_number(GraphCSRView const &graph, VT *core_number);
* @param[out] out_graph Unique pointer to K Core subgraph in COO format
*/
template
-std::unique_ptr> k_core(
- GraphCOOView const &graph,
+std::unique_ptr> k_core(
+ legacy::GraphCOOView const& graph,
int k,
- VT const *vertex_id,
- VT const *core_number,
+ VT const* vertex_id,
+ VT const* core_number,
VT num_vertex_ids,
- rmm::mr::device_memory_resource *mr = rmm::mr::get_current_device_resource());
+ rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());
/**
* @brief Find all 2-hop neighbors in the graph
@@ -525,7 +498,8 @@ std::unique_ptr> k_core(
* @return Graph in COO format
*/
template
-std::unique_ptr> get_two_hop_neighbors(GraphCSRView const &graph);
+std::unique_ptr> get_two_hop_neighbors(
+ legacy::GraphCSRView const& graph);
/**
* @Synopsis Performs a single source shortest path traversal of a graph starting from a vertex.
@@ -552,13 +526,13 @@ std::unique_ptr> get_two_hop_neighbors(GraphCSRView
-void sssp(GraphCSRView const &graph,
- WT *distances,
- VT *predecessors,
+void sssp(legacy::GraphCSRView const& graph,
+ WT* distances,
+ VT* predecessors,
const VT source_vertex);
// FIXME: Internally distances is of int (signed 32-bit) data type, but current
-// template uses data from VT, ET, WT from he GraphCSR View even if weights
+// template uses data from VT, ET, WT from the legacy::GraphCSR View even if weights
// are not considered
/**
* @Synopsis Performs a breadth first search traversal of a graph starting from a vertex.
@@ -593,11 +567,11 @@ void sssp(GraphCSRView const &graph,
*
*/
template
-void bfs(raft::handle_t const &handle,
- GraphCSRView const &graph,
- VT *distances,
- VT *predecessors,
- double *sp_counters,
+void bfs(raft::handle_t const& handle,
+ legacy::GraphCSRView const& graph,
+ VT* distances,
+ VT* predecessors,
+ double* sp_counters,
const VT start_vertex,
bool directed = true,
bool mg_batch = false);
@@ -622,16 +596,50 @@ void bfs(raft::handle_t const &handle,
* @param[in] graph cuGRAPH COO graph
* @param[in] num_workers number of vertices in the worker set
* @param[in] workers device pointer to an array of worker vertex ids
- * @param[out] assignment device pointer to an array to which the assignment will be
+ * @param[out] assignments device pointer to an array to which the assignment will be
* written. The array should be num_workers long, and will identify which vertex id (job) is
* assigned to that worker
*/
template
-weight_t hungarian(raft::handle_t const &handle,
- GraphCOOView const &graph,
+weight_t hungarian(raft::handle_t const& handle,
+ legacy::GraphCOOView const& graph,
vertex_t num_workers,
- vertex_t const *workers,
- vertex_t *assignment);
+ vertex_t const* workers,
+ vertex_t* assignments);
+
+/**
+ * @brief Compute Hungarian algorithm on a weighted bipartite graph
+ *
+ * The Hungarian algorithm computes an assigment of "jobs" to "workers". This function accepts
+ * a weighted graph and a vertex list identifying the "workers". The weights in the weighted
+ * graph identify the cost of assigning a particular job to a worker. The algorithm computes
+ * a minimum cost assignment and returns the cost as well as a vector identifying the assignment.
+ *
+ * @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] handle Library handle (RAFT). If a communicator is set in the handle,
+ * @param[in] graph cuGRAPH COO graph
+ * @param[in] num_workers number of vertices in the worker set
+ * @param[in] workers device pointer to an array of worker vertex ids
+ * @param[out] assignments device pointer to an array to which the assignment will be
+ * written. The array should be num_workers long, and will identify which vertex id (job) is
+ * assigned to that worker
+ * @param[in] epsilon parameter to define precision of comparisons
+ * in reducing weights to zero.
+ */
+template
+weight_t hungarian(raft::handle_t const& handle,
+ legacy::GraphCOOView const& graph,
+ vertex_t num_workers,
+ vertex_t const* workers,
+ vertex_t* assignments,
+ weight_t epsilon);
/**
* @brief Louvain implementation
@@ -646,7 +654,7 @@ weight_t hungarian(raft::handle_t const &handle,
*
* @throws cugraph::logic_error when an error occurs.
*
- * @tparam graph_t Type of graph
+ * @tparam graph_view_t Type of graph
*
* @param[in] handle Library handle (RAFT). If a communicator is set in the handle,
* @param[in] graph input graph object (CSR)
@@ -663,13 +671,74 @@ weight_t hungarian(raft::handle_t const &handle,
* 2) modularity of the returned clustering
*
*/
-template
-std::pair louvain(
- raft::handle_t const &handle,
- graph_t const &graph,
- typename graph_t::vertex_type *clustering,
- size_t max_level = 100,
- typename graph_t::weight_type resolution = typename graph_t::weight_type{1});
+template
+std::pair louvain(
+ raft::handle_t const& handle,
+ graph_view_t const& graph_view,
+ typename graph_view_t::vertex_type* clustering,
+ size_t max_level = 100,
+ typename graph_view_t::weight_type resolution = typename graph_view_t::weight_type{1});
+
+/**
+ * @brief Louvain implementation, returning dendrogram
+ *
+ * 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 graph_view_t Type of graph
+ *
+ * @param[in] handle Library handle (RAFT)
+ * @param[in] graph_view Input graph view object (CSR)
+ * @param[in] max_level (optional) maximum number of levels 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)
+ *
+ * @return a pair containing:
+ * 1) unique pointer to dendrogram
+ * 2) modularity of the returned clustering
+ *
+ */
+template
+std::pair>,
+ typename graph_view_t::weight_type>
+louvain(raft::handle_t const& handle,
+ graph_view_t const& graph_view,
+ size_t max_level = 100,
+ typename graph_view_t::weight_type resolution = typename graph_view_t::weight_type{1});
+
+/**
+ * @brief Flatten a Dendrogram at a particular level
+ *
+ * A Dendrogram represents a hierarchical clustering/partitioning of
+ * a graph. This function will flatten the hierarchical clustering into
+ * a label for each vertex representing the final cluster/partition to
+ * which it is assigned
+ *
+ * @throws cugraph::logic_error when an error occurs.
+ *
+ * @tparam graph_view_t Type of graph
+ *
+ * @param[in] handle Library handle (RAFT). If a communicator is set in the handle,
+ * @param[in] graph input graph object
+ * @param[in] dendrogram input dendrogram object
+ * @param[out] clustering Pointer to device array where the clustering should be stored
+ *
+ */
+template
+void flatten_dendrogram(raft::handle_t const& handle,
+ graph_view_t const& graph_view,
+ Dendrogram const& dendrogram,
+ typename graph_view_t::vertex_type* clustering);
/**
* @brief Leiden implementation
@@ -706,9 +775,9 @@ std::pair louvain(
* 2) modularity of the returned clustering
*/
template
-std::pair leiden(raft::handle_t const &handle,
- GraphCSRView const &graph,
- vertex_t *clustering,
+std::pair leiden(raft::handle_t const& handle,
+ legacy::GraphCSRView const& graph,
+ vertex_t* clustering,
size_t max_iter = 100,
weight_t resolution = weight_t{1});
@@ -738,11 +807,11 @@ std::pair leiden(raft::handle_t const &handle,
* written
*/
template
-void ecg(raft::handle_t const &handle,
- GraphCSRView const &graph,
+void ecg(raft::handle_t const& handle,
+ legacy::GraphCSRView const& graph,
weight_t min_weight,
vertex_t ensemble_size,
- vertex_t *clustering);
+ vertex_t* clustering);
/**
* @brief Generate edges in a minimum spanning forest of an undirected weighted graph.
@@ -765,10 +834,10 @@ void ecg(raft::handle_t const &handle,
* @return out_graph Unique pointer to MSF subgraph in COO format
*/
template
-std::unique_ptr> minimum_spanning_tree(
- raft::handle_t const &handle,
- GraphCSRView const &graph,
- rmm::mr::device_memory_resource *mr = rmm::mr::get_current_device_resource());
+std::unique_ptr> minimum_spanning_tree(
+ raft::handle_t const& handle,
+ legacy::GraphCSRView const& graph,
+ rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());
namespace triangle {
/**
@@ -787,7 +856,7 @@ namespace triangle {
* @return The number of triangles
*/
template
-uint64_t triangle_count(GraphCSRView const &graph);
+uint64_t triangle_count(legacy::GraphCSRView const& graph);
} // namespace triangle
namespace subgraph {
@@ -812,9 +881,9 @@ namespace subgraph {
* @param[out] result a graph in COO format containing the edges in the subgraph
*/
template
-std::unique_ptr> extract_subgraph_vertex(GraphCOOView const &graph,
- VT const *vertices,
- VT num_vertices);
+std::unique_ptr> extract_subgraph_vertex(
+ legacy::GraphCOOView const& graph, VT const* vertices, VT num_vertices);
+} // namespace subgraph
/**
* @brief Wrapper function for Nvgraph balanced cut clustering
@@ -837,18 +906,17 @@ std::unique_ptr> extract_subgraph_vertex(GraphCOOView
-void balancedCutClustering(GraphCSRView const &graph,
+void balancedCutClustering(legacy::GraphCSRView const& graph,
VT num_clusters,
VT num_eigen_vects,
WT evs_tolerance,
int evs_max_iter,
WT kmean_tolerance,
int kmean_max_iter,
- VT *clustering);
+ VT* clustering);
/**
* @brief Wrapper function for Nvgraph spectral modularity maximization algorithm
@@ -872,14 +940,14 @@ void balancedCutClustering(GraphCSRView const &graph,
* be stored
*/
template
-void spectralModularityMaximization(GraphCSRView const &graph,
+void spectralModularityMaximization(legacy::GraphCSRView const& graph,
VT n_clusters,
VT n_eig_vects,
WT evs_tolerance,
int evs_max_iter,
WT kmean_tolerance,
int kmean_max_iter,
- VT *clustering);
+ VT* clustering);
/**
* @brief Wrapper function for Nvgraph clustering modularity metric
@@ -898,10 +966,10 @@ void spectralModularityMaximization(GraphCSRView const &graph,
* @param[out] score Pointer to a float in which the result will be written
*/
template
-void analyzeClustering_modularity(GraphCSRView const &graph,
+void analyzeClustering_modularity(legacy::GraphCSRView const& graph,
int n_clusters,
- VT const *clustering,
- WT *score);
+ VT const* clustering,
+ WT* score);
/**
* @brief Wrapper function for Nvgraph clustering edge cut metric
@@ -920,10 +988,10 @@ void analyzeClustering_modularity(GraphCSRView const &graph,
* @param[out] score Pointer to a float in which the result will be written
*/
template
-void analyzeClustering_edge_cut(GraphCSRView const &graph,
+void analyzeClustering_edge_cut(legacy::GraphCSRView const& graph,
int n_clusters,
- VT const *clustering,
- WT *score);
+ VT const* clustering,
+ WT* score);
/**
* @brief Wrapper function for Nvgraph clustering ratio cut metric
@@ -942,10 +1010,10 @@ void analyzeClustering_edge_cut(GraphCSRView const &graph,
* @param[out] score Pointer to a float in which the result will be written
*/
template
-void analyzeClustering_ratio_cut(GraphCSRView const &graph,
+void analyzeClustering_ratio_cut(legacy::GraphCSRView const& graph,
int n_clusters,
- VT const *clustering,
- WT *score);
+ VT const* clustering,
+ WT* score);
} // namespace ext_raft
@@ -978,13 +1046,13 @@ namespace gunrock {
*
*/
template
-void hits(GraphCSRView const &graph,
+void hits(legacy::GraphCSRView const& graph,
int max_iter,
WT tolerance,
- WT const *starting_value,
+ WT const* starting_value,
bool normalized,
- WT *hubs,
- WT *authorities);
+ WT* hubs,
+ WT* authorities);
} // namespace gunrock
@@ -1007,16 +1075,48 @@ namespace dense {
* @param[in] costs pointer to array of costs, stored in row major order
* @param[in] num_rows number of rows in dense matrix
* @param[in] num_cols number of cols in dense matrix
- * @param[out] assignment device pointer to an array to which the assignment will be
+ * @param[out] assignments device pointer to an array to which the assignment will be
+ * written. The array should be num_cols long, and will identify
+ * which vertex id (job) is assigned to that worker
+ */
+template
+weight_t hungarian(raft::handle_t const& handle,
+ weight_t const* costs,
+ vertex_t num_rows,
+ vertex_t num_columns,
+ vertex_t* assignments);
+
+/**
+ * @brief Compute Hungarian algorithm on a weighted bipartite graph
+ *
+ * The Hungarian algorithm computes an assigment of "jobs" to "workers". This function accepts
+ * a weighted graph and a vertex list identifying the "workers". The weights in the weighted
+ * graph identify the cost of assigning a particular job to a worker. The algorithm computes
+ * a minimum cost assignment and returns the cost as well as a vector identifying the assignment.
+ *
+ * @throws cugraph::logic_error when an error occurs.
+ *
+ * @tparam vertex_t Type of vertex identifiers. Supported value : int (signed,
+ * 32-bit)
+ * @tparam weight_t Type of edge weights. Supported values : float or double.
+ *
+ * @param[in] handle Library handle (RAFT). If a communicator is set in the handle,
+ * @param[in] costs pointer to array of costs, stored in row major order
+ * @param[in] num_rows number of rows in dense matrix
+ * @param[in] num_cols number of cols in dense matrix
+ * @param[out] assignments device pointer to an array to which the assignment will be
* written. The array should be num_cols long, and will identify
* which vertex id (job) is assigned to that worker
+ * @param[in] epsilon parameter to define precision of comparisons
+ * in reducing weights to zero.
*/
template
-weight_t hungarian(raft::handle_t const &handle,
- weight_t const *costs,
+weight_t hungarian(raft::handle_t const& handle,
+ weight_t const* costs,
vertex_t num_rows,
vertex_t num_columns,
- vertex_t *assignment);
+ vertex_t* assignments,
+ weight_t epsilon);
} // namespace dense
@@ -1035,6 +1135,8 @@ namespace experimental {
* @tparam vertex_t Type of vertex identifiers. Needs to be an integral type.
* @tparam edge_t Type of edge identifiers. Needs to be an integral type.
* @tparam weight_t Type of edge weights. Needs to be a floating point type.
+ * @tparam multi_gpu Flag indicating whether template instantiation should target single-GPU (false)
+ * or multi-GPU (true).
* @param handle RAFT handle object to encapsulate resources (e.g. CUDA stream, communicator, and
* handles to various CUDA libraries) to run graph algorithms.
* @param graph_view Graph view object.
@@ -1051,10 +1153,10 @@ namespace experimental {
* @param do_expensive_check A flag to run expensive checks for input arguments (if set to `true`).
*/
template
-void bfs(raft::handle_t const &handle,
- graph_view_t const &graph_view,
- vertex_t *distances,
- vertex_t *predecessors,
+void bfs(raft::handle_t const& handle,
+ graph_view_t const& graph_view,
+ vertex_t* distances,
+ vertex_t* predecessors,
vertex_t source_vertex,
bool direction_optimizing = false,
vertex_t depth_limit = std::numeric_limits::max(),
@@ -1073,6 +1175,8 @@ void bfs(raft::handle_t const &handle,
* @tparam vertex_t Type of vertex identifiers. Needs to be an integral type.
* @tparam edge_t Type of edge identifiers. Needs to be an integral type.
* @tparam weight_t Type of edge weights. Needs to be a floating point type.
+ * @tparam multi_gpu Flag indicating whether template instantiation should target single-GPU (false)
+ * or multi-GPU (true).
* @param handle RAFT handle object to encapsulate resources (e.g. CUDA stream, communicator, and
* handles to various CUDA libraries) to run graph algorithms.
* @param graph_view Graph view object.
@@ -1084,10 +1188,10 @@ void bfs(raft::handle_t const &handle,
* @param do_expensive_check A flag to run expensive checks for input arguments (if set to `true`).
*/
template
-void sssp(raft::handle_t const &handle,
- graph_view_t const &graph_view,
- weight_t *distances,
- vertex_t *predecessors,
+void sssp(raft::handle_t const& handle,
+ graph_view_t const& graph_view,
+ weight_t* distances,
+ vertex_t* predecessors,
vertex_t source_vertex,
weight_t cutoff = std::numeric_limits::max(),
bool do_expensive_check = false);
@@ -1105,20 +1209,22 @@ void sssp(raft::handle_t const &handle,
* @tparam edge_t Type of edge identifiers. Needs to be an integral type.
* @tparam weight_t Type of edge weights. Needs to be a floating point type.
* @tparam result_t Type of PageRank scores.
+ * @tparam multi_gpu Flag indicating whether template instantiation should target single-GPU (false)
+ * or multi-GPU (true).
* @param handle RAFT handle object to encapsulate resources (e.g. CUDA stream, communicator, and
* handles to various CUDA libraries) to run graph algorithms.
* @param graph_view Graph view object.
- * @param adj_matrix_row_out_weight_sums Pointer to an array storing sums of out-going edge weights
- * for the vertices in the rows of the graph adjacency matrix (for re-use) or `nullptr`. If
- * `nullptr`, these values are freshly computed. Computing these values outsid this function reduces
- * the number of memoray allocations/deallocations and computing if a user repeatedly computes
- * PageRank scores using the same graph with different personalization vectors.
+ * @param precomputed_vertex_out_weight_sums Pointer to an array storing sums of out-going edge
+ * weights for the vertices (for re-use) or `std::nullopt`. If `std::nullopt`, these values are
+ * freshly computed. Computing these values outside this function reduces the number of memory
+ * allocations/deallocations and computing if a user repeatedly computes PageRank scores using the
+ * same graph with different personalization vectors.
* @param personalization_vertices Pointer to an array storing personalization vertex identifiers
- * (compute personalized PageRank) or `nullptr` (compute general PageRank).
+ * (compute personalized PageRank) or `std::nullopt` (compute general PageRank).
* @param personalization_values Pointer to an array storing personalization values for the vertices
- * in the personalization set. Relevant only if @p personalization_vertices is not `nullptr`.
+ * in the personalization set. Relevant only if @p personalization_vertices is not `std::nullopt`.
* @param personalization_vector_size Size of the personalization set. If @personalization_vertices
- * is not `nullptr`, the sizes of the arrays pointed by @p personalization_vertices and @p
+ * is not `std::nullopt`, the sizes of the arrays pointed by @p personalization_vertices and @p
* personalization_values should be @p personalization_vector_size.
* @param pageranks Pointer to the output PageRank score array.
* @param alpha PageRank damping factor.
@@ -1132,13 +1238,13 @@ void sssp(raft::handle_t const &handle,
* @param do_expensive_check A flag to run expensive checks for input arguments (if set to `true`).
*/
template
-void pagerank(raft::handle_t const &handle,
- graph_view_t const &graph_view,
- weight_t *adj_matrix_row_out_weight_sums,
- vertex_t *personalization_vertices,
- result_t *personalization_values,
- vertex_t personalization_vector_size,
- result_t *pageranks,
+void pagerank(raft::handle_t const& handle,
+ graph_view_t const& graph_view,
+ std::optional precomputed_vertex_out_weight_sums,
+ std::optional personalization_vertices,
+ std::optional personalization_values,
+ std::optional personalization_vector_size,
+ result_t* pageranks,
result_t alpha,
result_t epsilon,
size_t max_iterations = 500,
@@ -1157,6 +1263,8 @@ void pagerank(raft::handle_t const &handle,
* @tparam edge_t Type of edge identifiers. Needs to be an integral type.
* @tparam weight_t Type of edge weights. Needs to be a floating point type.
* @tparam result_t Type of Katz Centrality scores.
+ * @tparam multi_gpu Flag indicating whether template instantiation should target single-GPU (false)
+ * or multi-GPU (true).
* @param handle RAFT handle object to encapsulate resources (e.g. CUDA stream, communicator, and
* handles to various CUDA libraries) to run graph algorithms.
* @param graph_view Graph view object.
@@ -1180,10 +1288,10 @@ void pagerank(raft::handle_t const &handle,
* @param do_expensive_check A flag to run expensive checks for input arguments (if set to `true`).
*/
template
-void katz_centrality(raft::handle_t const &handle,
- graph_view_t const &graph_view,
- result_t *betas,
- result_t *katz_centralities,
+void katz_centrality(raft::handle_t const& handle,
+ graph_view_t const& graph_view,
+ result_t const* betas,
+ result_t* katz_centralities,
result_t alpha,
result_t beta,
result_t epsilon,
@@ -1191,6 +1299,96 @@ void katz_centrality(raft::handle_t const &handle,
bool has_initial_guess = false,
bool normalize = false,
bool do_expensive_check = false);
+/**
+ * @brief returns induced EgoNet subgraph(s) of neighbors centered at nodes in source_vertex within
+ * a given radius.
+ *
+ * @tparam vertex_t Type of vertex identifiers. Needs to be an integral type.
+ * @tparam edge_t Type of edge identifiers. Needs to be an integral type.
+ * @tparam weight_t Type of edge weights. Needs to be a floating point type.
+ * @tparam multi_gpu Flag indicating whether template instantiation should target single-GPU (false)
+ * or multi-GPU (true).
+ * @param handle RAFT handle object to encapsulate resources (e.g. CUDA stream, communicator, and
+ * handles to various CUDA libraries) to run graph algorithms. Must have at least one worker stream.
+ * @param graph_view Graph view object of, we extract induced egonet subgraphs from @p graph_view.
+ * @param source_vertex Pointer to egonet center vertices (size == @p n_subgraphs).
+ * @param n_subgraphs Number of induced EgoNet subgraphs to extract (ie. number of elements in @p
+ * source_vertex).
+ * @param radius Include all neighbors of distance <= radius from @p source_vertex.
+ * @return std::tuple, rmm::device_uvector,
+ * rmm::device_uvector, rmm::device_uvector> Quadraplet of edge source vertices,
+ * edge destination vertices, edge weights, and edge offsets for each induced EgoNet subgraph.
+ */
+template
+std::tuple,
+ rmm::device_uvector,
+ std::optional>,
+ rmm::device_uvector>
+extract_ego(raft::handle_t const& handle,
+ graph_view_t const& graph_view,
+ vertex_t* source_vertex,
+ vertex_t n_subgraphs,
+ vertex_t radius);
+
+/**
+ * @brief returns random walks (RW) from starting sources, where each path is of given maximum
+ * length. Uniform distribution is assumed for the random engine.
+ *
+ * @tparam graph_t Type of graph/view (typically, graph_view_t).
+ * @tparam index_t Type used to store indexing and sizes.
+ * @param handle RAFT handle object to encapsulate resources (e.g. CUDA stream, communicator, and
+ * handles to various CUDA libraries) to run graph algorithms.
+ * @param graph Graph (view )object to generate RW on.
+ * @param ptr_d_start Device pointer to set of starting vertex indices for the RW.
+ * @param num_paths = number(paths).
+ * @param max_depth maximum length of RWs.
+ * @param use_padding (optional) specifies if return uses padded format (true), or coalesced
+ * (compressed) format; when padding is used the output is a matrix of vertex paths and a matrix of
+ * edges paths (weights); in this case the matrices are stored in row major order; the vertex path
+ * matrix is padded with `num_vertices` values and the weight matrix is padded with `0` values;
+ * @return std::tuple, rmm::device_uvector,
+ * rmm::device_uvector> Triplet of either padded or coalesced RW paths; in the coalesced
+ * case (default), the return consists of corresponding vertex and edge weights for each, and
+ * corresponding path sizes. This is meant to minimize the number of DF's to be passed to the Python
+ * layer. The meaning of "coalesced" here is that a 2D array of paths of different sizes is
+ * represented as a 1D contiguous array. In the padded case the return is a matrix of num_paths x
+ * max_depth vertex paths; and num_paths x (max_depth-1) edge (weight) paths, with an empty array of
+ * sizes. Note: if the graph is un-weighted the edge (weight) paths consists of `weight_t{1}`
+ * entries;
+ */
+template
+std::tuple,
+ rmm::device_uvector,
+ rmm::device_uvector>
+random_walks(raft::handle_t const& handle,
+ graph_t const& graph,
+ typename graph_t::vertex_type const* ptr_d_start,
+ index_t num_paths,
+ index_t max_depth,
+ bool use_padding = false);
+
+/**
+ * @brief Finds (weakly-connected-)component IDs of each vertices in the input graph.
+ *
+ * The input graph must be symmetric. Component IDs can be arbitrary integers (they can be
+ * non-consecutive and are not ordered by component size or any other criterion).
+ *
+ * @tparam vertex_t Type of vertex identifiers. Needs to be an integral type.
+ * @tparam edge_t Type of edge identifiers. Needs to be an integral type.
+ * @tparam weight_t Type of edge weights. Needs to be a floating point type.
+ * @tparam multi_gpu Flag indicating whether template instantiation should target single-GPU (false)
+ * or multi-GPU (true).
+ * @param handle RAFT handle object to encapsulate resources (e.g. CUDA stream, communicator, and
+ * @param graph_view Graph view object.
+ * @param components Pointer to the output component ID array.
+ * @param do_expensive_check A flag to run expensive checks for input arguments (if set to `true`).
+ */
+template
+void weakly_connected_components(
+ raft::handle_t const& handle,
+ graph_view_t const& graph_view,
+ vertex_t* components,
+ bool do_expensive_check = false);
} // namespace experimental
} // namespace cugraph
diff --git a/cpp/include/compute_partition.cuh b/cpp/include/cugraph/compute_partition.cuh
similarity index 79%
rename from cpp/include/compute_partition.cuh
rename to cpp/include/cugraph/compute_partition.cuh
index c81a6237b31..b8ad0fc19ab 100644
--- a/cpp/include/compute_partition.cuh
+++ b/cpp/include/cugraph/compute_partition.cuh
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020, NVIDIA CORPORATION.
+ * Copyright (c) 2020-2021, NVIDIA CORPORATION.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -17,7 +17,7 @@
#include
-#include
+#include
#include
@@ -39,27 +39,32 @@ class compute_partition_t {
using graph_view_t = graph_view_type;
using vertex_t = typename graph_view_type::vertex_type;
- compute_partition_t(graph_view_t const &graph_view)
+ compute_partition_t(raft::handle_t const& handle, graph_view_t const& graph_view)
+ : vertex_partition_offsets_v_(0, handle.get_stream())
{
- init(graph_view);
+ init(handle, graph_view);
}
private:
- template * = nullptr>
- void init(graph_view_t const &graph_view)
+ template * = nullptr>
+ void init(raft::handle_t const& handle, graph_view_t const& graph_view)
{
}
- template * = nullptr>
- void init(graph_view_t const &graph_view)
+ template * = nullptr>
+ void init(raft::handle_t const& handle, graph_view_t const& graph_view)
{
auto partition = graph_view.get_partition();
row_size_ = partition.get_row_size();
col_size_ = partition.get_col_size();
size_ = row_size_ * col_size_;
- vertex_partition_offsets_v_.resize(size_ + 1);
- vertex_partition_offsets_v_ = partition.get_vertex_partition_offsets();
+ vertex_partition_offsets_v_.resize(size_ + 1, handle.get_stream());
+ auto vertex_partition_offsets = partition.get_vertex_partition_offsets();
+ raft::update_device(vertex_partition_offsets_v_.data(),
+ vertex_partition_offsets.data(),
+ vertex_partition_offsets.size(),
+ handle.get_stream());
}
public:
@@ -76,7 +81,7 @@ class compute_partition_t {
*/
class vertex_device_view_t {
public:
- vertex_device_view_t(vertex_t const *d_vertex_partition_offsets, int size)
+ vertex_device_view_t(vertex_t const* d_vertex_partition_offsets, int size)
: d_vertex_partition_offsets_(d_vertex_partition_offsets), size_(size)
{
}
@@ -101,13 +106,13 @@ class compute_partition_t {
}
private:
- vertex_t const *d_vertex_partition_offsets_;
+ vertex_t const* d_vertex_partition_offsets_;
int size_;
};
class edge_device_view_t {
public:
- edge_device_view_t(vertex_t const *d_vertex_partition_offsets,
+ edge_device_view_t(vertex_t const* d_vertex_partition_offsets,
int row_size,
int col_size,
int size)
@@ -153,7 +158,7 @@ class compute_partition_t {
}
private:
- vertex_t const *d_vertex_partition_offsets_;
+ vertex_t const* d_vertex_partition_offsets_;
int row_size_;
int col_size_;
int size_;
@@ -166,7 +171,7 @@ class compute_partition_t {
*/
vertex_device_view_t vertex_device_view() const
{
- return vertex_device_view_t(vertex_partition_offsets_v_.data().get(), size_);
+ return vertex_device_view_t(vertex_partition_offsets_v_.data(), size_);
}
/**
@@ -176,12 +181,11 @@ class compute_partition_t {
*/
edge_device_view_t edge_device_view() const
{
- return edge_device_view_t(
- vertex_partition_offsets_v_.data().get(), row_size_, col_size_, size_);
+ return edge_device_view_t(vertex_partition_offsets_v_.data(), row_size_, col_size_, size_);
}
private:
- rmm::device_vector vertex_partition_offsets_v_{};
+ rmm::device_uvector vertex_partition_offsets_v_;
int row_size_{1};
int col_size_{1};
int size_{1};
diff --git a/cpp/include/cugraph/dendrogram.hpp b/cpp/include/cugraph/dendrogram.hpp
new file mode 100644
index 00000000000..beebec4fd3f
--- /dev/null
+++ b/cpp/include/cugraph/dendrogram.hpp
@@ -0,0 +1,70 @@
+/*
+ * Copyright (c) 2021, NVIDIA CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * 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
+
+#include
+
+#include
+#include
+
+namespace cugraph {
+
+template
+class Dendrogram {
+ public:
+ void add_level(vertex_t first_index,
+ vertex_t num_verts,
+ rmm::cuda_stream_view stream_view,
+ rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource())
+ {
+ level_ptr_.push_back(
+ std::make_unique>(num_verts, stream_view, mr));
+ level_first_index_.push_back(first_index);
+ }
+
+ size_t current_level() const { return level_ptr_.size() - 1; }
+
+ size_t num_levels() const { return level_ptr_.size(); }
+
+ vertex_t const* get_level_ptr_nocheck(size_t level) const { return level_ptr_[level]->data(); }
+
+ vertex_t* get_level_ptr_nocheck(size_t level) { return level_ptr_[level]->data(); }
+
+ size_t get_level_size_nocheck(size_t level) const { return level_ptr_[level]->size(); }
+
+ vertex_t get_level_first_index_nocheck(size_t level) const { return level_first_index_[level]; }
+
+ vertex_t const* current_level_begin() const { return get_level_ptr_nocheck(current_level()); }
+
+ vertex_t const* current_level_end() const { return current_level_begin() + current_level_size(); }
+
+ vertex_t* current_level_begin() { return get_level_ptr_nocheck(current_level()); }
+
+ vertex_t* current_level_end() { return current_level_begin() + current_level_size(); }
+
+ size_t current_level_size() const { return get_level_size_nocheck(current_level()); }
+
+ vertex_t current_level_first_index() const
+ {
+ return get_level_first_index_nocheck(current_level());
+ }
+
+ private:
+ std::vector level_first_index_;
+ std::vector>> level_ptr_;
+};
+
+} // namespace cugraph
diff --git a/cpp/include/cugraph/detail/shuffle_wrappers.hpp b/cpp/include/cugraph/detail/shuffle_wrappers.hpp
new file mode 100644
index 00000000000..fcfd98db447
--- /dev/null
+++ b/cpp/include/cugraph/detail/shuffle_wrappers.hpp
@@ -0,0 +1,102 @@
+/*
+ * Copyright (c) 2021, NVIDIA CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * 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
+
+#include
+#include
+
+namespace cugraph {
+namespace detail {
+
+/**
+ * @brief Shuffle edgelist using the edge key function
+ *
+ * NOTE: d_edgelist_rows, d_edgelist_cols and d_edgelist_weights
+ * are modified within this function (data is sorted)
+ * But the actual output is returned. The exact contents
+ * of d_edgelist_rows, d_edgelist_cols and d_edgelist_weights
+ * after the function is undefined.
+ *
+ * @tparam vertex_t vertex type
+ * @tparam weight_t weight type
+ *
+ * @param[in] handle raft handle
+ * @param[in/out] d_edgelist_rows vertex ids for row
+ * @param[in/out] d_edgelist_cols vertex ids for column
+ * @param[in/out] d_edgelist_weights optional edge weights
+ * @param[in] store_transposed true if operating on
+ * transposed matrix
+ *
+ * @return tuple of shuffled rows, columns and optional weights
+ */
+template
+std::tuple,
+ rmm::device_uvector,
+ std::optional>>
+shuffle_edgelist_by_edge(raft::handle_t const& handle,
+ rmm::device_uvector& d_edgelist_rows,
+ rmm::device_uvector& d_edgelist_cols,
+ std::optional>& d_edgelist_weights,
+ bool store_transposed);
+
+/**
+ * @brief Shuffle vertices using the vertex key function
+ *
+ * NOTE: d_value is modified within this function
+ * (data is sorted). But the actual output is returned.
+ * The exact contents of d_value after the function is
+ * undefined.
+ *
+ * @tparam vertex_t vertex type
+ *
+ * @param[in] handle raft handle
+ * @param[in/out] d_vertices vertex ids to shuffle
+ *
+ * @return device vector of shuffled vertices
+ */
+template
+rmm::device_uvector shuffle_vertices(raft::handle_t const& handle,
+ rmm::device_uvector& d_vertices);
+
+/**
+ * @brief Groupby and count edgelist using the edge key function
+ *
+ * NOTE: d_edgelist_rows, d_edgelist_cols and d_edgelist_weights
+ * are modified within this function (data is sorted)
+ * But the actual output is returned. The exact contents
+ * of d_edgelist_rows, d_edgelist_cols and d_edgelist_weights
+ * after the function is undefined.
+ *
+ * @tparam vertex_t vertex type
+ * @tparam weight_t weight type
+ *
+ * @param[in] handle raft handle
+ * @param[in/out] d_edgelist_rows vertex ids for row
+ * @param[in/out] d_edgelist_cols vertex ids for column
+ * @param[in/out] d_edgelist_weights optional edge weights
+ *
+ * @return tuple of shuffled rows, columns and optional weights
+ */
+template
+rmm::device_uvector groupby_and_count_by_edge(
+ raft::handle_t const& handle,
+ rmm::device_uvector& d_edgelist_rows,
+ rmm::device_uvector& d_edgelist_cols,
+ std::optional>& d_edgelist_weights,
+ size_t number_of_local_adj_matrix_partitions);
+
+} // namespace detail
+} // namespace cugraph
diff --git a/cpp/include/cugraph/detail/utility_wrappers.hpp b/cpp/include/cugraph/detail/utility_wrappers.hpp
new file mode 100644
index 00000000000..580ca00250a
--- /dev/null
+++ b/cpp/include/cugraph/detail/utility_wrappers.hpp
@@ -0,0 +1,89 @@
+/*
+ * Copyright (c) 2021, NVIDIA CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * 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
+
+#include
+#include
+
+namespace cugraph {
+namespace detail {
+
+/**
+ * @brief Fill a buffer with uniformly distributed random values
+ *
+ * Fills a buffer with uniformly distributed random values between
+ * the specified minimum and maximum values.
+ *
+ * @tparam value_t type of the value to operate on
+ *
+ * @param[in] stream_view stream view
+ * @param[out] d_value device array to fill
+ * @param[in] size number of elements in array
+ * @param[in] min_value minimum value
+ * @param[in] max_value maximum value
+ * @param[in] seed seed for initializing random number generator
+ *
+ */
+template
+void uniform_random_fill(rmm::cuda_stream_view const& stream_view,
+ value_t* d_value,
+ size_t size,
+ value_t min_value,
+ value_t max_value,
+ uint64_t seed);
+
+/**
+ * @brief Fill a buffer with a sequence of values
+ *
+ * Fills the buffer with the sequence:
+ * {start_value, start_value+1, start_value+2, ..., start_value+size-1}
+ *
+ * Similar to the function std::iota, wraps the function thrust::sequence
+ *
+ * @tparam value_t type of the value to operate on
+ *
+ * @param[in] stream_view stream view
+ * @param[out] d_value device array to fill
+ * @param[in] size number of elements in array
+ * @param[in] start_value starting value for sequence
+ *
+ */
+template
+void sequence_fill(rmm::cuda_stream_view const& stream_view,
+ value_t* d_value,
+ size_t size,
+ value_t start_value);
+
+/**
+ * @brief Compute the maximum vertex id of an edge list
+ *
+ * max(d_edgelist_rows.max(), d_edgelist_cols.max())
+ *
+ * @tparam vertex_t vertex type
+ *
+ * @param[in] stream_view stream view
+ * @param[in] d_edgelist_rows device array to fill
+ * @param[in] d_edgelist_cols number of elements in array
+ *
+ * @param the maximum value occurring in the edge list
+ */
+template
+vertex_t compute_maximum_vertex_id(rmm::cuda_stream_view const& stream_view,
+ rmm::device_uvector const& d_edgelist_rows,
+ rmm::device_uvector const& d_edgelist_cols);
+
+} // namespace detail
+} // namespace cugraph
diff --git a/cpp/include/cugraph/experimental/detail/graph_utils.cuh b/cpp/include/cugraph/experimental/detail/graph_utils.cuh
new file mode 100644
index 00000000000..02da9a80854
--- /dev/null
+++ b/cpp/include/cugraph/experimental/detail/graph_utils.cuh
@@ -0,0 +1,177 @@
+/*
+ * Copyright (c) 2020-2021, NVIDIA CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * 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
+
+#include
+#include
+#include
+#include