UNPKG

5.69 kBMarkdownView Raw
1CLI for nvGraph, which is a GPU-based graph analytics library written by NVIDIA, using CUDA.<br>
2🐚 [Shell](https://www.npmjs.com/package/nvgraph.sh),
3📜 [Files](https://unpkg.com/nvgraph.sh/),
4📘 [Wiki](https://github.com/nodef/nvgraph.sh/wiki/).
5
6This is for running [nvGraph] functions right from the [CLI] with graphs in
7[MatrixMarket] format (`.mtx`) directly. It just needs a [x86_64] linux machine
8with NVIDIA GPU drivers installed. Execution time, along with the results can be
9saved in [JSON]/[YAML] file. The [executable code] is written in C++. You can
10install this with `npm install -g nvgraph.sh`.
11
12**nvGraph**, as mentioned above, is a **GPU-based graph analytics library**
13written by *NVIDIA*. It provides four core graph algorithms: Single Source
14Shortest Path ([SSSP]), [PageRank], [Triangle count], and Breadth First Search
15([BFS]) traversal. Data is loaded into the GPU in Compressed Sparse Row ([CSR])
16format, upon which computation is performed. Here, we load the graph stored in
17**MatrixMarket format** (a text-based file format for sparse matrices) into a
18dynamic graph data structure in the host (CPU) memory, which is then converted
19to CSR format and then transferred to the device (GPU) memory. **Computed results**
20are then copied back to the host memory, and written to the **output file**
21in suitable format (**JSON/YAML**). Note that **measured time** only includes
22the time required for **computation** on the GPU.
23
24The **SSSP** algorithm accepts the *source vertex* as an argument, and returns
25the *shortest distance* to each vertex form the source vertex. The **PageRank**
26algorithm accepts the *damping factor*, *tolerance*, and *max. iterations* as
27arguments, and returns the *rank* of each vertex. In addition to ranks of
28vertices in case of the **PageRank** algorithm, we like to also obtain additional
29analytics of the rank values, i.e., [Lorenz curve], and [Gini coefficient]. The
30**Triangle count** algorithm, unsurprisingly, counts the *number of triangles*
31in the graph. The **BFS** traversal algorithm accepts the *source vertex* as an
32argument, traverses the graph in breadthwise manner, and returns the *distance*
33and *predecessor* of each vertex from the source vertex. Note that
34**detailed results** are written to the output file only when the **full**
35(`-f`) flag is provided.
36
37Alas, **nvGraph** is now no more actively developed. NVIDIA started developing
38[cuGraph] a collection of graph analytics that process data found in GPU
39Dataframes as part of [RAPIDS].
40
41> Stability: [Experimental](https://www.youtube.com/watch?v=L1j93RnIxEo).
42
43[nvGraph]: https://github.com/rapidsai/nvgraph
44[CLI]: https://en.wikipedia.org/wiki/Command-line_interface
45[x86_64]: https://en.wikipedia.org/wiki/X86-64
46[MatrixMarket]: https://math.nist.gov/MatrixMarket/formats.html
47[JSON]: https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Objects/JSON
48[YAML]: https://en.wikipedia.org/wiki/YAML
49[executable code]: src/cxx
50[SSSP]: https://www.geeksforgeeks.org/dijkstras-shortest-path-algorithm-greedy-algo-7/
51[PageRank]: https://www.geeksforgeeks.org/page-rank-algorithm-implementation/
52[Triangle count]: https://www.geeksforgeeks.org/number-of-triangles-in-a-undirected-graph/
53[BFS]: https://www.geeksforgeeks.org/breadth-first-search-or-bfs-for-a-graph/
54[CSR]: https://www.geeksforgeeks.org/sparse-matrix-representations-set-3-csr/
55[Lorenz curve]: https://en.wikipedia.org/wiki/Lorenz_curve
56[Gini coefficient]: https://en.wikipedia.org/wiki/Gini_coefficient
57[cuGraph]: https://github.com/rapidsai/cugraph
58[RAPIDS]: https://rapids.ai/
59
60<br>
61
62```bash
63## Finds single source shortest path from source vertex
64## → returns distances
65$ nvgraph sssp -o=out.json -f web-Google.mtx -s=1
66
67## Finds pagerank of all vertices
68## → returns ranks
69$ nvgraph pagerank -o=out.json -f web-Google.mtx -a=0.85 -t=1e-6
70
71## Counts triangles in undirected, lower triangular graph
72## → returns count
73$ nvgraph triangle-count -o=out.json -f web-Google.mtx
74
75## Traverses breadth-first from source vertex
76## → returns distances, predecessors
77$ nvgraph traversal-bfs -o=out.json -f web-Google.mtx -s=1
78```
79
80<br>
81<br>
82
83
84## Index
85
86| Command | Action |
87| --------------- | ---------------------------- |
88| [pagerank][01] | Finds pagerank of all vertices. |
89| [sssp][02] | Finds single source shortest path from source vertex. |
90| [traversal-bfs][03] | Traverses breadth-first from source vertex. |
91| [triangle-count][04] | Counts triangles in undirected, lower triangular graph. |
92
93<br>
94<br>
95
96
97## References
98
99- [nvGraph pagerank example, EN605.617, JHU-EP-Intro2GPU](https://github.com/JHU-EP-Intro2GPU/EN605.617/blob/master/module9/nvgraph_examples/nvgraph_Pagerank.cpp)
100- [nvGraph pagerank example, CUDA Toolkit Documentation](https://docs.nvidia.com/cuda/archive/10.0/nvgraph/index.html#nvgraph-pagerank-example)
101- [nvGraph Library User's Guide](https://docs.nvidia.com/cuda/archive/10.1/pdf/nvGRAPH_Library.pdf)
102- [RAPIDS nvGraph NVIDIA graph library](https://github.com/rapidsai/nvgraph)
103- [Get path of current script when executed through a symlink](https://unix.stackexchange.com/a/17500/166668)
104
105<br>
106<br>
107
108[![](https://img.youtube.com/vi/3s9psf01ldo/maxresdefault.jpg)](https://www.youtube.com/watch?v=3s9psf01ldo)
109[![ORG](https://img.shields.io/badge/org-nodef-green?logo=Org)](https://nodef.github.io)
110[![DOI](https://zenodo.org/badge/362208913.svg)](https://zenodo.org/badge/latestdoi/362208913)
111
112
113[01]: https://github.com/nodef/nvgraph.sh/wiki/pagerank
114[02]: https://github.com/nodef/nvgraph.sh/wiki/sssp
115[03]: https://github.com/nodef/nvgraph.sh/wiki/traversal-bfs
116[04]: https://github.com/nodef/nvgraph.sh/wiki/triangle-count