diff --git a/.flake8 b/.flake8 index 28d4f21a4..e7163df03 100644 --- a/.flake8 +++ b/.flake8 @@ -14,3 +14,5 @@ per-file-ignores = __init__.py:F401,F403, _nx_cugraph/__init__.py:E501, nx_cugraph/__init__.py:E402,F401,F403, + benchmarks/nx-cugraph/pytest-based/create_results_summary_page.py:E501,W605, + docs/nx-cugraph/source/conf.py:E501 diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index b75446551..671d5f6a9 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -13,47 +13,13 @@ jobs: pr-builder: needs: - checks - - docs-build - - wheel-build-nx-cugraph - - wheel-tests-nx-cugraph secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/pr-builder.yaml@python-3.12 + uses: rapidsai/shared-workflows/.github/workflows/pr-builder.yaml@branch-24.12 + if: always() + with: + needs: ${{ toJSON(needs) }} checks: secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/checks.yaml@python-3.12 + uses: rapidsai/shared-workflows/.github/workflows/checks.yaml@branch-24.12 with: enable_check_generated_files: false - conda-notebook-tests: - needs: conda-python-build - secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/custom-job.yaml@python-3.12 - with: - build_type: pull-request - node_type: "gpu-v100-latest-1" - arch: "amd64" - container_image: "rapidsai/ci-conda:cuda11.8.0-ubuntu22.04-py3.10" - run_script: "ci/test_notebooks.sh" - docs-build: - needs: conda-python-build - secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/custom-job.yaml@python-3.12 - with: - build_type: pull-request - node_type: "gpu-v100-latest-1" - arch: "amd64" - container_image: "rapidsai/ci-conda:cuda11.8.0-ubuntu22.04-py3.10" - run_script: "ci/build_docs.sh" - wheel-build-nx-cugraph: - needs: wheel-tests-pylibcugraph - secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/wheels-build.yaml@python-3.12 - with: - build_type: pull-request - script: ci/build_wheel_nx-cugraph.sh - wheel-tests-nx-cugraph: - needs: wheel-build-nx-cugraph - secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/wheels-test.yaml@python-3.12 - with: - build_type: pull-request - script: ci/test_wheel_nx-cugraph.sh diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a8fb6b95b..f923bce8a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,54 +1,91 @@ ## https://pre-commit.com/ # # Before first use: `pre-commit install` -# To run: `pre-commit run --all-files` +# To run: `make lint` +# To update: `make lint-update` +# - &flake8_dependencies below needs updated manually exclude: '^thirdparty' +fail_fast: false +default_language_version: + python: python3 repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.5.0 + rev: v5.0.0 hooks: - id: check-added-large-files + - id: check-case-conflict + - id: check-merge-conflict + - id: check-symlinks + - id: check-ast + - id: check-toml + - id: check-yaml - id: debug-statements - id: end-of-file-fixer + exclude_types: [svg] - id: mixed-line-ending + - id: no-commit-to-branch + args: [-p, "^branch-2....$"] - id: trailing-whitespace - repo: https://github.com/PyCQA/flake8 rev: 7.1.1 hooks: - id: flake8 - args: ["--config=.flake8"] - files: nx_cugraph.*$ - types: [file] - types_or: [python] # TODO: Enable [python, cython] - additional_dependencies: ["flake8-force"] + args: ["--config=.flake8"] # uses config + additional_dependencies: &flake8_dependencies + # These versions need updated manually + - flake8==7.1.1 + - flake8-bugbear==24.8.19 + - flake8-simplify==0.21.0 - repo: https://github.com/asottile/yesqa rev: v1.3.0 hooks: - id: yesqa - additional_dependencies: - - flake8==7.1.1 - - repo: https://github.com/pre-commit/mirrors-clang-format - rev: v16.0.6 + additional_dependencies: *flake8_dependencies + - repo: https://github.com/abravalheri/validate-pyproject + rev: v0.19 + hooks: + - id: validate-pyproject + name: Validate pyproject.toml + - repo: https://github.com/PyCQA/autoflake + rev: v2.3.1 + hooks: + - id: autoflake + args: [--in-place] + - repo: https://github.com/pycqa/isort + rev: 5.13.2 hooks: - - id: clang-format - types_or: [c, c++, cuda] - args: ["-fallback-style=none", "-style=file", "-i"] + - id: isort + - repo: https://github.com/asottile/pyupgrade + rev: v3.17.0 + hooks: + - id: pyupgrade + args: [--py310-plus] + - repo: https://github.com/psf/black + rev: 24.8.0 + hooks: + - id: black + - repo: https://github.com/codespell-project/codespell + rev: v2.3.0 + hooks: + - id: codespell + types_or: [python, rst, markdown] + additional_dependencies: [tomli] + files: ^(nx_cugraph|docs)/ + args: ["-L thirdparty,coo,COO,numer"] - repo: https://github.com/rapidsai/pre-commit-hooks rev: v0.4.0 hooks: - id: verify-copyright files: | (?x) - [.](cmake|cpp|cu|cuh|h|hpp|sh|pxd|py|pyx)$| - CMakeLists[.]txt$| - CMakeLists_standalone[.]txt$| + [.](sh|py)$| [.]flake8[.]cython$| meta[.]yaml$| setup[.]cfg$ - id: verify-alpha-spec args: ["--fix"] - repo: https://github.com/rapidsai/dependency-file-generator - rev: v1.13.11 + rev: v1.16.0 hooks: - id: rapids-dependency-file-generator args: ["--clean"] @@ -61,7 +98,7 @@ repos: types: [python] language: python pass_filenames: false - additional_dependencies: ["networkx>=3.3"] + additional_dependencies: ["networkx>=3.4"] - repo: local hooks: - id: nx-cugraph-readme-update diff --git a/Makefile b/Makefile index 6500d834e..643287b19 100644 --- a/Makefile +++ b/Makefile @@ -2,15 +2,7 @@ SHELL= /bin/bash .PHONY: all -all: plugin-info lint readme - -.PHONY: lint -lint: - git ls-files | xargs pre-commit run --config lint.yaml --files || true - -.PHONY: lint-update -lint-update: - pre-commit autoupdate --config lint.yaml +all: plugin-info readme .PHONY: plugin-info plugin-info: diff --git a/benchmarks/nx-cugraph/pytest-based/bench_algos.py b/benchmarks/nx-cugraph/pytest-based/bench_algos.py index f88d93c3f..03f16fc1a 100644 --- a/benchmarks/nx-cugraph/pytest-based/bench_algos.py +++ b/benchmarks/nx-cugraph/pytest-based/bench_algos.py @@ -11,12 +11,11 @@ # See the License for the specific language governing permissions and # limitations under the License. -import random - import networkx as nx import pandas as pd import pytest from cugraph import datasets + import nx_cugraph as nxcg # Attempt to import the NetworkX dispatching module, which is only needed when diff --git a/benchmarks/nx-cugraph/pytest-based/create_results_summary_page.py b/benchmarks/nx-cugraph/pytest-based/create_results_summary_page.py index f1cc4b06c..bbe449c86 100644 --- a/benchmarks/nx-cugraph/pytest-based/create_results_summary_page.py +++ b/benchmarks/nx-cugraph/pytest-based/create_results_summary_page.py @@ -12,17 +12,17 @@ # limitations under the License. -import re -import pathlib import json +import pathlib import platform -import psutil +import re import socket import subprocess +import psutil + def get_formatted_time_value(time): - res = "" if time < 1: if time < 0.001: units = "us" @@ -40,7 +40,8 @@ def get_all_benchmark_info(): # Populate benchmarks dir from .json files for json_file in logs_dir.glob("*.json"): try: - data = json.loads(open(json_file).read()) + with open(json_file) as file: + data = json.loads(file.read()) except json.decoder.JSONDecodeError: continue @@ -155,8 +156,8 @@ def get_system_info(): if __name__ == "__main__": logs_dir = pathlib.Path("logs") - dataset_patt = re.compile(".*ds=([\w-]+).*") - backend_patt = re.compile(".*backend=(\w+).*") + dataset_patt = re.compile(r".*ds=([\w-]+).*") + backend_patt = re.compile(r".*backend=(\w+).*") k_patt = re.compile(".*k=(10*).*") # Organize all benchmark runs by the following hierarchy: algo -> backend -> dataset @@ -266,7 +267,7 @@ def get_system_info(): f" {nx_formatted} / {cg_formatted}
{speedup}
{runtime_delta}" ) else: - print(f" ") + print(" ") # If a comparison between cugraph and NX cannot be made, output empty cells # for each dataset diff --git a/benchmarks/nx-cugraph/pytest-based/get_graph_bench_dataset.py b/benchmarks/nx-cugraph/pytest-based/get_graph_bench_dataset.py index 5a0a15da8..4732e5b84 100644 --- a/benchmarks/nx-cugraph/pytest-based/get_graph_bench_dataset.py +++ b/benchmarks/nx-cugraph/pytest-based/get_graph_bench_dataset.py @@ -18,14 +18,14 @@ Positional Arguments: 1) dataset name (e.g. 'email_Eu_core', 'cit-patents') - available datasets can be found here: `python/cugraph/cugraph/datasets/__init__.py` + available datasets can be found here: + - `python/cugraph/cugraph/datasets/__init__.py` """ import sys import cugraph.datasets as cgds - if __name__ == "__main__": # download and store dataset (csv) by using the Datasets API dataset = sys.argv[1].replace("-", "_") diff --git a/ci/check_style.sh b/ci/check_style.sh old mode 100644 new mode 100755 diff --git a/dependencies.yaml b/dependencies.yaml index c2d505253..6b054d87f 100644 --- a/dependencies.yaml +++ b/dependencies.yaml @@ -36,7 +36,7 @@ files: - test_notebook py_build_nx_cugraph: output: pyproject - pyproject_dir: python/nx-cugraph + pyproject_dir: . extras: table: build-system includes: @@ -44,7 +44,7 @@ files: - python_build_wheel py_run_nx_cugraph: output: pyproject - pyproject_dir: python/nx-cugraph + pyproject_dir: . extras: table: project includes: @@ -53,7 +53,7 @@ files: - python_run_nx_cugraph py_test_nx_cugraph: output: pyproject - pyproject_dir: python/nx-cugraph + pyproject_dir: . extras: table: project.optional-dependencies key: test diff --git a/docs/nx-cugraph/source/basics/cugraph_cascading.md b/docs/nx-cugraph/source/basics/cugraph_cascading.md deleted file mode 100644 index bad3d7fa6..000000000 --- a/docs/nx-cugraph/source/basics/cugraph_cascading.md +++ /dev/null @@ -1,53 +0,0 @@ - -# Method Cascading and cuGraph - -BLUF: cuGraph does not support method cascading - -[Method Cascading](https://en.wikipedia.org/wiki/Method_cascading) is a popular, and useful, functional programming concept and is a great way to make code more readable. Python supports method cascading ... _for the most part_. There are a number of Python built-in classes that do not support cascading. - -An example, from cuDF, is a sequence of method calls for loading data and then finding the largest values from a subset of the data (yes there are other ways this could be done): - -``` -gdf = cudf.from_pandas(df).query(‘val > 200’).nlargest(‘va’3) -``` - -cuGraph does not support method cascading for two main reasons: (1) the object-oriented nature of the Graph data object leverages in-place methods, and (2) the fact that algorithms operate on graphs rather than graphs running algorithms. - -## Graph Data Objects -cuGraph follows an object-oriented design for the Graph objects. Users create a Graph and can then add data to object, but every add method call returns `None`. - -_Why Inplace methods?_
-cuGraph focuses on the big graph problems where there are 10s of millions to trillions of edges (Giga bytes to Terabytes of data). At that scale, creating a copy of the data becomes memory inefficient. - -_Why not return `self` rather than `None`?_
-It would be simple to modify the methods to return `self` rather than `None`, however it opens the methods to misinterpretation. Consider the following code: - -``` -# cascade flow - makes sense -G = cugraph.Graph().from_cudf_edgelist(df) - -# non-cascaded code can be confusing -G = cugraph.Graph() -G2 = G.from_cudf_edgelist(df) -G3 = G.from_cudf_edgelist(df2) -``` -The confusion with the non-cascade code is that G, G1, and G3 are all the same object with the same data. Users could be confused since it is not obvious that changing G3 would also change both G2 and G. To prevent confusion, cuGraph has opted to not return `self`. - -_Why not add a flag "return_self" to the methods?_
-``` -# cascade flow - makes sense -G = cugraph.Graph().from_cudf_edgelist(df, return_self=True) -``` -The fact that a developer would explicitly add a "return_self" flag to the method indicates that the developer is aware that the method returns None. It is just as easy for the developer to use a non-cascading workflow. - -### Algorithms -Algorithms operate on graph objects. -``` -cugraph.pagerank(G) and not G.pagerank() -``` -This pattern allows cuGraph to maintain a particular object-oriented model, where Graph objects simply maintain graph data, and algorithm functions operate independently on Graph objects. While this model has benefits that simplify the overall design and its usability in the majority of use cases, it does mean that the developer cannot cascade graph creation into an algorithm call. - -``` -# will not work -G = cugraph.Graph().from_cudf_edgelist(df).pagerank() -``` diff --git a/docs/nx-cugraph/source/basics/cugraph_intro.md b/docs/nx-cugraph/source/basics/cugraph_intro.md deleted file mode 100644 index 7ad282560..000000000 --- a/docs/nx-cugraph/source/basics/cugraph_intro.md +++ /dev/null @@ -1,68 +0,0 @@ - -# cuGraph Introduction -The Data Scientist has a collection of techniques within their -proverbial toolbox. Data engineering, statistical analysis, and -machine learning are among the most commonly known. However, there -are numerous cases where the focus of the analysis is on the -relationship between data elements. In those cases, the data is best -represented as a graph. Graph analysis, also called network analysis, -is a collection of algorithms for answering questions posed against -graph data. Graph analysis is not new. - -The first graph problem was posed by Euler in 1736, the [Seven Bridges of -Konigsberg](https://en.wikipedia.org/wiki/Seven_Bridges_of_K%C3%B6nigsberg), -and laid the foundation for the mathematical field of graph theory. -The application of graph analysis covers a wide variety of fields, including -marketing, biology, physics, computer science, sociology, and cyber to name a few. - -RAPIDS cuGraph is a library of graph algorithms that seamlessly integrates -into the RAPIDS data science ecosystem and allows the data scientist to easily -call graph algorithms using data stored in a GPU DataFrame, NetworkX Graphs, or even -CuPy or SciPy sparse Matrix. - - -## Vision -The vision of RAPIDS cuGraph is to ___make graph analysis ubiquitous to the -point that users just think in terms of analysis and not technologies or -frameworks___. This is a goal that many of us on the cuGraph team have been -working on for almost twenty years. Many of the early attempts focused on -solving one problem or using one technique. Those early attempts worked for -the initial goal but tended to break as the scope changed (e.g., shifting -to solving a dynamic graph problem with a static graph solution). The limiting -factors usually came down to compute power, ease-of-use, or choosing a data -structure that was not suited for all problems. NVIDIA GPUs, CUDA, and RAPIDS -have totally changed the paradigm and the goal of an accelerated unified graph -analytic library is now possible. - -The compute power of the latest NVIDIA GPUs (RAPIDS supports Pascal and later -GPU architectures) make graph analytics 1000x faster on average over NetworkX. -Moreover, the internal memory speed within a GPU allows cuGraph to rapidly -switch the data structure to best suit the needs of the analytic rather than -being restricted to a single data structure. cuGraph is working with several -frameworks for both static and dynamic graph data structures so that we always -have a solution to any graph problem. Since Python has emerged as the de facto -language for data science, allowing interactivity and the ability to run graph -analytics in Python makes cuGraph familiar and approachable. RAPIDS wraps all -the graph analytic goodness mentioned above with the ability to perform -high-speed ETL, statistics, and machine learning. To make things even better, -RAPIDS and DASK allows cuGraph to scale to multiple GPUs to support -multi-billion edge graphs. - - -## Terminology - -cuGraph is a collection of GPU accelerated graph algorithms and graph utility -functions. The application of graph analysis covers a lot of areas. -For Example: -* [Network Science](https://en.wikipedia.org/wiki/Network_science) -* [Complex Network](https://en.wikipedia.org/wiki/Complex_network) -* [Graph Theory](https://en.wikipedia.org/wiki/Graph_theory) -* [Social Network Analysis](https://en.wikipedia.org/wiki/Social_network_analysis) - -cuGraph does not favor one field over another. Our developers span the -breadth of fields with the focus being to produce the best graph library -possible. However, each field has its own argot (jargon) for describing the -graph (or network). In our documentation, we try to be consistent. In Python -documentation we will mostly use the terms __Node__ and __Edge__ to better -match NetworkX preferred term use, as well as other Python-based tools. At -the CUDA/C layer, we favor the mathematical terms of __Vertex__ and __Edge__. diff --git a/docs/nx-cugraph/source/basics/index.rst b/docs/nx-cugraph/source/basics/index.rst deleted file mode 100644 index 7bba301b6..000000000 --- a/docs/nx-cugraph/source/basics/index.rst +++ /dev/null @@ -1,11 +0,0 @@ -====== -Basics -====== - - -.. toctree:: - :maxdepth: 2 - - cugraph_intro - nx_transition - cugraph_cascading diff --git a/docs/nx-cugraph/source/basics/nx_transition.rst b/docs/nx-cugraph/source/basics/nx_transition.rst deleted file mode 100644 index 9da2fe9b4..000000000 --- a/docs/nx-cugraph/source/basics/nx_transition.rst +++ /dev/null @@ -1,181 +0,0 @@ -************************************** -NetworkX by calling cuGraph Algorithms -************************************** - - -*Note: this is a work in progress and will be updatred and changed as we better flesh out -compatibility issues* - -Latest Update -############# - -Last Update: March 7th, 2024 -Release: 24.04 - -**CuGraph is now a registered backend for networkX. This is described in the following blog: -`Accelerating NetworkX on NVIDIA GPUs for High Performance Graph Analytics -`_ - - -Easy Path – Use NetworkX Graph Objects, Accelerated Algorithms -############################################################## - -Rather than updating all of your existing code, simply update the calls to -graph algorithms by replacing the module name. This allows all the complicated -ETL code to be unchanged while still seeing significate performance -improvements. Again this will be deprecated since networkX dispatching to nx_cugraph -has many advantages. - - -.. image:: ../images/Nx_Cg_1.png - :width: 600 - -It is that easy. All algorithms in cuGraph support a NetworkX graph object as -input and match the NetworkX API list of arguments. - -Currently, cuGraph accepts both NetworkX Graph and DiGraph objects. We will be -adding support for Bipartite graph and Multigraph over the next few releases. - -Differences in Algorithms -########################## - -Since cuGraph currently does not support attribute rich graphs, those -algorithms that return simple scores (centrality, clustering, etc.) best match -the NetworkX process. Algorithms that return a subgraph will do so without -any additional attributes on the nodes or edges. - -Algorithms that exactly match -***************************** - -+-------------------------------+------------------------+ -| Algorithm | Differences | -+===============================+========================+ -| Core Number | None | -+-------------------------------+------------------------+ -| HITS | None | -+-------------------------------+------------------------+ -| PageRank | None | -+-------------------------------+------------------------+ -| Personal PageRank | None | -+-------------------------------+------------------------+ -| Strongly Connected Components | None | -+-------------------------------+------------------------+ -| Weakly Connected Components | None | -+-------------------------------+------------------------+ - -| - - - -Algorithms that do not copy over additional attributes -************************************************************************ - -+-------------------------------+-------------------------------------+ -| Algorithm | Differences | -+===============================+=====================================+ -| K-Truss | Does not copy over attributes | -+-------------------------------+-------------------------------------+ -| K-Core | Does not copy over attributes | -+-------------------------------+-------------------------------------+ -| Subgraph Extraction | Does not copy over attributes | -+-------------------------------+-------------------------------------+ - -| - - -Algorithms not in NetworkX -************************** - -+--------------------------------------+----------------------------+ -| Algorithm | Differences | -+======================================+============================+ -| Ensemble Clustering for Graphs (ECG) | Currently not in NetworkX | -+--------------------------------------+----------------------------+ -| Force Atlas 2 | Currently not in NetworkX | -+--------------------------------------+----------------------------+ -| Leiden | Currently not in NetworkX | -+--------------------------------------+----------------------------+ -| Louvain | Currently not in NetworkX | -+--------------------------------------+----------------------------+ -| Overlap coefficient | Currently not in NetworkX | -+--------------------------------------+----------------------------+ -| Spectral Clustering | Currently not in NetworkX | -+--------------------------------------+----------------------------+ - -| - - -Algorithm where not all arguments are supported -*********************************************** - -+----------------------------+-------------------------------------------------+ -| Algorithm | Differences | -+============================+=================================================+ -|Betweenness Centrality | weight is currently not supported – ignored | -| | endpoints is currently not supported – ignored | -+----------------------------+-------------------------------------------------+ -|Edge Betweenness Centrality | weight is currently not supported – ignored | -+----------------------------+-------------------------------------------------+ -| Katz Centrality | beta is currently not supported – ignored | -| | max_iter defaults to 100 versus 1000 | -+----------------------------+-------------------------------------------------+ - -| - -Algorithms where the results are different -****************************************** - - -For example, the NetworkX traversal algorithms typically return a generator -rather than a dictionary. - - -+----------------------------+-------------------------------------------------+ -| Algorithm | Differences | -+============================+=================================================+ -| Triangle Counting | this algorithm simply returns the total number | -| | of triangle and not the number per vertex | -| | (on roadmap to update) | -+----------------------------+-------------------------------------------------+ -| Jaccard coefficient | Currently we only do a 1-hop computation rather | -| | than an all-pairs. Fix is on roadmap | -+----------------------------+-------------------------------------------------+ -| Breadth First Search (BFS) | Returns a Pandas DataFrame with: | -| | [vertex][distance][predecessor] | -+----------------------------+-------------------------------------------------+ -| Single Source | Returns a Pandas DataFrame with: | -| Shortest Path (SSSP) | [vertex][distance][predecessor] | -+----------------------------+-------------------------------------------------+ - -| - -Graph Building -############## - -The biggest difference between NetworkX and cuGraph is with how Graph objects -are built. NetworkX, for the most part, stores graph data in a dictionary. -That structure allows easy insertion of new records. Consider the following -code for building a NetworkX Graph:: - - # Read the node data - df = pd.read_csv( data_file) - - # Construct graph from edge list. - G = nx.DiGraph() - - for row in df.iterrows(): - G.add_edge( - row[1]["1"], row[1]["2"], count=row[1]["3"] - ) - - -The code block is perfectly fine for NetworkX. However, the process of iterating over the dataframe and adding one node at a time is problematic for GPUs and something that we try and avoid. cuGraph stores data in columns (i.e. arrays). Resizing an array requires allocating a new array one element larger, copying the data, and adding the new value. That is not very efficient. - -If your code follows the above model of inserting one element at a time, the we suggest either rewriting that code or using it as is within NetworkX and just accelerating the algorithms with cuGraph. - -Now, if your code bulk loads the data from Pandas, then RAPIDS can accelerate that process by orders of magnitude. - -.. image:: ../images/Nx_Cg_2.png - :width: 600 - -The above cuGraph code will create cuGraph.Graph object and not a NetworkX.Graph object. diff --git a/docs/nx-cugraph/source/conf.py b/docs/nx-cugraph/source/conf.py index 66bc3137f..f03d7f4a3 100644 --- a/docs/nx-cugraph/source/conf.py +++ b/docs/nx-cugraph/source/conf.py @@ -19,17 +19,17 @@ import os import sys +from github_link import make_linkcode_resolve from packaging.version import Version -import cugraph +import nx_cugraph # If extensions (or modules to document with autodoc) are in another # directory, add these directories to sys.path here. If the directory # is relative to the documentation root, use os.path.abspath to make it # absolute, like shown here. -sys.path.insert(0, os.path.abspath('sphinxext')) +sys.path.insert(0, os.path.abspath("sphinxext")) -from github_link import make_linkcode_resolve # noqa # -- General configuration ------------------------------------------------ @@ -47,8 +47,8 @@ "sphinx.ext.autosummary", "numpydoc", "sphinx_markdown_tables", - 'sphinx.ext.doctest', - 'sphinx.ext.linkcode', + "sphinx.ext.doctest", + "sphinx.ext.linkcode", "IPython.sphinxext.ipython_console_highlighting", "IPython.sphinxext.ipython_directive", "nbsphinx", @@ -57,10 +57,10 @@ ] -ipython_mplbackend = 'str' +ipython_mplbackend = "str" # Add any paths that contain templates here, relative to this directory. -templates_path = ['_templates'] +templates_path = ["_templates"] # The suffix(es) of source filenames. # You can specify multiple suffix as a list of string: @@ -69,29 +69,32 @@ source_suffix = {".rst": "restructuredtext", ".md": "markdown"} # The master toctree document. -master_doc = 'index' +master_doc = "index" # General information about the project. -project = 'cugraph' -copyright = '2019-2023, NVIDIA Corporation' -author = 'NVIDIA Corporation' +project = "nx-cugraph" +copyright = "2019-2024, NVIDIA Corporation" +author = "NVIDIA Corporation" # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the # built documents. # -CUGRAPH_VERSION = Version(cugraph.__version__) +NXCG_VERSION = Version(nx_cugraph.__version__) # The short X.Y version. -version = f"{CUGRAPH_VERSION.major:02}.{CUGRAPH_VERSION.minor:02}" -# The full version, including alpha/beta/rc tags. -release = f"{CUGRAPH_VERSION.major:02}.{CUGRAPH_VERSION.minor:02}.{CUGRAPH_VERSION.micro:02}" +version = f"{NXCG_VERSION.major:02}.{NXCG_VERSION.minor:02}" +# The full version, including alpha/beta/rc tags. Skipping `black` formatting +# for readability +# fmt: off +release = f"{NXCG_VERSION.major:02}.{NXCG_VERSION.minor:02}.{NXCG_VERSION.micro:02}" +# fmt: on # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. # # This is also used if you do content translation via gettext catalogs. # Usually you set "language" from the command line for these cases. -language = 'en' +language = "en" # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. @@ -99,7 +102,7 @@ exclude_patterns = [] # The name of the Pygments (syntax highlighting) style to use. -pygments_style = 'sphinx' +pygments_style = "sphinx" # If true, `todo` and `todoList` produce output, else they produce nothing. todo_include_todos = False @@ -111,7 +114,7 @@ # a list of builtin themes. # -html_theme = 'pydata_sphinx_theme' +html_theme = "pydata_sphinx_theme" # If true, `todo` and `todoList` produce output, else they produce nothing. todo_include_todos = False @@ -122,7 +125,7 @@ # html_theme_options = { "external_links": [], - "github_url": "https://github.com/rapidsai/cugraph", + "github_url": "https://github.com/rapidsai/nx-cugraph", "twitter_url": "https://twitter.com/rapidsai", "show_toc_level": 1, "navbar_align": "right", @@ -131,13 +134,13 @@ # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ['_static'] +html_static_path = ["_static"] # -- Options for HTMLHelp output ------------------------------------------ # Output file base name for HTML help builder. -htmlhelp_basename = 'cugraphdoc' +htmlhelp_basename = "nx-cugraphdoc" # -- Options for LaTeX output --------------------------------------------- @@ -146,15 +149,12 @@ # The paper size ('letterpaper' or 'a4paper'). # # 'papersize': 'letterpaper', - # The font size ('10pt', '11pt' or '12pt'). # # 'pointsize': '10pt', - # Additional stuff for the LaTeX preamble. # # 'preamble': '', - # Latex figure (float) alignment # # 'figure_align': 'htbp', @@ -164,8 +164,13 @@ # (source start file, target name, title, # author, documentclass [howto, manual, or own class]). latex_documents = [ - (master_doc, 'cugraph.tex', 'cugraph Documentation', - 'NVIDIA Corporation', 'manual'), + ( + master_doc, + "cugraph.tex", + "cugraph Documentation", + "NVIDIA Corporation", + "manual", + ), ] @@ -173,10 +178,7 @@ # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). -man_pages = [ - (master_doc, 'cugraph', 'cugraph Documentation', - [author], 1) -] +man_pages = [(master_doc, "nx-cugraph", "nx-cugraph Documentation", [author], 1)] # -- Options for Texinfo output ------------------------------------------- @@ -185,9 +187,15 @@ # (source start file, target name, title, author, # dir menu entry, description, category) texinfo_documents = [ - (master_doc, 'cugraph', 'cugraph Documentation', - author, 'cugraph', 'GPU-accelerated graph analysis.', - 'Miscellaneous'), + ( + master_doc, + "nx-cugraph", + "nx-cugraph Documentation", + author, + "nx-cugraph", + "GPU-accelerated graph analysis.", + "Miscellaneous", + ), ] # Connect docs in other projects @@ -209,21 +217,23 @@ def setup(app): app.add_css_file("https://docs.rapids.ai/assets/css/custom.css") - app.add_js_file("https://docs.rapids.ai/assets/js/custom.js", loading_method="defer") + app.add_js_file( + "https://docs.rapids.ai/assets/js/custom.js", loading_method="defer" + ) app.add_css_file("references.css") -source_suffix = ['.rst', '.md'] +source_suffix = [".rst", ".md"] # The following is used by sphinx.ext.linkcode to provide links to github linkcode_resolve = make_linkcode_resolve( - "https://github.com/rapidsai/cugraph/blob/{revision}/python/{path}#L{lineno}" + "https://github.com/rapidsai/nx_cugraph/blob/{revision}/python/{path}#L{lineno}" ) breathe_projects = { - 'libcugraph': os.environ['XML_DIR_LIBCUGRAPH'], - 'libcugraphops': os.environ['XML_DIR_LIBCUGRAPHOPS'], - 'libwholegraph': os.environ['XML_DIR_LIBWHOLEGRAPH'] + "libcugraph": os.environ["XML_DIR_LIBCUGRAPH"], + "libcugraphops": os.environ["XML_DIR_LIBCUGRAPHOPS"], + "libwholegraph": os.environ["XML_DIR_LIBWHOLEGRAPH"], } breathe_default_project = "libcugraph" diff --git a/docs/nx-cugraph/source/graph_support/DGL_support.md b/docs/nx-cugraph/source/graph_support/DGL_support.md deleted file mode 100644 index ba9a28e31..000000000 --- a/docs/nx-cugraph/source/graph_support/DGL_support.md +++ /dev/null @@ -1,61 +0,0 @@ -# cugraph_dgl - -## Description - -[RAPIDS](https://rapids.ai) cugraph_dgl provides a duck-typed version of the [DGLGraph](https://docs.dgl.ai/api/python/dgl.DGLGraph.html#dgl.DGLGraph) class, which uses cugraph for storing graph structure and node/edge feature data. Using cugraph as the backend allows DGL users to access a collection of GPU accelerated algorithms for graph analytics, such as centrality computation and community detection. - -## Conda - -Install and update cugraph-dgl and the required dependencies using the command: - -``` -conda install mamba -n base -c conda-forge -mamba install cugraph-dgl -c rapidsai-nightly -c rapidsai -c pytorch -c conda-forge -c nvidia -c dglteam -``` - -## Build from Source - -### Create the conda development environment -``` -conda env create -n cugraph_dgl_dev --file conda/environments/all_cuda-125_arch-x86_64.yaml -``` - -### Install in editable mode -``` -pip install -e . -``` - -### Run tests - -``` -pytest tests/* -``` - - -## Usage -```diff - -from cugraph_dgl.convert import cugraph_storage_from_heterograph -cugraph_g = cugraph_storage_from_heterograph(dgl_g) - -sampler = dgl.dataloading.NeighborSampler( - [15, 10, 5], prefetch_node_feats=['feat'], prefetch_labels=['label']) - -train_dataloader = dgl.dataloading.DataLoader( -cugraph_g, -train_idx, -sampler, -device=device, -batch_size=1024, -shuffle=True, -drop_last=False, -num_workers=0) -``` - -___ -Copyright (c) 2023, NVIDIA CORPORATION. - -Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -___ diff --git a/docs/nx-cugraph/source/graph_support/PyG_support.md b/docs/nx-cugraph/source/graph_support/PyG_support.md deleted file mode 100644 index b57ce7fcc..000000000 --- a/docs/nx-cugraph/source/graph_support/PyG_support.md +++ /dev/null @@ -1,3 +0,0 @@ -# cugraph_pyg - -[RAPIDS](https://rapids.ai) cugraph_pyg enables the ability to use cugraph graph storage and sampling with PyTorch Geometric (PyG). PyG users will have access to cuGraph through the PyG GraphStore, FeatureStore, and Sampler interfaces. diff --git a/docs/nx-cugraph/source/graph_support/algorithms.md b/docs/nx-cugraph/source/graph_support/algorithms.md deleted file mode 100644 index 2aac61325..000000000 --- a/docs/nx-cugraph/source/graph_support/algorithms.md +++ /dev/null @@ -1,95 +0,0 @@ -# List of Supported and Planned Algorithms - -## Supported Graph - -| Type | Description | -| ---------- | ----------------------------------------------------------- | -| Graph | A directed or undirected Graph (use directed={True, False}) | -| Multigraph | A Graph with multiple edges between a vertex pair | -| | | - -ALL Algorithms support Graphs and MultiGraph (directed and undirected) - ---- - -
- -# Supported Algorithms - -_Italic_ algorithms are planned for future releases. - -Note: Multi-GPU, or MG, includes support for Multi-Node Multi-GPU (also called MNMG). - -| Category | Notebooks | Scale | Notes | -| ----------------- | ---------------------------------- | ------------------- | --------------------------------------------------------------- | -| [Centrality](./algorithms/Centrality.html ) | [Centrality](https://github.com/rapidsai/cugraph/blob/main/notebooks/algorithms/centrality/Centrality.ipynb) | | | -| | [Katz](https://github.com/rapidsai/cugraph/blob/main/notebooks/algorithms/centrality/Katz.ipynb) | __Multi-GPU__ | | -| | [Betweenness Centrality](https://github.com/rapidsai/cugraph/blob/main/notebooks/algorithms/centrality/Betweenness.ipynb) | __Multi-GPU__ | MG as of 23.06 | -| | [Edge Betweenness Centrality](https://github.com/rapidsai/cugraph/blob/main/notebooks/algorithms/centrality/Betweenness.ipynb) | __Multi-GPU__ | MG as of 23.08 | -| | [Eigenvector Centrality](https://github.com/rapidsai/cugraph/blob/main/notebooks/algorithms/centrality/Eigenvector.ipynb) | __Multi-GPU__ | | -| | [Degree Centrality](https://github.com/rapidsai/cugraph/blob/main/notebooks/algorithms/centrality/Degree.ipynb) | __Multi-GPU__ | Python only | -| Community | | | | -| | [Leiden](https://github.com/rapidsai/cugraph/blob/main/notebooks/algorithms/community/Louvain.ipynb) | __Multi-GPU__ | MG as of 23.06 | -| | [Louvain](https://github.com/rapidsai/cugraph/blob/main/notebooks/algorithms/community/Louvain.ipynb) | __Multi-GPU__ | | -| | [Ensemble Clustering for Graphs](https://github.com/rapidsai/cugraph/blob/main/notebooks/algorithms/community/ECG.ipynb) | Single-GPU | MG planned for 24.02 | -| | [Spectral-Clustering - Balanced Cut](https://github.com/rapidsai/cugraph/blob/main/notebooks/algorithms/community/Spectral-Clustering.ipynb) | Single-GPU | | -| | [Spectral-Clustering - Modularity](https://github.com/rapidsai/cugraph/blob/main/notebooks/algorithms/community/Spectral-Clustering.ipynb) | Single-GPU | | -| | [Subgraph Extraction](https://github.com/rapidsai/cugraph/blob/main/notebooks/algorithms/community/Subgraph-Extraction.ipyn) | Single-GPU | | -| | [Triangle Counting](https://github.com/rapidsai/cugraph/blob/main/notebooks/algorithms/community/Triangle-Counting.ipynb) | __Multi-GPU__ | | -| | [K-Truss](https://github.com/rapidsai/cugraph/blob/main/notebooks/algorithms/community/ktruss.ipynb) | Single-GPU | MG planned for 2024 | -| Components | | | | -| | [Weakly Connected Components](https://github.com/rapidsai/cugraph/blob/main/notebooks/algorithms/components/ConnectedComponents.ipynb) | __Multi-GPU__ | | -| | [Strongly Connected Components](https://github.com/rapidsai/cugraph/blob/main/notebooks/algorithms/components/ConnectedComponents.ipynb) | Single-GPU | | -| Core | | | | -| | [K-Core](https://github.com/rapidsai/cugraph/blob/main/notebooks/algorithms/cores/kcore.ipynb) | __Multi-GPU__ | | -| | [Core Number](https://github.com/rapidsai/cugraph/blob/main/notebooks/algorithms/cores/core-number.ipynb) | __Multi-GPU__ | | -| _Flow_ | | | | -| | _MaxFlow_ | --- | | -| _Influence_ | | | | -| | _Influence Maximization_ | --- | | -| Layout | | | | -| | [Force Atlas 2](https://github.com/rapidsai/cugraph/blob/main/notebooks/algorithms/layout/Force-Atlas2.ipynb) | Single-GPU | | -| Linear Assignment | | | | -| | [Hungarian](https://docs.rapids.ai/api/cugraph/nightly/api_docs/cugraph/linear_assignment/#hungarian) | Single-GPU | [README](./algorithms/cpp_algorithms/linear_cpp.html) | -| Link Analysis | | | | -| | [Pagerank](https://github.com/rapidsai/cugraph/blob/main/notebooks/algorithms/link_analysis/Pagerank.ipynb) | __Multi-GPU__ | [C++ README](./algorithms/cpp_algorithms/centrality_cpp.html#Pagerank) | -| | [Personal Pagerank](https://github.com/rapidsai/cugraph/blob/main/notebooks/algorithms/link_analysis/Pagerank.ipynb) | __Multi-GPU__ | [C++ README](./algorithms/cpp_algorithms/centrality_cpp.html#Personalized-Pagerank) | -| | [HITS](https://github.com/rapidsai/cugraph/blob/main/notebooks/algorithms/link_analysis/HITS.ipynb) | __Multi-GPU__ | | -| [Link Prediction](algorithms/Similarity.html) | | | | -| | [Jaccard Similarity](https://github.com/rapidsai/cugraph/blob/main/notebooks/algorithms/link_prediction/Jaccard-Similarity.ipynb) | __Multi-GPU__ | Directed graph only | -| | [Weighted Jaccard Similarity](https://github.com/rapidsai/cugraph/blob/main/notebooks/algorithms/link_prediction/Jaccard-Similarity.ipynb) | Single-GPU | | -| | [Overlap Similarity](https://github.com/rapidsai/cugraph/blob/main/notebooks/algorithms/link_prediction/Overlap-Similarity.ipynb) | **Multi-GPU** | | -| | [Sorensen Coefficient](https://github.com/rapidsai/cugraph/blob/main/notebooks/algorithms/link_prediction/Sorensen_coefficient.ipynb) | __Multi-GPU__ | MG is unweighted only | -| | _Local Clustering Coefficient_ | --- | | -| Sampling | | | | -| | [Uniform Random Walks RW](https://github.com/rapidsai/cugraph/blob/main/notebooks/algorithms/sampling/RandomWalk.ipynb) | __Multi-GPU__ | | -| | *Biased Random Walks (RW)* | --- | | -| | Egonet | __Multi-GPU__ | | -| | Node2Vec | __Multi-GPU__ | | -| | Neighborhood sampling | __Multi-GPU__ | | -| Traversal | | | | -| | Breadth First Search (BFS) | __Multi-GPU__ | [C++ README](algorithms/cpp_algorithms/traversal_cpp.html#BFS) | -| | Single Source Shortest Path (SSSP) | __Multi-GPU__ | [C++ README](algorithms/cpp_algorithms/traversal_cpp.html#SSSP) | -| | _ASSP / APSP_ | --- | | -| Tree | | | | -| | Minimum Spanning Tree | Single-GPU | | -| | Maximum Spanning Tree | Single-GPU | | -| Other | | | | -| | Renumbering | __Multi-GPU__ | multiple columns, any data type | -| | Symmetrize | __Multi-GPU__ | | -| | Path Extraction | | Extract paths from BFS/SSP results in parallel | -| | Two Hop Neighbors | __Multi-GPU__ | | -| Data Generator | | | | -| | RMAT | __Multi-GPU__ | | -| | _Barabasi-Albert_ | --- | | -| | | | | - -

