Skip to content

Benchmarks ​

PATHPACK.jl against the codes people use for the same problems: GPU codes on the same GPU, graph libraries on the same CPU cores, and the path step inside tools for machine learning, neuroscience and geometry. Every time is wall-clock, from the graph in memory to the full answer in memory, and every comparison checks that the answers agree.

All 15.9 billion distances of the US road network one NVIDIA B200 each

PATHPACK.jl139 ms
ROME750 ms5.4× slower
cuGraph18.1 s130× slower
Fast-APSP106 s760× slower

Closeness of every street in Paris (11,840 junctions) one 32-core AMD EPYC node; igraph and NetworkX single-threaded

PATHPACK.jl282 ms
graph-tool952 ms3.4× slower
NetworKit2.49 s8.8× slower
igraph19.9 s70× slower
NetworkX290 s1026× slower

Isomap on 10,000 points: the shortest-path step one 32-core AMD EPYC node

PATHPACK.jl206 ms
NetworKit1.27 s6.2× slower
SciPy, 16 processes1.68 s8.1× slower
scikit-learn21.8 s106× slower

Exact personalized PageRank (GDC) on a 47k-node mesh 16 CPU cores, float64

PATHPACK.jl4.58 s
PyTorch dense inverse545 s119× slower

Every pair of a 32k-vertex cortex one 32-core AMD EPYC node

PATHPACK.jl2.64 s
NetworKit17.2 s6.5× slower
neuromaps, 16 workers24.1 s9.1× slower

Wall-clock times from the graph in memory to the full answer in memory, the same answers checked between tools. Scripts and raw measurements are public.

Hardware. CPU runs use one node with a 32-core AMD EPYC 7702; PATHPACK.jl runs on 16 threads unless a row says otherwise, and so do the multithreaded libraries. GPU runs use NVIDIA B200 GPUs, one unless a row says otherwise. Times are in seconds (s) or milliseconds (ms); in each table the fastest time is in bold.

GPU Against GPU Codes ​

All pairs on one B200. ROME and Fast-APSP are recent research codes for all-pairs shortest paths on GPUs; cuGraph is NVIDIA's graph analytics library.

GraphVerticesPATHPACK.jlROMEcuGraphFast-APSP
US road network126,1460.139 s0.750 s18.05 s105.5 s
Land-cover grid (ecology)67,4110.102 s0.353 s10.13 s
Stanford bunny mesh34,83455.6 ms0.109 s1.70 s
Swiss roll kNN graph10,00022.1 ms25.0 ms285.7 ms
164k-vertex cortex164k0.90 s9.46 s

On the US road network that is 15.9 billion distances in 0.139 s: 5.4× faster than ROME, 130× faster than cuGraph and 760× faster than Fast-APSP. Over ROME's own 16 test graphs, PATHPACK.jl is faster on all 16, by 3.1× in geometric mean. cuGraph is 6 to 1,600 times slower across the graphs we tested.

Proteins and Shapes ​

Molecules as graphs of their atoms, and surface meshes of objects, all pairs on one B200.

GraphPATHPACK.jlROMEcuGraph
Spike protein, 21,539 atoms47.9 ms93.9 ms793 ms
ATP synthase26.3 ms35.0 ms634 ms
GroEL149 ms265 ms6.21 s
Virus capsid, 85,620 atoms296 ms1.73 s13.06 s
Space Shuttle114 ms285 ms8.89 s
Apollo 11 capsule217 ms562 ms49.8 s
Saxophone123 ms332 ms9.78 s
Mammoth68.5 ms115 ms4.05 s
Palm31.4 ms37.1 ms1.47 s

Other Semirings ​

The same land-cover grid (67,411 cells, every cell to every cell) on one B200, in three semirings:

SemiringQuestionTime
MinPlusleast-cost distance0.102 s
MinMaxworst barrier on the best route0.105 s
PlusProdexpected visits of a random walk0.177 s

Several GPUs ​

All pairs on eight B200s. Each GPU computes a block of rows.

GraphVerticesDistancesTime
France roads297,14488.3 billion0.343 s
Brazil roads323,474104.6 billion0.392 s
Japan roads353,713125.1 billion0.464 s
Colorado roads435,666189.8 billion0.389 s
Stanford dragon mesh436,846190.8 billion0.699 s

