Skip to content

Commit

Permalink
Merge branch 'branch-24.04' into remove-hardcoded-version
Browse files Browse the repository at this point in the history
  • Loading branch information
KyleFromNVIDIA committed Mar 12, 2024
2 parents 3b077df + 6171bd9 commit 80d900c
Show file tree
Hide file tree
Showing 19 changed files with 324 additions and 334 deletions.
2 changes: 1 addition & 1 deletion docs/cugraph/source/api_docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Core Graph API Documentation
cugraph_c/index.rst
cugraph_cpp/index.rst

Graph Nerual Networks API Documentation
Graph Neural Networks API Documentation
---------------------------------------

.. toctree::
Expand Down
42 changes: 14 additions & 28 deletions docs/cugraph/source/basics/nx_transition.rst
Original file line number Diff line number Diff line change
@@ -1,30 +1,20 @@
**************************************
NetworkX Compatibility and Transition
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*

One of the goals of RAPIDS cuGraph is to mimic the NetworkX API to simplify
the transition to accelerated GPU data science. However, graph analysis,
also called network science, like most other data science workflow, is more
than just running an algorithm. Graph data requires cleaning and prep (ETL)
and then the construction of a graph object; that is all before the execution
of a graph algorithm. RAPIDS and cuGraph allow a portion or the complete
analytic workflow to be accelerated. To achieve the maximum amount of
acceleration, we encourage fully replacing existing code with cuGraph.
But sometimes it is easier to replace just a portion.

Last Update
###########
Latest Update
#############

Last Update: Oct 14th, 2020
Release: 0.16
Last Update: March 7th, 2024
Release: 24.04

Information on `NetworkX <https://networkx.github.io/documentation/stable/index.html>`_

This transition guide in an expansion of the Medium Blog on `NetworkX Compatibility
<https://medium.com/rapids-ai/rapids-cugraph-networkx-compatibility-d119e417557c>`_
**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
<https://developer.nvidia.com/blog/accelerating-networkx-on-nvidia-gpus-for-high-performance-graph-analytics/>`_

Easy Path – Use NetworkX Graph Objects, Accelerated Algorithms
Expand All @@ -33,12 +23,11 @@ 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.

improvements.

In the following example, the cuGraph module is being imported as “cnx”.
While module can be assigned any name can be used, we picked cnx to reduce
the amount of text to be changed. The text highlighted in yellow indicates
changes.

.. image:: ../images/Nx_Cg_1.png
:width: 600
Expand All @@ -49,9 +38,6 @@ 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
##########################

Expand Down Expand Up @@ -169,8 +155,8 @@ 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
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
Expand Down
2 changes: 1 addition & 1 deletion docs/cugraph/source/graph_support/property_graph.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import cugraph
from cugraph.experimental import PropertyGraph
# Import a built-in dataset
from cugraph.experimental.datasets import karate
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
Expand Down
Binary file added docs/cugraph/source/images/ancestors.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/cugraph/source/images/bfs_tree.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/cugraph/source/images/conn_component.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/cugraph/source/images/descendents.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/cugraph/source/images/k_truss.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/cugraph/source/images/katz.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/cugraph/source/images/pagerank.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/cugraph/source/images/sssp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/cugraph/source/images/wcc.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs/cugraph/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ the docs and links
:caption: Contents:

basics/index
nx_cugraph/index
installation/index
tutorials/index
graph_support/index
Expand Down
9 changes: 9 additions & 0 deletions docs/cugraph/source/nx_cugraph/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
===============================
nxCugraph as a NetworkX Backend
===============================


.. toctree::
:maxdepth: 2

nx_cugraph.md
165 changes: 165 additions & 0 deletions docs/cugraph/source/nx_cugraph/nx_cugraph.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,165 @@
### nx_cugraph