- -___ -Copyright (c) 2019 - 2023, NVIDIA CORPORATION. - -Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -___ diff --git a/docs/nx-cugraph/source/graph_support/algorithms/Centrality.md b/docs/nx-cugraph/source/graph_support/algorithms/Centrality.md deleted file mode 100644 index 8119e6552..000000000 --- a/docs/nx-cugraph/source/graph_support/algorithms/Centrality.md +++ /dev/null @@ -1,40 +0,0 @@ - -# cuGraph Centrality Notebooks - - - -The RAPIDS cuGraph Centrality folder contains a collection of Jupyter Notebooks that demonstrate algorithms to identify and quantify the importance of vertices to the structure of the graph. In the diagram above, the highlighted vertices are highly important and are likely answers to questions like: - -* Which vertices have the highest degree (most direct links) ? -* Which vertices are on the most efficient paths through the graph? -* Which vertices connect the most important vertices to each other? - -But which vertices are most important? The answer depends on which measure/algorithm is run. Manipulation of the data before or after the graph analytic is not covered here. Extended, more problem focused, notebooks are being created and available https://github.com/rapidsai/notebooks-extended - -## Summary - -|Algorithm |Notebooks Containing |Description | -| --------------- | ------------------------------------------------------------ | ------------------------------------------------------------ | -|[Degree Centrality](./degree_centrality.md)| [Centrality](https://github.com/rapidsai/cugraph/blob/main/notebooks/algorithms/centrality/Centrality.ipynb), [Degree](https://github.com/rapidsai/cugraph/blob/main/notebooks/algorithms/centrality/Degree.ipynb) |Measure based on counting direct connections for each vertex| -|[Betweenness Centrality](./betweenness_centrality.md)| [Centrality](https://github.com/rapidsai/cugraph/blob/main/notebooks/algorithms/centrality/Centrality.ipynb), [Betweenness](https://github.com/rapidsai/cugraph/blob/main/notebooks/algorithms/centrality/Betweenness.ipynb) |Number of shortest paths through the vertex| -|[Eigenvector Centrality](./eigenvector_centrality.md)|[Centrality](https://github.com/rapidsai/cugraph/blob/main/notebooks/algorithms/centrality/Centrality.ipynb), [Eigenvector](https://github.com/rapidsai/cugraph/blob/main/notebooks/algorithms/centrality/Eigenvector.ipynb)|Measure of connectivity to other important vertices (which also have high connectivity) often referred to as the influence measure of a vertex| -|[Katz Centrality](./katz_centrality.md)|[Centrality](https://github.com/rapidsai/cugraph/blob/main/notebooks/algorithms/centrality/Centrality.ipynb), [Katz](https://github.com/rapidsai/cugraph/blob/main/notebooks/algorithms/centrality/Katz.ipynb) |Similar to Eigenvector but has tweaks to measure more weakly connected graph | -|Pagerank|[Centrality](https://github.com/rapidsai/cugraph/blob/main/notebooks/algorithms/centrality/Centrality.ipynb), [Pagerank](https://github.com/rapidsai/cugraph/blob/main/notebooks/algorithms/link_analysis/Pagerank.ipynb) |Classified as both a link analysis and centrality measure by quantifying incoming links from central vertices. | - -[System Requirements](https://github.com/rapidsai/cugraph/blob/main/notebooks/README.md#requirements) - - - -| Author Credit | Date | Update | cuGraph Version | Test Hardware | -| --------------|------------|------------------|-----------------|----------------| -| Brad Rees | 04/19/2021 | created | 0.19 | GV100, CUDA 11.0 -| Don Acosta | 07/05/2022 | tested / updated | 22.08 nightly | DGX Tesla V100 CUDA 11.5 - -## Copyright - -Copyright (c) 2019 - 2023, NVIDIA CORPORATION. - -Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -___ diff --git a/docs/nx-cugraph/source/graph_support/algorithms/Similarity.md b/docs/nx-cugraph/source/graph_support/algorithms/Similarity.md deleted file mode 100644 index 96adc25ea..000000000 --- a/docs/nx-cugraph/source/graph_support/algorithms/Similarity.md +++ /dev/null @@ -1,38 +0,0 @@ - -# cuGraph Similarity Notebooks - -The RAPIDS cuGraph Similarity folder contain a collection of Jupyter Notebooks that demonstrate algorithms to quantify the similarity between pairs of vertices in the graph. -Results of Similarity algorithms are often used to answer questions like: -* Could two vertices be duplicates or aliases of the same actor? -* Can we predict missing edges based of the similarity between two nodes? -* Are multiple similar communities within the graph? -* Can I create recommendations based on the similarity between vertices in the graph. - - -Manipulation of the data before or after the graph analytic is not covered here. Extended, more problem focused, notebooks are being created and available https://github.com/rapidsai/notebooks-extended - -## Summary - -|Algorithm |Notebooks Containing |Description | -| --------------- | ------------------------------------------------------------ | ------------------------------------------------------------ | -|[Jaccard Smiliarity](./jaccard_similarity.html)| [Jaccard Similarity](https://github.com/rapidsai/cugraph/blob/main/notebooks/algorithms/link_prediction/Jaccard-Similarity.ipynb) || -|[Overlap Similarity](./overlap_similarity.html)| [Overlap Similarity](https://github.com/rapidsai/cugraph/blob/main/notebooks/algorithms/link_prediction/Overlap-Similarity.ipynb) || -|[Sorensen](./sorensen_coefficient.html)|[Sorensen Similarity](https://github.com/rapidsai/cugraph/blob/main/notebooks/algorithms/link_prediction/Sorensen_coefficient.ipynb)|| -|Personal Pagerank|[Pagerank](https://github.com/rapidsai/cugraph/blob/main/notebooks/algorithms/link_analysis/Pagerank.ipynb) || - - -[System Requirements](../../README.md#requirements) - -| Author Credit | Date | Update | cuGraph Version | Test Hardware | -| --------------|------------|------------------|-----------------|----------------| -| Brad Rees | 04/19/2021 | created | 0.19 | GV100, CUDA 11.0 -| Don Acosta | 07/05/2022 | tested / updated | 22.08 nightly | DGX Tesla V100 CUDA 11.5 - -## Copyright - -Copyright (c) 2019 - 2023, NVIDIA CORPORATION. - -Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -___ diff --git a/docs/nx-cugraph/source/graph_support/algorithms/betweenness_centrality.md b/docs/nx-cugraph/source/graph_support/algorithms/betweenness_centrality.md deleted file mode 100644 index 89e5e0bdb..000000000 --- a/docs/nx-cugraph/source/graph_support/algorithms/betweenness_centrality.md +++ /dev/null @@ -1,42 +0,0 @@ -# Betweenness Centrality (BC) - -Betweenness centrality is a measure of the relative importance based on measuring the number of shortest paths that pass through each vertex or over each edge. High betweenness centrality vertices have a greater number of path cross through the vertex. Likewise, high centrality edges have more shortest paths that pass over the edge. - -See [Betweenness on Wikipedia](https://en.wikipedia.org/wiki/Betweenness_centrality) for more details on the algorithm. - -Betweenness centrality of a node 𝑣 is the sum of the fraction of all-pairs shortest paths that pass through 𝑣 - -$c_B(v) =\sum_{s,t \in V} \frac{\sigma(s, t|v)}{\sigma(s, t)}$ - - -## When to use BC -Betweenness centrality is often used to answer questions like: -* Which vertices are most influential in the network? -* What are the bridge vertices in a network? -* How robust/redundant is the network? -* In a social network analysis, betweenness centrality can be used to identify roles in an organization. - -## When not to use BC -Betweenness Centrality is less efficient in certain circumstances: -* Large graphs may require approximationing betweenness centrality as the computational cost increases. -* Disconnected networks or networks with many isolated components limit the value of betweenness centrality -* Betweenness centality is more costly and less useful in weighted graphs. -* In networks with hierarchical structure, BC might not accurately reflect true influence -* Networks with multiple edge types often require a seperate method of measuring influence for each edge type. - - -## How computationally expensive is BC? -While cuGraph's parallelism migigates run time, [Big O notation](https://en.wikipedia.org/wiki/Big_O_notation) is still the standard to compare algorithm costs. -* The cost is O(V(E+V)) for a non-weighted graph and O(V(E+V)log(V)) for a weighted graph. -* A breadth-first search is done to determine shortest paths betweeb all nodes prior to calculating BC. - -## Sample benchmarks -Coming Soon - -___ -Copyright (c) 2023, NVIDIA CORPORATION. - -Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -___ diff --git a/docs/nx-cugraph/source/graph_support/algorithms/cpp_algorithms/centrality_cpp.md b/docs/nx-cugraph/source/graph_support/algorithms/cpp_algorithms/centrality_cpp.md deleted file mode 100644 index b3f7ac17d..000000000 --- a/docs/nx-cugraph/source/graph_support/algorithms/cpp_algorithms/centrality_cpp.md +++ /dev/null @@ -1,81 +0,0 @@ -# Centrality algorithms -cuGraph Pagerank is implemented using our graph primitive library - -## Pagerank - -The unit test code is the best place to search for examples on calling pagerank. - - * [SG Implementation](https://github.com/rapidsai/cugraph/blob/main/cpp/tests/link_analysis/pagerank_test.cpp) - * [MG Implementation](https://github.com/rapidsai/cugraph/blob/main/cpp/tests/link_analysis/mg_pagerank_test.cpp) - -## Simple pagerank - -The example assumes that you create an SG or MG graph somehow. The caller must create the pageranks vector in device memory and pass in the raw pointer to that vector into the pagerank function. - -```cpp -#include -... -using vertex_t = int32_t; // or int64_t, whichever is appropriate -using weight_t = float; // or double, whichever is appropriate -using result_t = weight_t; // could specify float or double also -raft::handle_t handle; // Must be configured if MG -auto graph_view = graph.view(); // assumes you have created a graph somehow - -result_t constexpr alpha{0.85}; -result_t constexpr epsilon{1e-6}; - -rmm::device_uvector pageranks_v(graph_view.number_of_vertices(), handle.get_stream()); - -// pagerank optionally supports three additional parameters: -// max_iterations - maximum number of iterations, if pagerank doesn't coverge by -// then we abort -// has_initial_guess - if true, values in the pagerank array when the call is initiated -// will be used as the initial pagerank values. These values will -// be normalized before use. If false (the default), the values -// in the pagerank array will be set to 1/num_vertices before -// starting the computation. -// do_expensive_check - perform extensive validation of the input data before -// executing algorithm. Off by default. Note: turning this on -// is expensive -cugraph::pagerank(handle, graph_view, nullptr, nullptr, nullptr, vertex_t{0}, - pageranks_v.data(), alpha, epsilon); -``` - -## Personalized Pagerank - -The example assumes that you create an SG or MG graph somehow. The caller must create the pageranks vector in device memory and pass in the raw pointer to that vector into the pagerank function. Additionally, the caller must create personalization_vertices and personalized_values vectors in device memory, populate them and pass in the raw pointers to those vectors. - -```cpp -#include -... -using vertex_t = int32_t; // or int64_t, whichever is appropriate -using weight_t = float; // or double, whichever is appropriate -using result_t = weight_t; // could specify float or double also -raft::handle_t handle; // Must be configured if MG -auto graph_view = graph.view(); // assumes you have created a graph somehow -vertex_t number_of_personalization_vertices; // Provided by caller - -result_t constexpr alpha{0.85}; -result_t constexpr epsilon{1e-6}; - -rmm::device_uvector pageranks_v(graph_view.number_of_vertices(), handle.get_stream()); -rmm::device_uvector personalization_vertices(number_of_personalization_vertices, handle.get_stream()); -rmm::device_uvector personalization_values(number_of_personalization_vertices, handle.get_stream()); - -// Populate personalization_vertices, personalization_values with user provided data - -// pagerank optionally supports three additional parameters: -// max_iterations - maximum number of iterations, if pagerank doesn't coverge by -// then we abort -// has_initial_guess - if true, values in the pagerank array when the call is initiated -// will be used as the initial pagerank values. These values will -// be normalized before use. If false (the default), the values -// in the pagerank array will be set to 1/num_vertices before -// starting the computation. -// do_expensive_check - perform extensive validation of the input data before -// executing algorithm. Off by default. Note: turning this on -// is expensive -cugraph::pagerank(handle, graph_view, nullptr, personalization_vertices.data(), - personalization_values.data(), number_of_personalization_vertices, - pageranks_v.data(), alpha, epsilon); -``` diff --git a/docs/nx-cugraph/source/graph_support/algorithms/cpp_algorithms/linear_cpp.md b/docs/nx-cugraph/source/graph_support/algorithms/cpp_algorithms/linear_cpp.md deleted file mode 100644 index 8af4a5042..000000000 --- a/docs/nx-cugraph/source/graph_support/algorithms/cpp_algorithms/linear_cpp.md +++ /dev/null @@ -1,37 +0,0 @@ -# LAP - -Implementation of ***O(n^3) Alternating Tree Variant*** of Hungarian Algorithm on NVIDIA CUDA-enabled GPU. - -This implementation solves a batch of ***k*** **Linear Assignment Problems (LAP)**, each with ***nxn*** matrix of single floating point cost values. At optimality, the algorithm produces an assignment with ***minimum*** cost. - -The API can be used to query optimal primal and dual costs, optimal assignment vector, and optimal row/column dual vectors for each subproblem in the batch. - -cuGraph exposes the Hungarian algorithm, the actual implementation is contained in the RAFT library which contains some common tools and kernels shared between cuGraph and cuML. - -Following parameters can be used to tune the performance of algorithm: - -1. epsilon: (in raft/lap/lap_kernels.cuh) This parameter controls the tolerance on the floating point precision. Setting this too small will result in increased solution time because the algorithm will search for precise solutions. Setting it too high may cause some inaccuracies. - -2. BLOCKDIMX, BLOCKDIMY: (in raft/lap/lap_functions.cuh) These parameters control threads_per_block to be used along the given dimension. Set these according to the device specifications and occupancy calculation. - -***This library is licensed under Apache License 2.0. Please cite our paper, if this library helps you in your research.*** - -- Harvard citation style - - Date, K. and Nagi, R., 2016. GPU-accelerated Hungarian algorithms for the Linear Assignment Problem. Parallel Computing, 57, pp.52-72. - -- BibTeX Citation block to be used in LaTeX bibliography file: - -``` -@article{date2016gpu, - title={GPU-accelerated Hungarian algorithms for the Linear Assignment Problem}, - author={Date, Ketan and Nagi, Rakesh}, - journal={Parallel Computing}, - volume={57}, - pages={52--72}, - year={2016}, - publisher={Elsevier} -} -``` - -The paper is available online on [ScienceDirect](https://www.sciencedirect.com/science/article/abs/pii/S016781911630045X). diff --git a/docs/nx-cugraph/source/graph_support/algorithms/cpp_algorithms/traversal_cpp.md b/docs/nx-cugraph/source/graph_support/algorithms/cpp_algorithms/traversal_cpp.md deleted file mode 100644 index 6480d885a..000000000 --- a/docs/nx-cugraph/source/graph_support/algorithms/cpp_algorithms/traversal_cpp.md +++ /dev/null @@ -1,56 +0,0 @@ -# Traversal -cuGraph traversal algorithms are contained in this directory - -## SSSP - -The unit test code is the best place to search for examples on calling SSSP. - - * [SG Implementation](https://github.com/rapidsai/cugraph/blob/main/cpp/tests/traversal/sssp_test.cpp) - * [MG Implementation](https://github.com/rapidsai/cugraph/blob/main/cpp/tests/traversal/mg_sssp_test.cpp) - -## Simple SSSP - -The example assumes that you create an SG or MG graph somehow. The caller must create the distances and predecessors vectors in device memory and pass in the raw pointers to those vectors into the SSSP function. - -```cpp -#include -... -using vertex_t = int32_t; // or int64_t, whichever is appropriate -using weight_t = float; // or double, whichever is appropriate -using result_t = weight_t; // could specify float or double also -raft::handle_t handle; // Must be configured if MG -auto graph_view = graph.view(); // assumes you have created a graph somehow -vertex_t source; // Initialized by user - -rmm::device_uvector distances_v(graph_view.number_of_vertices(), handle.get_stream()); -rmm::device_uvector predecessors_v(graph_view.number_of_vertices(), handle.get_stream()); - -cugraph::sssp(handle, graph_view, distances_v.begin(), predecessors_v.begin(), source, std::numeric_limits::max(), false); -``` - -## BFS - -The unit test code is the best place to search for examples on calling BFS. - - * [SG Implementation](https://github.com/rapidsai/cugraph/blob/main/cpp/tests/traversal/bfs_test.cpp) - * [MG Implementation](https://github.com/rapidsai/cugraph/blob/main/cpp/tests/traversal/mg_bfs_test.cpp) - -## Simple BFS - -The example assumes that you create an SG or MG graph somehow. The caller must create the distances and predecessors vectors in device memory and pass in the raw pointers to those vectors into the BFS function. - -```cpp -#include -... -using vertex_t = int32_t; // or int64_t, whichever is appropriate -using weight_t = float; // or double, whichever is appropriate -using result_t = weight_t; // could specify float or double also -raft::handle_t handle; // Must be configured if MG -auto graph_view = graph.view(); // assumes you have created a graph somehow -vertex_t source; // Initialized by user - -rmm::device_uvector distances_v(graph_view.number_of_vertices(), handle.get_stream()); -rmm::device_uvector predecessors_v(graph_view.number_of_vertices(), handle.get_stream()); - -cugraph::bfs(handle, graph_view, d_distances.begin(), d_predecessors.begin(), source, false, std::numeric_limits::max(), false); -``` diff --git a/docs/nx-cugraph/source/graph_support/algorithms/degree_centrality.md b/docs/nx-cugraph/source/graph_support/algorithms/degree_centrality.md deleted file mode 100644 index 9253c665f..000000000 --- a/docs/nx-cugraph/source/graph_support/algorithms/degree_centrality.md +++ /dev/null @@ -1,32 +0,0 @@ -# Degree Centrality -Degree centrality is the simplest measure of the relative importance based on counting the connections with each vertex. Vertices with the most connections are the most central by this measure. - -See [Degree Centrality on Wikipedia](https://en.wikipedia.org/wiki/Degree_centrality) for more details on the algorithm. - -Degree centrality of a vertex 𝑣 is the sum of the edges incident on that node. - - - -## When to use Degree Centrality -* When you need a really quick identifcation of important nodes on very simply structured data. -* In cases like collaboration networks where all links have equal importance. -* In many biologic and transportation networks, shear number of connections is important to itentify critical nodes whether they be proteins or airports. -* In huge graphs, Degree centrality is a the quickest - -## When not to use Degree Centrality -* When weights, edge direction or edge types matter -* Graphs with self loops -* Multi-graphs ( graphs with multiple edges between the same two nodes) -* In general Degree Centrality falls short in most cases where the data is complex or nuanced. - -## How computationally expensive is it? -While cuGraph's parallelism migigates run time, [Big O notation](https://en.wikipedia.org/wiki/Big_O_notation) is still the standard to compare algorithm costs. - -The cost of Degree Centrality is O(n) where n is the number of nodes. -___ -Copyright (c) 2023, NVIDIA CORPORATION. - -Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -___ diff --git a/docs/nx-cugraph/source/graph_support/algorithms/eigenvector_centrality.md b/docs/nx-cugraph/source/graph_support/algorithms/eigenvector_centrality.md deleted file mode 100644 index 8a9c7c7c7..000000000 --- a/docs/nx-cugraph/source/graph_support/algorithms/eigenvector_centrality.md +++ /dev/null @@ -1,41 +0,0 @@ -# Eigenvector Centrality - -Eigenvector centrality computes the centrality for a vertex based on the -centrality of its neighbors. The Eigenvector of a node measures influence within a graph by taking into account a vertex's connections to other highly connected vertices. - - -See [Eigenvector Centrality on Wikipedia](https://en.wikipedia.org/wiki/Eigenvector_centrality) for more details on the algorithm. - -The eigenvector centrality for node i is the -i-th element of the vector x defined by the eigenvector equation. - - - - -Where M(v) is the adjacency list for the set of vertices(v) and λ is a constant. - -[Learn more about EigenVector Centrality](https://www.sci.unich.it/~francesc/teaching/network/eigenvector.html) - -## When to use Eigenvector Centrality -* When the quality and quantity of edges matters, in other words, connections to other high-degree nodes is important -* To calculate influence in nuanced networks like social and financial networks. - -## When not to use Eigenvector Centrality -* in graphs with many disconnected groups -* in graphs containing many distinct and different communities -* in networks with negative weights -* in huge networks eigenvector centrality can become computationally infeasible in single threaded systems. - - -## How computationally expensive is it? -While cuGraph's parallelism migigates run time, [Big O notation](https://en.wikipedia.org/wiki/Big_O_notation) is still the standard to compare algorithm costs. - -O(VE) where V is the number of vertices(nodes) and Eis the number of edges. - -___ -Copyright (c) 2023, NVIDIA CORPORATION. - -Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -___ diff --git a/docs/nx-cugraph/source/graph_support/algorithms/jaccard_similarity.md b/docs/nx-cugraph/source/graph_support/algorithms/jaccard_similarity.md deleted file mode 100644 index dde98d71e..000000000 --- a/docs/nx-cugraph/source/graph_support/algorithms/jaccard_similarity.md +++ /dev/null @@ -1,34 +0,0 @@ -# Jaccard Similarity - -The Jaccard similarity between two sets is defined as the ratio of the volume of their intersection divided by the volume of their union. - -The Jaccard Similarity can then be defined as - -Jaccard similarity coefficient = $\frac{|A \cap B|}{|A \cup B|}$ - -In graphs, the sets refer to the set of connected nodes or neighborhood of nodes A and B. - -[Learn more about Jaccard Similarity](https://en.wikipedia.org/wiki/Jaccard_index) - -## When to use Jaccard Similarity -* You want to find whether two nodes in a graph are in similar communities. -* You want to compare the structure of two graphs. -* You have a set of graphs and want to classify them as particular types - -## When not to use Jaccard Similarity -* In directed graphs -* in very large sparse graphs -* Graphs with large disparities in node degrees - -## How computationally expensive is it? -While cuGraph's parallelism mitigates run cost, [Big O notation](https://en.wikipedia.org/wiki/Big_O_notation) is still the standard to compare algorithm costs. - -The cost of calculating the Jaccard Similarity for a graph is O(d * n) where d is the average degree of the nodes and n is the number of nodes. - -___ -Copyright (c) 2023, NVIDIA CORPORATION. - -Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -___ diff --git a/docs/nx-cugraph/source/graph_support/algorithms/katz_centrality.md b/docs/nx-cugraph/source/graph_support/algorithms/katz_centrality.md deleted file mode 100644 index 69b5d6b27..000000000 --- a/docs/nx-cugraph/source/graph_support/algorithms/katz_centrality.md +++ /dev/null @@ -1,28 +0,0 @@ -# Katz Centrality - -Katz centrality is a measure of the relative importance of a vertex within the graph based on measuring the influence across the total number of walks between vertex pairs. Katz is similar to Eigenvector centrality. The main difference is that Katz also takes into account indirect relationships. The Katz calculation includes a user-controlled attenuation variable that controls the weight of indirect relationships. Otherwise it shares many of the advantages and disadvantages of Eigenvector centrality. - -$C_{katz}(i) = \sum_{k=1}^{\infty} \sum_{j=1}^{n} \alpha ^k(A^k)_{ji}$ - -See [Katz on Wikipedia](https://en.wikipedia.org/wiki/Katz_centrality) for more details on the algorithm. - -## When to use Katz Centrality -* in disconnected graphs -* in sparse graphs -* in graphs with multi-hop propogation like innovation - -## When not to use Katz Centrality -* in graphs with heavy cyclical dependency (feedback loops), Katz Centrality might not converge preventing usable results. -* when a graph contains multiple distinct influence factors Katz can blur them. -* Katz is very expensive so use in large graphs depends on cuGraph parallelism to be viable. - -## How computationally expensive is it? -Katz centraility has several stages with costs that add up as the graph gets larger. The overall cost is often O(n2) to O(n3) where n is the number of nodes. - -___ -Copyright (c) 2023, NVIDIA CORPORATION. - -Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -___ diff --git a/docs/nx-cugraph/source/graph_support/algorithms/overlap_similarity.md b/docs/nx-cugraph/source/graph_support/algorithms/overlap_similarity.md deleted file mode 100644 index d9f9f681e..000000000 --- a/docs/nx-cugraph/source/graph_support/algorithms/overlap_similarity.md +++ /dev/null @@ -1,32 +0,0 @@ -# Overlap Similarity - -The Overlap Coefficient, also known as th Szymkiewicz–Simpson coefficient, between two sets is defined as the ratio of the volume of their intersection divided by the volume of the smaller set. -The Overlap Coefficient can be defined as - -$overlap(A,B) = \frac{|A \cap B|}{min(|A|,|B|)}$ - -[Learn more about Overlap Similarity](https://en.wikipedia.org/wiki/Overlap_coefficient) - -## When to use Overlap Similarity -* You want to find similarty based on shared neighbors instead of the sets as a whole. -* You want to partition a graph into non-overlapping clusters. -* You want to compare subgraphs within a graph - -## When not to use Overlap Similarity -* You are trying to compare graphs of extremely different sizes -* In overly sparse or dense graph can overlap similarity can miss relationships or give fals positives respectively. -* In directed graphs, there are better algorithms to use. - - -## How computationally expensive is it? -While cuGraph's parallelism migigates run time, [Big O notation](https://en.wikipedia.org/wiki/Big_O_notation) is still the standard to compare algorithm costs. - -The cost to compute overlap similarity is O(n*d) where n is the number of nodes and d is the average degree of the nodes. - -___ -Copyright (c) 2023, NVIDIA CORPORATION. - -Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -___ diff --git a/docs/nx-cugraph/source/graph_support/algorithms/sorensen_coefficient.md b/docs/nx-cugraph/source/graph_support/algorithms/sorensen_coefficient.md deleted file mode 100644 index 67d981815..000000000 --- a/docs/nx-cugraph/source/graph_support/algorithms/sorensen_coefficient.md +++ /dev/null @@ -1,34 +0,0 @@ -# Sørensen Coefficient - -The Sørensen Coefficient, also called the Sørensen-Dice similarity coefficient, quantifies the similarity and overlap between two samples. - -It is defined as two times the size of the set intersection divided by the sum of the size of the two sets. The value ranges from 0 to 1. - -Sørensen coefficient = $\left(2 * |A \cap B| \right) \over \left(|A| + |B| \right)$ - - -In graphs, the sets refer to the set of connected nodes or neighborhood of nodes A and B. - -[Learn more about Sørensen Coefficient](https://en.wikipedia.org/wiki/S%C3%B8rensen%E2%80%93Dice_coefficient) - -## When to use Sørensen Coefficient -* When you want to compare nodes with vastly different sized neighborhoods. -* When the intersection of the node neigborhoods is more important than the overall similarity - - -## When not to use Sørensen Coefficient -* In directed graphs -* Comparing graphs with different underlying data relationships. -* In weighted graphs, while cuGraph does have a weighted Sørensen implementation, the algorithm did not originally use weights. - -## How computationally expensive is it? -While cuGraph's parallelism mitigates run cost, [Big O notation](https://en.wikipedia.org/wiki/Big_O_notation) is still the standard to compare algorithm execution time. -The cost to run O(n * m) where n is the number of nodes in the graph and m is the number of groups to test. - -___ -Copyright (c) 2023, NVIDIA CORPORATION. - -Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -___ diff --git a/docs/nx-cugraph/source/graph_support/compatibility.rst b/docs/nx-cugraph/source/graph_support/compatibility.rst deleted file mode 100644 index ddb3f1d5f..000000000 --- a/docs/nx-cugraph/source/graph_support/compatibility.rst +++ /dev/null @@ -1,8 +0,0 @@ -Compatibility -============= - - -.. toctree:: - :maxdepth: 3 - -Compatibility document coming soon diff --git a/docs/nx-cugraph/source/graph_support/cugraph_service.rst b/docs/nx-cugraph/source/graph_support/cugraph_service.rst deleted file mode 100644 index 658f9e731..000000000 --- a/docs/nx-cugraph/source/graph_support/cugraph_service.rst +++ /dev/null @@ -1,9 +0,0 @@ -=============== -CuGraph Service -=============== - - -.. toctree:: - :maxdepth: 3 - -Cugraph Service for remote access to a server-based cuGraph(https://github.com/rapidsai/cugraph/blob/branch-23.04/python/cugraph-service/README.md) diff --git a/docs/nx-cugraph/source/graph_support/cugraphops_support.rst b/docs/nx-cugraph/source/graph_support/cugraphops_support.rst deleted file mode 100644 index 96b13f62a..000000000 --- a/docs/nx-cugraph/source/graph_support/cugraphops_support.rst +++ /dev/null @@ -1,10 +0,0 @@ -================== -cugraphops Support -================== - -cugraph-ops aims to be a low-level, framework agnostic library providing commonly used computational primitives for GNNs and other graph operations. - -.. toctree:: - :maxdepth: 3 - - https://github.com/rapidsai/cugraph/blob/branch-24.06/readme_pages/cugraph_ops.md diff --git a/docs/nx-cugraph/source/graph_support/datastores.rst b/docs/nx-cugraph/source/graph_support/datastores.rst deleted file mode 100644 index 50d8461e7..000000000 --- a/docs/nx-cugraph/source/graph_support/datastores.rst +++ /dev/null @@ -1,8 +0,0 @@ -Data Stores -=========== -.. toctree:: - :maxdepth: 3 - - property_graph.md - knowledge_stores.md - feature_stores.md diff --git a/docs/nx-cugraph/source/graph_support/feature_stores.md b/docs/nx-cugraph/source/graph_support/feature_stores.md deleted file mode 100644 index ef9358c4c..000000000 --- a/docs/nx-cugraph/source/graph_support/feature_stores.md +++ /dev/null @@ -1,3 +0,0 @@ -# Feature Store - -Coming Soon diff --git a/docs/nx-cugraph/source/graph_support/gnn_support.rst b/docs/nx-cugraph/source/graph_support/gnn_support.rst deleted file mode 100644 index 639b657c6..000000000 --- a/docs/nx-cugraph/source/graph_support/gnn_support.rst +++ /dev/null @@ -1,12 +0,0 @@ -============================ -Graph Neural Network Support -============================ - - -.. toctree:: - :maxdepth: 2 - - PyG_support.md - DGL_support.md - cugraphops_support.rst - wholegraph_support.md diff --git a/docs/nx-cugraph/source/graph_support/graph_algorithms.rst b/docs/nx-cugraph/source/graph_support/graph_algorithms.rst deleted file mode 100644 index 38dd8ccc2..000000000 --- a/docs/nx-cugraph/source/graph_support/graph_algorithms.rst +++ /dev/null @@ -1,8 +0,0 @@ -========== -Algorithms -========== - -.. toctree:: - :maxdepth: 3 - - algorithms.md diff --git a/docs/nx-cugraph/source/graph_support/index.rst b/docs/nx-cugraph/source/graph_support/index.rst deleted file mode 100644 index 67aba7428..000000000 --- a/docs/nx-cugraph/source/graph_support/index.rst +++ /dev/null @@ -1,13 +0,0 @@ -============= -Graph Support -============= - - -.. toctree:: - :maxdepth: 3 - - graph_algorithms.rst - compatibility.rst - gnn_support.rst - datastores.rst - cugraph_service.rst diff --git a/docs/nx-cugraph/source/graph_support/knowledge_stores.md b/docs/nx-cugraph/source/graph_support/knowledge_stores.md deleted file mode 100644 index 1749eb2b4..000000000 --- a/docs/nx-cugraph/source/graph_support/knowledge_stores.md +++ /dev/null @@ -1,3 +0,0 @@ -# Knowledge Store - -Coming Soon diff --git a/docs/nx-cugraph/source/graph_support/pg_example.png b/docs/nx-cugraph/source/graph_support/pg_example.png deleted file mode 100644 index 5ce8a0f20..000000000 Binary files a/docs/nx-cugraph/source/graph_support/pg_example.png and /dev/null differ diff --git a/docs/nx-cugraph/source/graph_support/property_graph.md b/docs/nx-cugraph/source/graph_support/property_graph.md deleted file mode 100644 index 94d170c18..000000000 --- a/docs/nx-cugraph/source/graph_support/property_graph.md +++ /dev/null @@ -1,50 +0,0 @@ -# Property Graph - -Part of [RAPIDS](https://rapids.ai) cuGraph, Property Graph allows all the great benefits of cuGraph to be applied to property-rich datasets stored in a graph structure. A Property Graph is really a data model rather than a type of graph. Within the cuGraph ecosystem, a Property Graph is a meta-graph that can encapsulate and instantiate all the other graph types. That view stems from property graphs being originally created for database systems. Conceptually a Property Graph can be viewed as a property rich structure that can be projected onto any graph types. The Dataversity, has a good definition of [Property Graph](https://www.dataversity.net/what-is-a-property-graph) which contains definitions from a collection of resources. - -![Sample Property Graph](../images/pg_example.png) - - -Property Graph enables: - -* Multiple edge and node types as seen in the Property Graph API -* Subgraph extractions based on properties and/or edge and node types as seen below. -* Storage of properties either within the graph structure on gpu or using GNN-centric storage extensions on host storage. -* Adding additional properties, nodes and edges into the property graph to store derived data like analytic results. -* Client access managed by a remote server allowing shared access and remote operations using [CuGraph Service](./cugraph_service.md). - -This is an example of using the cuGraph Property Graph in a two stage analysis. - -``` -import cudf -import cugraph -from cugraph.experimental import PropertyGraph - -# Import a built-in dataset -from cugraph.datasets import karate - -# Read edgelist data into a DataFrame, load into PropertyGraph as edge data. -# Create a graph using the imported Dataset object -graph = cugraph.Graph(directed=False) -G = karate.get_graph(create_using=graph,fetch=True) - -df = G.edgelist.edgelist_df -pG = PropertyGraph() -pG. add_edge_data(df, vertex_col_names=("src", "dst")) - -# Run Louvain to get the partition number for each vertex. -# Set resolution accordingly to identify two primary partitions. -(partition_info, _) = cugraph.louvain(pG.extract_subgraph(create_using=graph), resolution=0.6) - -# Add the partition numbers back to the Property Graph as vertex properties -pG.add_vertex_data(partition_info, vertex_col_name="vertex") - -# Use the partition properties to extract a Graph for each partition. -G0 = pG.extract_subgraph(selection=pG.select_vertices("partition == 0")) -G1 = pG.extract_subgraph(selection=pG. select_vertices("partition == 1")) -# Run pagerank on each graph, print results. -pageranks0 = cugraph.pagerank(G0) -pageranks1 = cugraph.pagerank(G1) -print(pageranks0.sort_values (by="pagerank", ascending=False).head(3)) -print(pageranks1.sort_values (by="pagerank", ascending=False).head(3)) -``` diff --git a/docs/nx-cugraph/source/graph_support/wholegraph_support.md b/docs/nx-cugraph/source/graph_support/wholegraph_support.md deleted file mode 100644 index d1c5eaf72..000000000 --- a/docs/nx-cugraph/source/graph_support/wholegraph_support.md +++ /dev/null @@ -1,4 +0,0 @@ -# WholeGraph - -[RAPIDS](https://rapids.ai) [WholeGraph](https://github.com/rapidsai/wholegraph) is designed to help train large-scale Graph Neural Networks(GNN). -Please see [WholeGraph Introduction](https://github.com/rapidsai/wholegraph/blob/main/README.md) for more details diff --git a/docs/nx-cugraph/source/installation/getting_cugraph.md b/docs/nx-cugraph/source/installation/getting_cugraph.md deleted file mode 100644 index 01bc9e379..000000000 --- a/docs/nx-cugraph/source/installation/getting_cugraph.md +++ /dev/null @@ -1,67 +0,0 @@ - -# Getting cuGraph Packages - -Start by reading the [RAPIDS Instalation guide](https://docs.rapids.ai/install) -and checkout the [RAPIDS install selector](https://rapids.ai/start.html) for a pick list of install options. - - -There are 4 ways to get cuGraph packages: -1. [Quick start with Docker Repo](#docker) -2. [Conda Installation](#conda) -3. [Pip Installation](#pip) -4. [Build from Source](./source_build.md) - - -
- -## Docker -The RAPIDS Docker containers contain all RAPIDS packages, including all from cuGraph, as well as all required supporting packages. To download a RAPIDS container, please see the [Docker Hub page for rapidsai/base](https://hub.docker.com/r/rapidsai/base), choosing a tag based on the NVIDIA CUDA version you're running. Also, the [rapidsai/notebooks](https://hub.docker.com/r/rapidsai/notebooks) container 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 -It is easy to install cuGraph using conda. You can get a minimal conda installation with [miniforge](https://github.com/conda-forge/miniforge). - -cuGraph Conda packages - * cugraph - this will also import: - * pylibcugraph - * libcugraph - * cugraph-service-client - * cugraph-service-server - * cugraph-dgl - * cugraph-pyg - * cugraph-equivariant - * nx-cugraph - -Replace the package name in the example below to the one you want to install. - - -Install and update cuGraph using the conda command: - -```bash -conda install -c rapidsai -c conda-forge -c nvidia cugraph cuda-version=12.0 -``` - -Alternatively, use `cuda-version=11.8` for packages supporting CUDA 11. - -Note: This conda installation only applies to Linux and Python versions 3.10/3.11/3.12. - -
- -## PIP -cuGraph, and all of RAPIDS, is available via pip. - -``` -pip install cugraph-cu12 --extra-index-url=https://pypi.nvidia.com -``` - -Replace `-cu12` with `-cu11` for packages supporting CUDA 11. - -Also available: - * cugraph-dgl-cu12 - * cugraph-pyg-cu12 - * cugraph-equivariant-cu12 - * nx-cugraph-cu12 - -
diff --git a/docs/nx-cugraph/source/installation/index.rst b/docs/nx-cugraph/source/installation/index.rst deleted file mode 100644 index 8ad12c589..000000000 --- a/docs/nx-cugraph/source/installation/index.rst +++ /dev/null @@ -1,10 +0,0 @@ -============ -Installation -============ - - -.. toctree:: - :maxdepth: 3 - - getting_cugraph - source_build diff --git a/docs/nx-cugraph/source/installation/source_build.md b/docs/nx-cugraph/source/installation/source_build.md deleted file mode 100644 index 243a62e5c..000000000 --- a/docs/nx-cugraph/source/installation/source_build.md +++ /dev/null @@ -1,222 +0,0 @@ -# Building from Source - -These instructions are tested on supported versions/distributions of Linux, -CUDA, and Python - See [RAPIDS Getting Started](https://rapids.ai/start.html) -for the list of supported environments. Other environments _might be_ -compatible, but are not currently tested. - -## Prerequisites - -__Compilers:__ -* `gcc` version 9.3+ -* `nvcc` version 11.5+ - -__CUDA:__ -* CUDA 11.8+ -* NVIDIA GPU, Volta architecture or later, with [compute capability](https://developer.nvidia.com/cuda-gpus) 7.0+ - -Further details and download links for these prerequisites are available on the -[RAPIDS System Requirements page](https://docs.rapids.ai/install#system-req). - -## Setting up the development environment - -### Clone the repository: -```bash -CUGRAPH_HOME=$(pwd)/cugraph -git clone https://github.com/rapidsai/cugraph.git $CUGRAPH_HOME -cd $CUGRAPH_HOME -``` - -### Create the conda environment - -Using conda is the easiest way to install both the build and runtime -dependencies for cugraph. While it is possible to build and run cugraph without -conda, the required packages occasionally change, making it difficult to -document here. The best way to see the current dependencies needed for a build -and run environment is to examine the list of packages in the [conda -environment YAML -files](https://github.com/rapidsai/cugraph/blob/main/conda/environments). - -```bash -# for CUDA 11.x -conda env create --name cugraph_dev --file $CUGRAPH_HOME/conda/environments/all_cuda-118_arch-x86_64.yaml - -# for CUDA 12.x -conda env create --name cugraph_dev --file $CUGRAPH_HOME/conda/environments/all_cuda-125_arch-x86_64.yaml - - -# activate the environment -conda activate cugraph_dev - -# to deactivate an environment -conda deactivate -``` - -The environment can be updated as cugraph adds/removes/updates its dependencies. To do so, run: - -```bash -# for CUDA 11.x -conda env update --name cugraph_dev --file $CUGRAPH_HOME/conda/environments/all_cuda-118_arch-x86_64.yaml -conda activate cugraph_dev - -# for CUDA 12.x -conda env update --name cugraph_dev --file $CUGRAPH_HOME/conda/environments/all_cuda-125_arch-x86_64.yaml -conda activate cugraph_dev - - - -``` - -### Build and Install - -#### Build and install using `build.sh` -Using the `build.sh` script, located in the `$CUGRAPH_HOME` directory, is the -recommended way to build and install the cugraph libraries. By default, -`build.sh` will build and install a predefined set of targets -(packages/libraries), but can also accept a list of targets to build. - -For example, to build only the cugraph C++ library (`libcugraph`) and the -high-level python library (`cugraph`) without building the C++ test binaries, -run this command: - -```bash -$ cd $CUGRAPH_HOME -$ ./build.sh libcugraph pylibcugraph cugraph --skip_cpp_tests -``` - -There are several other options available on the build script for advanced -users. Refer to the output of `--help` for details. - -Note that libraries will be installed to the location set in `$PREFIX` if set -(i.e. `export PREFIX=/install/path`), otherwise to `$CONDA_PREFIX`. - -#### Updating the RAFT branch - -`libcugraph` uses the [RAFT](https://github.com/rapidsai/raft) library and -there are times when it might be desirable to build against a different RAFT -branch, such as when working on new features that might span both RAFT and -cuGraph. - -For local development, the `CPM_raft_SOURCE=` option can -be passed to the `cmake` command to enable `libcugraph` to use the local RAFT -branch. The `build.sh` script calls `cmake` to build the C/C++ targets, but -developers can call `cmake` directly in order to pass it options like those -described here. Refer to the `build.sh` script to see how to call `cmake` and -other commands directly. - -To have CI test a `cugraph` pull request against a different RAFT branch, -modify the bottom of the `cpp/cmake/thirdparty/get_raft.cmake` file as follows: - -```cmake -# 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 - PINNED_TAG - - # When PINNED_TAG above doesn't match cugraph, - # force local raft clone in build directory - # even if it's already installed. - CLONE_ON_PIN ON - ) -``` - -When the above change is pushed to a pull request, the continuous integration -servers will use the specified RAFT branch to run the cuGraph tests. After the -changes in the RAFT branch are merged to the release branch, remember to revert -the `get_raft.cmake` file back to the original cuGraph branch. - - -## Run tests - -If you already have the datasets: - - ```bash - export RAPIDS_DATASET_ROOT_DIR= - ``` - If you do not have the datasets: - - ```bash - cd $CUGRAPH_HOME/datasets - source get_test_data.sh #This takes about 10 minutes and downloads 1GB data (>5 GB uncompressed) - ``` - -Run either the C++ or the Python tests with datasets - - - **Python tests with datasets** - - - ```bash - pip install python-louvain #some tests require this package to run - cd $CUGRAPH_HOME - cd python - pytest - ``` - - **C++ stand alone tests** - - From the build directory : - - ```bash - # Run the cugraph tests - cd $CUGRAPH_HOME - cd cpp/build - gtests/GDFGRAPH_TEST # this is an executable file - ``` - - **C++ tests with larger datasets** - - - - Run the C++ tests on large input: - - ```bash - cd $CUGRAPH_HOME/cpp/build - #test one particular analytics (eg. pagerank) - gtests/PAGERANK_TEST - #test everything - make test - ``` - -Note: This conda installation only applies to Linux and Python versions 3.10, 3.11, and 3.12. - -### (OPTIONAL) Set environment variable on activation - -It is possible to configure the conda environment to set environment variables -on activation. Providing instructions to set PATH to include the CUDA toolkit -bin directory and LD_LIBRARY_PATH to include the CUDA lib64 directory will be -helpful. - -```bash -cd ~/anaconda3/envs/cugraph_dev - -mkdir -p ./etc/conda/activate.d -mkdir -p ./etc/conda/deactivate.d -touch ./etc/conda/activate.d/env_vars.sh -touch ./etc/conda/deactivate.d/env_vars.sh -``` - -Next the env_vars.sh file needs to be edited - -```bash -vi ./etc/conda/activate.d/env_vars.sh - -#!/bin/bash -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 -``` - -``` -vi ./etc/conda/deactivate.d/env_vars.sh - -#!/bin/bash -unset PATH -unset LD_LIBRARY_PATH -``` - -## Creating documentation - -Python API documentation can be generated from _./docs/cugraph directory_. Or -through using "./build.sh docs" - -## Attribution -Portions adopted from https://github.com/pytorch/pytorch/blob/master/CONTRIBUTING.md diff --git a/docs/nx-cugraph/source/references/cugraph_ref.md b/docs/nx-cugraph/source/references/cugraph_ref.md deleted file mode 100644 index 845436a60..000000000 --- a/docs/nx-cugraph/source/references/cugraph_ref.md +++ /dev/null @@ -1,45 +0,0 @@ -# References - -## Architecture - -2-D Data Partitioning - -- Kang, S., Fender, A., Eaton, J., & Rees, B. (2020, September) *Computing PageRank Scores of Web Crawl Data Using DGX A100 Clusters*. In 2020 IEEE High Performance Extreme Computing Conference (HPEC) (pp. 1-4). IEEE. - -- S. Kang, J. Nke and B. Rees, (2022 September) *Analyzing Multi-trillion Edge Graphs on Large GPU Clusters: A Case Study with PageRank*, In 2022 IEEE High Performance Extreme Computing Conference (HPEC), Waltham, MA, USA, 2022, pp. 1-7, doi: 10.1109/HPEC55821.2022.9926341. - -

