cuGraph — GPU-Accelerated Graph Analytics
cuGraph is NVIDIA's GPU-accelerated graph analytics library, part of the RAPIDS data science ecosystem. It provides a comprehensive suite of graph algorithms — PageRank, BFS, Louvain, Leiden, SSSP, Triangle Counting, and many more — implemented in CUDA C++ with Python bindings that interoperate with cuDF, cuML, and NetworkX.
The architecture is a four-layer stack: a CUDA C++ core with ~30 reusable primitives (reducing per-algorithm kernel development), a C API for FFI, Cython bindings (pylibcugraph), and a pure-Python NetworkX-compatible API. The nx-cugraph backend plugin transparently accelerates existing NetworkX code on GPU.
The core data structure is a CSR/CSC adjacency list with degree-based vertex segmentation (high/medium/low/hypersparse) and a DCSR extension for scale-free graphs with many low-degree vertices. Multi-GPU execution uses 2D edge partitioning via NCCL, chosen over simpler 1D partitioning for communication efficiency on algorithms that access both rows and columns.
Key design decisions include compile-time template specialization over runtime dispatch, a primitive library rather than ad-hoc per-algorithm kernels, owning/non-owning graph type separation for zero-copy composition, and automatic vertex renumbering for GPU memory locality. The codebase totals roughly 110K lines across C++, Cython, and Python.
Compared to alternatives: Gunrock pioneered similar ideas but cuGraph has broader coverage and NVIDIA production support; GraphBLAS takes a linear-algebra approach vs. cuGraph's Thrust-like functional API; and cuGraph's sampling APIs are designed to serve as a backend for GNN frameworks like DGL and PyTorch Geometric.