Whereas previous versions of cuGraph have included mechanisms to make it
trivial to plug in cuGraph algorithm calls. Beginning with version 24.02, nx-cuGraph
is now a [networkX backend](<https://networkx.org/documentation/stable/reference/utils.html#backends>).
The user now need only [install nx-cugraph](<https://github.com/rapidsai/cugraph/blob/branch-24.04/python/nx-cugraph/README.md#install>)
to experience GPU speedups.

Lets look at some examples of algorithm speedups comparing CPU based NetworkX to dispatched versions run on GPU with nx_cugraph.

Each chart has three measurements.
* NX - running the algorithm natively with networkX on CPU.
* nx-cugraph - running with GPU accelerated networkX achieved by simply calling the cugraph backend. This pays the overhead of building the GPU resident object for each algorithm called. This achieves significant improvement but stil isn't compleltely optimum.
* nx-cugraph (preconvert) - This is a bit more complicated since it involves building (precomputing) the GPU resident graph ahead and reusing it for each algorithm.


![Ancestors](../images/ancestors.png)
![BFS Tree](../images/bfs_tree.png)
![Connected Components](../images/conn_component.png)
![Descendents](../images/descendents.png)
![Katz](../images/katz.png)
![Pagerank](../images/pagerank.png)
![Single Source Shortest Path](../images/sssp.png)
![Weakly Connected Components](../images/wcc.png)


The following algorithms are supported and automatically dispatched to nx-cuGraph for acceleration.

#### Algorithms
```
bipartite
├─ basic
│ └─ is_bipartite
└─ generators
└─ complete_bipartite_graph
centrality
├─ betweenness
│ ├─ betweenness_centrality
│ └─ edge_betweenness_centrality
├─ degree_alg
│ ├─ degree_centrality
│ ├─ in_degree_centrality
│ └─ out_degree_centrality
├─ eigenvector
│ └─ eigenvector_centrality
└─ katz
└─ katz_centrality
cluster
├─ average_clustering
├─ clustering
├─ transitivity
└─ triangles
community
└─ louvain
└─ louvain_communities
components
├─ connected
│ ├─ connected_components
│ ├─ is_connected
│ ├─ node_connected_component
│ └─ number_connected_components
└─ weakly_connected
├─ is_weakly_connected
├─ number_weakly_connected_components
└─ weakly_connected_components
core
├─ core_number
└─ k_truss
dag
├─ ancestors
└─ descendants
isolate
├─ is_isolate
├─ isolates
└─ number_of_isolates
link_analysis
├─ hits_alg
│ └─ hits
└─ pagerank_alg
└─ pagerank
operators
└─ unary
├─ complement
└─ reverse
reciprocity
├─ overall_reciprocity
└─ reciprocity
shortest_paths
└─ unweighted
├─ single_source_shortest_path_length
└─ single_target_shortest_path_length
traversal
└─ breadth_first_search
├─ bfs_edges
├─ bfs_layers
├─ bfs_predecessors
├─ bfs_successors
├─ bfs_tree
├─ descendants_at_distance
└─ generic_bfs_edges
tree
└─ recognition
├─ is_arborescence
├─ is_branching
├─ is_forest
└─ is_tree
```

#### Generators
```
classic
├─ barbell_graph
├─ circular_ladder_graph
├─ complete_graph
├─ complete_multipartite_graph
├─ cycle_graph
├─ empty_graph
├─ ladder_graph
├─ lollipop_graph
├─ null_graph
├─ path_graph
├─ star_graph
├─ tadpole_graph
├─ trivial_graph
├─ turan_graph
└─ wheel_graph
community
└─ caveman_graph
small
├─ bull_graph
├─ chvatal_graph
├─ cubical_graph
├─ desargues_graph
├─ diamond_graph
├─ dodecahedral_graph
├─ frucht_graph
├─ heawood_graph
├─ house_graph
├─ house_x_graph
├─ icosahedral_graph
├─ krackhardt_kite_graph
├─ moebius_kantor_graph
├─ octahedral_graph
├─ pappus_graph
├─ petersen_graph
├─ sedgewick_maze_graph
├─ tetrahedral_graph
├─ truncated_cube_graph
├─ truncated_tetrahedron_graph
└─ tutte_graph
social
├─ davis_southern_women_graph
├─ florentine_families_graph
├─ karate_club_graph
└─ les_miserables_graph
```

#### Other

```
convert_matrix
├─ from_pandas_edgelist
└─ from_scipy_sparse_array
```
2 changes: 2 additions & 0 deletions docs/cugraph/source/tutorials/community_resources.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
# 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)
15 changes: 15 additions & 0 deletions docs/cugraph/source/tutorials/cugraph_blogs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,17 @@ 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 <https://medium.com/rapids-ai/introduction-to-graph-neural-networks-with-cugraph-dgl-64c632e9cc52>`_
* `GTC 2023 Ask the Experts Q&A <https://forums.developer.nvidia.com/c/blogs-events/connect-with-experts/ama-cugraph/652?ncid=em-even-260150-vt33#cid=dev03_em-even_en-us>`_
* `Accelerating NetworkX on NVIDIA GPUs for High Performance Graph Analytics <https://developer.nvidia.com/blog/accelerating-networkx-on-nvidia-gpus-for-high-performance-graph-analytics/>`_
* `Introduction to Graph Neural Networks with NVIDIA cuGraph-DGL <https://developer.nvidia.com/blog/introduction-to-graph-neural-networks-with-nvidia-cugraph-dgl/>`_
* `Supercharge Graph Analytics at Scale with GPU-CPU Fusion for 100x Performance <https://developer.nvidia.com/blog/supercharge-graph-analytics-at-scale-with-gpu-cpu-fusion-for-100x-performance/>`_
2022
------
* `GTC: State of cuGraph (video & slides) <https://www.nvidia.com/gtc/session-catalog/?search=cuGraph&tab.scheduledorondemand=1583520458947001NJiE&search=cuGraph#/session/1635793340204001n4p2>`_
Expand Down Expand Up @@ -50,6 +61,8 @@ Media
Academic Papers
===============

* Seunghwa Kang, Chuck Hastings, Joe Eaton, Brad Rees `cuGraph C++ primitives: vertex/edge-centric building blocks for parallel graph computing <https://ieeexplore.ieee.org/abstract/document/10196665>`_

* Alex Fender, Brad Rees, Joe Eaton (2022) `Massive Graph Analytics <https://books.google.com/books?hl=en&lr=&id=QspxEAAAQBAJ&oi=fnd&pg=PT8&dq=book:%22Massive+Graph+Analytics%22&ots=3HAGJ0njKO&sig=8e4v0azmzA6LTQNUNgPw-uTLkoc#v=onepage&q&f=false>`_ 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
Expand All @@ -58,6 +71,8 @@ Academic Papers

* 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 <https://sc23.supercomputing.org/proceedings/tech_poster/poster_files/rpost221s3-file3.pdf>`_


Other Blogs
========================
Expand Down
Loading

0 comments on commit 80d900c

Please sign in to comment.