- -## Algorithms - -### Betweenness Centrality -- Brandes, U. (2001). *A faster algorithm for betweenness centrality*. Journal of mathematical sociology, 25(2), 163-177. -- Brandes, U. (2008). *On variants of shortest-path betweenness centrality and their generic computation*. Social Networks, 30(2), 136-145. -- McLaughlin, A., & Bader, D. A. (2018). *Accelerating GPU betweenness centrality*. Communications of the ACM, 61(8), 85-92. - -### Katz -- Katz, L. (1953). *A new status index derived from sociometric analysis*. Psychometrika, 18(1), 39-43. -- Foster, K.C., Muth, S.Q., Potterat, J.J. et al. *A faster Katz status score algorithm*. Computational & Mathematical Organization Theory (2001) 7: 275. - -### K-Truss -- J. Cohen, *Trusses: Cohesive subgraphs for social network analysis* National security agency technical report, 2008 -- O. Green, J. Fox, E. Kim, F. Busato, et al. *Quickly Finding a Truss in a Haystack* IEEE High Performance Extreme Computing Conference (HPEC), 2017 https://doi.org/10.1109/HPEC.2017.8091038 -- O. Green, P. Yalamanchili, L.M. Munguia, *Fast Triangle Counting on GPU* Irregular Applications: Architectures and Algorithms (IA3), 2014 - -### Hungarian Algorithm -- Date, K., & Nagi, R. (2016). GPU-accelerated Hungarian algorithms for the Linear Assignment Problem. Parallel Computing, 57, 52-72. - - -### Leiden -- Traag, V. A., Waltman, L., & Van Eck, N. J. (2019). *From Louvain to Leiden: guaranteeing well-connected communities*. Scientific reports, 9(1), 1-12. - -### Louvain -- VD Blondel, J-L Guillaume, R Lambiotte and E Lefebvre. *Fast unfolding of community hierarchies in large networks*. J Stat Mech P10008 (2008) - -