The work is balanced between the GPUs: the slowest GPU took 2.2% longer than the mean in the median run, and 13.3% longer at most.

CPU Against Libraries, Same Cores ​

PATHPACK.jl and the multithreaded libraries on the same 16 cores of one node. Across the test graphs, the other libraries are this much slower than PATHPACK.jl:

LibrarySlower by
graph-tool (closeness)1.7 to 9×
NetworKit5 to 15×
SciPy, 16 processes3 to 14×
Graphs.jl, parallel all pairs10 to 42×

Closeness of every junction in Paris (11,840 junctions):

CodeThreadsTime
PATHPACK.jl160.282 s
graph-tool160.952 s
NetworKit162.49 s
igraph119.86 s
NetworkX1289.75 s

Every cell to every cell of a landscape (67,411 land-cover cells):

CodeThreadsTime
PATHPACK.jl168.82 s
NetworKit16134.4 s
SciPy11007.9 s

Inside Other Tools ​

The all-pairs step of tools in other fields, replaced by one PATHPACK.jl call.

Exact diffusion for graph neural networks. Personalized PageRank diffusion (GDC,  ) in float64, against torch.inverse, the dense inverse in PyTorch Geometric's exact GDC. Details on the tutorial page.

GraphNodesCPU: PATHPACK.jlCPU: torchB200: PATHPACK.jlB200: torch
Cora2,70848.5 ms182.0 ms6.5 ms14.9 ms
CiteSeer3,32759.8 ms316.4 ms4.8 ms19.4 ms
PubMed19,7171.93 s43.70 s93.5 ms780.0 ms
Swiss roll kNN10,000294 ms6.31 s25.0 ms145.5 ms
Palm mesh25,1151.37 s88.81 s54.3 ms1.50 s
Bunny mesh34,8342.80 s230.56 s103.9 ms3.70 s
Mammoth mesh47,0044.58 s545.43 s124.5 ms8.64 s

The answers agree to about , relative. PyTorch Geometric's exact mode is the dense one; on large graphs most users run its approximate mode instead, which these numbers do not compare against.

Isomap. The shortest-path step on a 10,000-point swiss roll (tutorial):

CodeHardwareTime
PATHPACK.jl16 CPU threads0.206 s
NetworKit16 CPU threads1.27 s
SciPy16 processes1.68 s
scikit-learn Isomap, path step1 core21.78 s
SciPy Dijkstra1 core21.77 s
igraph1 core31.58 s

Brain maps. Every pair of vertices of a 32k-vertex cortex surface (tutorial):

CodeHardwareTime
PATHPACK.jl16 CPU threads2.64 s
NetworKit16 CPU threads17.2 s
neuromaps16 workers24.1 s
BrainSMASH, as in its default workflowCPU1.6 hours

Mesh geodesics. Every pair of vertices of the Stanford bunny (34,834 vertices). PATHPACK.jl, ROME, cuGraph and SciPy compute graph geodesics, which are on average 6.9% longer than exact surface geodesics. The heat method and MMP compute geodesics on the surface itself.

CodeHardwareTime
PATHPACK.jlone B20055.6 ms
PATHPACK.jl16 CPU threads1.61 s
PATHPACK.jl1 CPU thread12.98 s
SciPy Dijkstra1 core206.7 s
Heat method (potpourri3d), about 0.8% errorCPU575 s, extrapolated
Exact MMP geodesics (pygeodesic)CPU14.7 hours, extrapolated

Where PATHPACK.jl Does Not Win ​

  • Few sources. On one query of 145 sources, NetworKit is faster than PATHPACK.jl. Single-source methods do work per source, and with few sources there is little to share; PATHPACK.jl pays for a factorization of the whole graph.

  • Unweighted grids. On an unweighted warehouse grid PATHPACK.jl is only 1.15× faster than graph-tool and NetworKit.

  • One mesh on the GPU. ROME is faster on one of our graphs, a biplane mesh, by 1.12×.

How We Measure ​

Each time is the wall-clock time from the graph in memory to the full answer in memory: for all pairs, every distance of the   result. Loading files and writing results are not counted, for any code. The answers of every code are checked against each other. Every other code runs with the best settings we found for it. CPU comparisons use the same cores for every multithreaded code; single-threaded codes are marked as such.

The benchmark scripts and raw measurements are public in the PATHPACK.jl repository.

Released under the MIT License.