- -## Other Papers -- Hricik, T., Bader, D., & Green, O. (2020, September). *Using RAPIDS AI to Accelerate Graph Data Science Workflows*. In 2020 IEEE High Performance Extreme Computing Conference (HPEC) (pp. 1-4). IEEE. - - -

diff --git a/docs/nx-cugraph/source/references/datasets.md b/docs/nx-cugraph/source/references/datasets.md deleted file mode 100644 index 35234de87..000000000 --- a/docs/nx-cugraph/source/references/datasets.md +++ /dev/null @@ -1,21 +0,0 @@ -# Data Sets - -karate - - W. W. Zachary, *An information flow model for conflict and fission in small groups*, Journal of Anthropological Research 33, 452-473 (1977). -dolphins - - D. Lusseau, K. Schneider, O. J. Boisseau, P. Haase, E. Slooten, and S. M. Dawson, - *The bottlenose dolphin community of Doubtful Sound features a large proportion of long-lasting associations*, - Behavioral Ecology and Sociobiology 54, 396-405 (2003). -netscience - - M. E. J. Newman, - *Finding community structure in networks using the eigenvectors of matrices*, - Preprint physics/0605087 (2006). -email-Eu-core - - Hao Yin, Austin R. Benson, Jure Leskovec, and David F. Gleich. - *Local Higher-order Graph Clustering.* - In Proceedings of the 23rd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining. 2017. - - J. Leskovec, J. Kleinberg and C. Faloutsos. - *Graph Evolution: Densification and Shrinking Diameters*. - ACM Transactions on Knowledge Discovery from Data (ACM TKDD), 1(1), 2007. http://www.cs.cmu.edu/~jure/pubs/powergrowth-tkdd.pdf -polbooks - - V. Krebs, unpublished, http://www.orgnet.com/. diff --git a/docs/nx-cugraph/source/references/index.rst b/docs/nx-cugraph/source/references/index.rst index 9ea51a083..a8529246d 100644 --- a/docs/nx-cugraph/source/references/index.rst +++ b/docs/nx-cugraph/source/references/index.rst @@ -6,6 +6,4 @@ References .. toctree:: :maxdepth: 3 - cugraph_ref.md - datasets.md licenses.md diff --git a/docs/nx-cugraph/source/sphinxext/github_link.py b/docs/nx-cugraph/source/sphinxext/github_link.py index cc28dc6e8..c118c19cd 100644 --- a/docs/nx-cugraph/source/sphinxext/github_link.py +++ b/docs/nx-cugraph/source/sphinxext/github_link.py @@ -1,4 +1,4 @@ -# Copyright (c) 2019-2023, NVIDIA CORPORATION. +# Copyright (c) 2019-2024, NVIDIA CORPORATION. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at @@ -31,7 +31,7 @@ def isfunction(obj): new_val = hasattr(type(obj), "__code__") - if (orig_val != new_val): + if orig_val != new_val: return new_val return orig_val @@ -39,19 +39,18 @@ def isfunction(obj): inspect.isfunction = isfunction -REVISION_CMD = 'git rev-parse --short HEAD' +REVISION_CMD = "git rev-parse --short HEAD" -source_regex = re.compile(r"^File: (.*?) \(starting at line ([0-9]*?)\)$", - re.MULTILINE) +source_regex = re.compile(r"^File: (.*?) \(starting at line ([0-9]*?)\)$", re.MULTILINE) def _get_git_revision(): try: revision = subprocess.check_output(REVISION_CMD.split()).strip() except (subprocess.CalledProcessError, OSError): - print('Failed to execute git to get revision') + print("Failed to execute git to get revision") return None - return revision.decode('utf-8') + return revision.decode("utf-8") def _linkcode_resolve(domain, info, url_fmt, revision): @@ -71,14 +70,14 @@ def _linkcode_resolve(domain, info, url_fmt, revision): if revision is None: return - if domain != 'py': + if domain != "py": return - if not info.get('module') or not info.get('fullname'): + if not info.get("module") or not info.get("fullname"): return - class_name = info['fullname'].split('.')[0] - module = __import__(info['module'], fromlist=[class_name]) - obj = attrgetter(info['fullname'])(module) + class_name = info["fullname"].split(".")[0] + module = __import__(info["module"], fromlist=[class_name]) + obj = attrgetter(info["fullname"])(module) # Unwrap the object to get the correct source # file in case that is wrapped by a decorator @@ -91,7 +90,7 @@ def _linkcode_resolve(domain, info, url_fmt, revision): if not obj_module: print(f"could not infer source code link for: {info}") return - module_name = obj_module.__name__.split('.')[0] + module_name = obj_module.__name__.split(".")[0] module_dir_dict = { "cugraph_dgl": "cugraph-dgl", @@ -107,24 +106,22 @@ def _linkcode_resolve(domain, info, url_fmt, revision): return obj_path = "/".join(obj_module.__name__.split(".")[1:]) - obj_file_ext = obj_module.__file__.split('.')[-1] + obj_file_ext = obj_module.__file__.split(".")[-1] source_ext = "pyx" if obj_file_ext == "so" else "py" fn = f"{module_dir}/{module_name}/{obj_path}.{source_ext}" # Get the line number if we need it. (Can work without it) - if (lineno is None): + if lineno is None: try: lineno = inspect.getsourcelines(obj)[1] except Exception: # Can happen if its a cyfunction. See if it has `__code__` - if (hasattr(obj, "__code__")): + if hasattr(obj, "__code__"): lineno = obj.__code__.co_firstlineno else: - lineno = '' - return url_fmt.format(revision=revision, - path=fn, - lineno=lineno) + lineno = "" + return url_fmt.format(revision=revision, path=fn, lineno=lineno) def make_linkcode_resolve(url_fmt): @@ -137,6 +134,4 @@ def make_linkcode_resolve(url_fmt): '{path}#L{lineno}') """ revision = _get_git_revision() - return partial(_linkcode_resolve, - revision=revision, - url_fmt=url_fmt) + return partial(_linkcode_resolve, revision=revision, url_fmt=url_fmt) diff --git a/docs/nx-cugraph/source/tutorials/basic_cugraph.md b/docs/nx-cugraph/source/tutorials/basic_cugraph.md deleted file mode 100644 index a0c9ad576..000000000 --- a/docs/nx-cugraph/source/tutorials/basic_cugraph.md +++ /dev/null @@ -1,38 +0,0 @@ -# Getting started with cuGraph - -## Required hardware/software - -CuGraph is part of [Rapids](https://docs.rapids.ai/user-guide) and has the following system requirements: - * NVIDIA GPU, Volta architecture or later, with [compute capability](https://developer.nvidia.com/cuda-gpus) 7.0+ - * CUDA 11.2, 11.4, 11.5, 11.8, 12.0, 12.2, or 12.5 - * Python version 3.10, 3.11, or 3.12 - * NetworkX >= version 3.3 or newer in order to use use [NetworkX Configs](https://networkx.org/documentation/stable/reference/backends.html#module-networkx.utils.configs) **This is required for use of nx-cuGraph, [see below](#cugraph-using-networkx-code).** - -## Installation -The latest RAPIDS System Requirements documentation is located [here](https://docs.rapids.ai/install#system-req). - -This includes several ways to set up cuGraph -* From Unix - * [Conda](https://docs.rapids.ai/install#wsl-conda) - * [Docker](https://docs.rapids.ai/install#wsl-docker) - * [pip](https://docs.rapids.ai/install#wsl-pip) - -* In windows you must install [WSL2](https://learn.microsoft.com/en-us/windows/wsl/install) and then choose one of the following: - * [Conda](https://docs.rapids.ai/install#wsl-conda) - * [Docker](https://docs.rapids.ai/install#wsl-docker) - * [pip](https://docs.rapids.ai/install#wsl-pip) - -* Build From Source - -To build from source, check each RAPIDS GitHub README for set up and build instructions. Further links are provided in the [selector tool](https://docs.rapids.ai/install#selector). If additional help is needed reach out on our [Slack Channel](https://rapids-goai.slack.com/archives/C5E06F4DC). - -## CuGraph Using NetworkX Code -While the steps above are required to use the full suite of cuGraph graph analytics, cuGraph is now supported as a NetworkX backend using [nx-cugraph](https://docs.rapids.ai/api/cugraph/nightly/nx_cugraph/nx_cugraph/). -Nx-cugraph offers those with existing NetworkX code, a **zero code change** option with a growing list of supported algorithms. - - -## Cugraph API Example -Coming soon ! - - -Until then, [the cuGraph notebook repository](https://github.com/rapidsai/cugraph/blob/main/notebooks/README.md) has many examples of loading graph data and running algorithms in Jupyter notebooks. The [cuGraph test code](https://github.com/rapidsai/cugraph/tree/main/python/cugraph/cugraph/tests) gives examples of python scripts settng up and calling cuGraph algorithms. A simple example of [testing the degree centrality algorithm](https://github.com/rapidsai/cugraph/blob/main/python/cugraph/cugraph/tests/centrality/test_degree_centrality.py) is a good place to start. Some of these examples show [multi-GPU tests/examples with larger data sets](https://github.com/rapidsai/cugraph/blob/main/python/cugraph/cugraph/tests/centrality/test_degree_centrality_mg.py) as well. diff --git a/docs/nx-cugraph/source/tutorials/community_resources.md b/docs/nx-cugraph/source/tutorials/community_resources.md deleted file mode 100644 index 975f11965..000000000 --- a/docs/nx-cugraph/source/tutorials/community_resources.md +++ /dev/null @@ -1,4 +0,0 @@ -# Commmunity Resources -[Rapids Community Repository](https://github.com/rapidsai-community/notebooks-contrib) -[RAPIDS Containers on Docker Hub](https://catalog.ngc.nvidia.com/containers) -[RAPIDS PyTorch Container in Docker](https://catalog.ngc.nvidia.com/orgs/nvidia/containers/pyg) diff --git a/docs/nx-cugraph/source/tutorials/cugraph_blogs.rst b/docs/nx-cugraph/source/tutorials/cugraph_blogs.rst deleted file mode 100644 index 3665f425e..000000000 --- a/docs/nx-cugraph/source/tutorials/cugraph_blogs.rst +++ /dev/null @@ -1,90 +0,0 @@ - -cuGraph Blogs and Presentations -************************************************ - -The RAPIDS team blogs at https://medium.com/rapids-ai, and many of -these blog posts provide deeper dives into features from cuGraph. -Here, we've selected just a few that are of particular interest to cuGraph users: - - -Blogs & Conferences -==================== -2024 ------- -Coming Soon - -2023 ------- - * `Intro to Graph Neural Networks with cuGraph-DGL `_ - * `GTC 2023 Ask the Experts Q&A `_ - * `Accelerating NetworkX on NVIDIA GPUs for High Performance Graph Analytics `_ - * `Introduction to Graph Neural Networks with NVIDIA cuGraph-DGL `_ - * `Supercharge Graph Analytics at Scale with GPU-CPU Fusion for 100x Performance `_ -2022 ------- - * `GTC: State of cuGraph (video & slides) `_ - * `GTC: Scaling and Validating Louvain in cuGraph against Massive Graphs (video & slides) `_ - * `KDD Tutorial on Accelerated GNN Training with DGL/PyG and cuGraph `_ - -2021 ------- - * `GTC 21 - State of RAPIDS cuGraph and what's comming next `_ - -2020 ------- - * `Status of RAPIDS cuGraph — Refactoring Code And Rethinking Graphs `_ - * `Tackling Large Graphs with RAPIDS cuGraph and CUDA Unified Memory on GPUs `_ - * `RAPIDS cuGraph adds NetworkX and DiGraph Compatibility `_ - * `Large Graph Visualization with RAPIDS cuGraph `_ - * `GTC 20 Fall - cuGraph Goes Big `_ - -2019 -------- - * `RAPIDS cuGraph `_ - * `RAPIDS cuGraph — The vision and journey to version 1.0 and beyond `_ - * `RAPIDS cuGraph : multi-GPU PageRank `_ - * `Similarity in graphs: Jaccard versus the Overlap Coefficient `_ - * `GTC19 Spring - Accelerating Graph Algorithms with RAPIDS `_ - * `GTC19 Fall - Multi-Node Multi-GPU Machine Learning and Graph Analytics with RAPIDS `_ - -2018 -------- - * `GTC18 Fall - RAPIDS: Benchmarking Graph Analytics on the DGX-2 `_ - - - -Media -=============== - * `Nvidia Rapids cuGraph: Making graph analysis ubiquitous `_ - * `RAPIDS cuGraph – Accelerating all your Graph needs `_ - -Academic Papers -=============== - - * Seunghwa Kang, Chuck Hastings, Joe Eaton, Brad Rees `cuGraph C++ primitives: vertex/edge-centric building blocks for parallel graph computing `_ - - * Alex Fender, Brad Rees, Joe Eaton (2022) `Massive Graph Analytics `_ Bader, D. (Editor) CRC Press - - * S Kang, A. Fender, J. Eaton, B. Rees:`Computing PageRank Scores of Web Crawl Data Using DGX A100 Clusters`. In IEEE HPEC, Sep. 2020 - - * Hricik, T., Bader, D., & Green, O. (2020, September). `Using RAPIDS AI to accelerate graph data science workflows`. In 2020 IEEE High Performance Extreme Computing Conference (HPEC) (pp. 1-4). IEEE. - - * Richardson, B., Rees, B., Drabas, T., Oldridge, E., Bader, D. A., & Allen, R. (2020, August). Accelerating and Expanding End-to-End Data Science Workflows with DL/ML Interoperability Using RAPIDS. In Proceedings of the 26th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining (pp. 3503-3504). - - * A Gondhalekar, P Sathre, W Feng `Hybrid CPU-GPU Implementation of Edge-Connected Jaccard Similarity in Graph Datasets `_ - - -Other Blogs -======================== -* `4 graph algorithms on steroids for data scientists with cugraph `_ -* `Where should I walk `_ -* `Where really are the parking spots? `_ -* `Accelerating Single Cell Genomic Analysis using RAPIDS `_ -* `Running Large-Scale Graph Analytics with Memgraph and NVIDIA cuGraph Algorithms `_ -* `Dev Blog Repost: Similarity in Graphs: Jaccard Versus the Overlap Coefficient `_ - -RAPIDS Event Notebooks -====================== -* `KDD 2022 Notebook that demonstates using cuDF for ETL/data cleaning and XGBoost for training a fraud predection model. `_ -* `SciPy 22 Notebook comparing cuGraph to NetworkX `_ -* `KDD 2020 Tutorial Notebooks - Accelerating and Expanding End-to-End Data Science Workflows with DL/ML Interoperability Using RAPIDS `_ diff --git a/docs/nx-cugraph/source/tutorials/cugraph_notebooks.md b/docs/nx-cugraph/source/tutorials/cugraph_notebooks.md deleted file mode 100644 index 6d7840dc3..000000000 --- a/docs/nx-cugraph/source/tutorials/cugraph_notebooks.md +++ /dev/null @@ -1,72 +0,0 @@ -# cuGraph Notebooks - -![GraphAnalyticsFigure](https://github.com/rapidsai/cugraph/tree/main/img/GraphAnalyticsFigure.jpg) - -This repository contains a collection of Jupyter Notebooks that outline how to run various cuGraph analytics. The notebooks do not address a complete data science problem. The notebooks are simply examples of how to run the graph analytics. Manipulation of the data before or after the graph analytic is not covered here. Extended, more problem focused, notebooks are being created and available https://github.com/rapidsai/notebooks-extended - -## Summary - -| Folder | Notebook | Description | -| --------------- | ------------------------------------------------------------ | ------------------------------------------------------------ | -| Centrality | | | -| | [Centrality](https://github.com/rapidsai/cugraph/blob/main/notebooks/algorithms/centrality/Centrality.ipynb) | Compute and compare multiple (currently 5) centrality scores | -| | [Katz](https://github.com/rapidsai/cugraph/blob/main/notebooks/algorithms/centrality/Katz.ipynb) | Compute the Katz centrality for every vertex | -| | [Betweenness](https://github.com/rapidsai/cugraph/blob/main/notebooks/algorithms/centrality/Betweenness.ipynb) | Compute both Edge and Vertex Betweenness centrality | -| | [Degree](https://github.com/rapidsai/cugraph/blob/main/notebooks/algorithms/centrality/Degree.ipynb) | Compute Degree Centraility for each vertex | -| | [Eigenvector](https://github.com/rapidsai/cugraph/blob/main/notebooks/algorithms/centrality/Eigenvector.ipynb) | Compute Eigenvector for every vertex | -| Community | | | -| | [Louvain and Leiden](https://github.com/rapidsai/cugraph/blob/main/notebooks/algorithms/community/Louvain.ipynb) | Identify clusters in a graph using both the Louvain and Leiden algorithms | -| | [ECG](https://github.com/rapidsai/cugraph/blob/main/notebooks/algorithms/community/ECG.ipynb) | Identify clusters in a graph using the Ensemble Clustering for Graph | -| | [K-Truss](https://github.com/rapidsai/cugraph/blob/main/notebooks/algorithms/community/ktruss.ipynb) | Extracts the K-Truss cluster | -| | [Spectral-Clustering](https://github.com/rapidsai/cugraph/blob/main/notebooks/algorithms/community/Spectral-Clustering.ipynb) | Identify clusters in a graph using Spectral Clustering with both
- Balanced Cut
- Modularity Modularity | -| | [Subgraph Extraction](https://github.com/rapidsai/cugraph/blob/main/notebooks/algorithms/community/Subgraph-Extraction.ipynb) | Compute a subgraph of the existing graph including only the specified vertices | -| | [Triangle Counting](https://github.com/rapidsai/cugraph/blob/main/notebooks/algorithms/community/Triangle-Counting.ipynb) | Count the number of Triangle in a graph | -| Components | | | -| | [Connected Components](https://github.com/rapidsai/cugraph/blob/main/notebooks/algorithms/components/ConnectedComponents.ipynb) | Find weakly and strongly connected components in a graph | -| Core | | | -| | [K-Core](https://github.com/rapidsai/cugraph/blob/main/notebooks/algorithms/cores/kcore.ipynb) | Extracts the K-core cluster | -| | [Core Number](https://github.com/rapidsai/cugraph/blob/main/notebooks/algorithms/cores/core-number.ipynb) | Computer the Core number for each vertex in a graph | -Layout | | | -| | [Force-Atlas2](https://github.com/rapidsai/cugraph/blob/main/notebooks/algorithms/layout/Force-Atlas2.ipynb) |A large graph visualization achieved with cuGraph. | -| Link Analysis | | | -| | [Pagerank](https://github.com/rapidsai/cugraph/blob/main/notebooks/algorithms/link_analysis/Pagerank.ipynb) | Compute the PageRank of every vertex in a graph | -| | [HITS](https://github.com/rapidsai/cugraph/blob/main/notebooks/algorithms/link_analysis/HITS.ipynb) | Compute the HITS' Hub and Authority scores for every vertex in a graph | -| Link Prediction | | | -| | [Jaccard Similarity](https://github.com/rapidsai/cugraph/blob/main/notebooks/algorithms/link_prediction/Jaccard-Similarity.ipynb) | Compute vertex similarity score using both:
- Jaccard Similarity
- Weighted Jaccard | -| | [Overlap Similarity](https://github.com/rapidsai/cugraph/blob/main/notebooks/algorithms/link_prediction/Overlap-Similarity.ipynb) | Compute vertex similarity score using the Overlap Coefficient | -| Sampling | -| | [Random Walk](https://github.com/rapidsai/cugraph/blob/main/notebooks/algorithms/sampling/RandomWalk.ipynb) | Compute Random Walk for a various number of seeds and path lengths | -| Traversal | | | -| | [BFS](https://github.com/rapidsai/cugraph/blob/main/notebooks/algorithms/traversal/BFS.ipynb) | Compute the Breadth First Search path from a starting vertex to every other vertex in a graph | -| | [SSSP](https://github.com/rapidsai/cugraph/blob/main/notebooks/algorithms/traversal/SSSP.ipynb) | Single Source Shortest Path - compute the shortest path from a starting vertex to every other vertex | -| Structure | | | -| | [Renumbering](algorithms/structure/Renumber.ipynb)
[Renumbering 2](algorithms/structure/Renumber-2.ipynb) | Renumber the vertex IDs in a graph (two sample notebooks) | -| | [Symmetrize](algorithms/structure/Symmetrize.ipynb) | Symmetrize the edges in a graph | - - -## RAPIDS notebooks -Visit the main RAPIDS [notebooks](https://github.com/rapidsai/cugraph/blob/main/notebooks/) repo for a listing of all notebooks across all RAPIDS libraries. - -## Requirements - -Running the example in these notebooks requires: - -* The latest version of RAPIDS with cuGraph. - * Download via Docker, Conda (See [__Getting Started__](https://rapids.ai/start.html)) - -* cuGraph is dependent on the latest version of cuDF. Please install all components of RAPIDS -* Python 3.10+ -* A system with an NVIDIA GPU: Volta architecture or newer -* CUDA 11.4+ - -## Copyright - -Copyright (c) 2019-2023, NVIDIA CORPORATION. All rights reserved. - -Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at - -http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. - ---- diff --git a/docs/nx-cugraph/source/tutorials/how_to_guides.md b/docs/nx-cugraph/source/tutorials/how_to_guides.md deleted file mode 100644 index 998957afe..000000000 --- a/docs/nx-cugraph/source/tutorials/how_to_guides.md +++ /dev/null @@ -1,9 +0,0 @@ -# How To Guides -- [Basic use of cuGraph](./basic_cugraph.md) -- Property graph with analytic flow -- GNN – model building -- cuGraph Service – client/server setup and use (ucx) -- MNMG Graph – dask, rmm basics and examples -- Pylibcugraph – why and how -- Cugraph for C, C++ users -- Use of nvidia-smi with cugraph diff --git a/docs/nx-cugraph/source/tutorials/index.rst b/docs/nx-cugraph/source/tutorials/index.rst deleted file mode 100644 index 525fbe4f5..000000000 --- a/docs/nx-cugraph/source/tutorials/index.rst +++ /dev/null @@ -1,12 +0,0 @@ -========= -Tutorials -========= - - -.. toctree:: - :maxdepth: 3 - - how_to_guides.md - cugraph_blogs.rst - community_resources.md - cugraph_notebooks.md diff --git a/lint.yaml b/lint.yaml deleted file mode 100644 index dab2ea70e..000000000 --- a/lint.yaml +++ /dev/null @@ -1,87 +0,0 @@ -# Copyright (c) 2023-2024, NVIDIA CORPORATION. -# -# https://pre-commit.com/ -# -# Before first use: `pre-commit install` -# To run: `make lint` -# To update: `make lint-update` -# - &flake8_dependencies below needs updated manually -fail_fast: false -default_language_version: - python: python3 -repos: - - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.6.0 - hooks: - - id: check-added-large-files - - id: check-case-conflict - - id: check-merge-conflict - - id: check-symlinks - - id: check-ast - - id: check-toml - - id: check-yaml - - id: debug-statements - - id: end-of-file-fixer - exclude_types: [svg] - - id: mixed-line-ending - - id: trailing-whitespace - - repo: https://github.com/abravalheri/validate-pyproject - rev: v0.19 - hooks: - - id: validate-pyproject - name: Validate pyproject.toml - - repo: https://github.com/PyCQA/autoflake - rev: v2.3.1 - hooks: - - id: autoflake - args: [--in-place] - - repo: https://github.com/pycqa/isort - rev: 5.13.2 - hooks: - - id: isort - - repo: https://github.com/asottile/pyupgrade - rev: v3.17.0 - hooks: - - id: pyupgrade - args: [--py310-plus] - - repo: https://github.com/psf/black - rev: 24.8.0 - hooks: - - id: black - # - id: black-jupyter - - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.6.7 - hooks: - - id: ruff - args: [--fix-only, --show-fixes] # --unsafe-fixes] - - repo: https://github.com/PyCQA/flake8 - rev: 7.1.1 - hooks: - - id: flake8 - args: ['--per-file-ignores=_nx_cugraph/__init__.py:E501', '--extend-ignore=B020,SIM105'] # Why is this necessary? - additional_dependencies: &flake8_dependencies - # These versions need updated manually - - flake8==7.1.1 - - flake8-bugbear==24.8.19 - - flake8-simplify==0.21.0 - - repo: https://github.com/asottile/yesqa - rev: v1.5.0 - hooks: - - id: yesqa - additional_dependencies: *flake8_dependencies - - repo: https://github.com/codespell-project/codespell - rev: v2.3.0 - hooks: - - id: codespell - types_or: [python, rst, markdown] - additional_dependencies: [tomli] - files: ^(nx_cugraph|docs)/ - - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.6.7 - hooks: - - id: ruff - - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.6.0 - hooks: - - id: no-commit-to-branch - args: [-p, "^branch-2....$"] diff --git a/nx_cugraph/algorithms/centrality/katz.py b/nx_cugraph/algorithms/centrality/katz.py index 1c6ed6170..1890bd4d7 100644 --- a/nx_cugraph/algorithms/centrality/katz.py +++ b/nx_cugraph/algorithms/centrality/katz.py @@ -47,7 +47,7 @@ def katz_centrality( """`nstart` isn't used (but is checked), and `normalized=False` is not supported.""" if not normalized: # Redundant with the `_can_run` check below when being dispatched by NetworkX, - # but we raise here in case this funcion is called directly. + # but we raise here in case this function is called directly. raise NotImplementedError("normalized=False is not supported.") G = _to_graph(G, weight, 1, np.float32) if (N := len(G)) == 0: diff --git a/pyproject.toml b/pyproject.toml index 5f7f18076..d5742dc4f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,7 +6,7 @@ requires = [ "rapids-build-backend>=0.3.1,<0.4.0.dev0", "setuptools>=61.0.0", "wheel", -] # This list was generated by `rapids-dependency-file-generator`. To make changes, edit ../../dependencies.yaml and run `rapids-dependency-file-generator`. +] # This list was generated by `rapids-dependency-file-generator`. To make changes, edit dependencies.yaml and run `rapids-dependency-file-generator`. build-backend = "rapids_build_backend.build" [project] @@ -36,7 +36,7 @@ dependencies = [ "networkx>=3.0", "numpy>=1.23,<3.0a0", "pylibcugraph==24.12.*,>=0.0.0a0", -] # This list was generated by `rapids-dependency-file-generator`. To make changes, edit ../../dependencies.yaml and run `rapids-dependency-file-generator`. +] # This list was generated by `rapids-dependency-file-generator`. To make changes, edit dependencies.yaml and run `rapids-dependency-file-generator`. [project.optional-dependencies] test = [ @@ -48,7 +48,7 @@ test = [ "pytest-mpl", "pytest-xdist", "scipy", -] # This list was generated by `rapids-dependency-file-generator`. To make changes, edit ../../dependencies.yaml and run `rapids-dependency-file-generator`. +] # This list was generated by `rapids-dependency-file-generator`. To make changes, edit dependencies.yaml and run `rapids-dependency-file-generator`. [project.urls] Homepage = "https://github.com/rapidsai/nx-cugraph"