LabelPropagation-CUDA#
LabelPropagation-CUDA is the code of DynLP (ICS 2026; dyng.citation("label_propagation"), key
dynlp2026): binary harmonic label propagation on a similarity graph, kept up to date on the GPU
while vertices arrive in batches with their edges and leave. It also holds IrLP, the iterative
baseline the paper compares with, and a synthetic Erdős-Rényi stream generator. dynG’s
label_propagation, the slot rows of row_layout::slotted and the vertex batches of
batch_semantics::net_effect() are ports of it.
Repository |
|
Pinned commit |
|
Paper snapshot |
tag |
History |
63 commits, 2024-07 to 2026-09, all by S M Shovan (56 under his identities, 7 under the placeholder |
Ported in |
M10a (the fused CUDA engine verbatim, IrLP, the sequential backend, the slot rows and the vertex batches, the legacy generator, |
Parity |
the damped labels byte for byte (every batch’s float bits, |
Gates |
damped |
The code was a CUDA research prototype: one executable dynLP with a Makefile (--use_fast_math,
ARCH ?= sm_86), a monolithic runDynLP over all batches, exit()-based error checks, and a
graph generator inside the program. Its 2026 fixes (the branch fix/correctness-perf) gave it
the test oracles of checker.h (--check: the harmonic solution by PCG in double precision, the
component partition by union-find, the exact affected set, the vertex status and the device rows
against a host model), stage timers (--profile), a results.csv per run and make test,
which dynG’s parity harness builds on.
What was ported, from which files#
LabelPropagation-CUDA@a276a3a |
dynG |
|---|---|
|
|
|
the fused engine’s |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Not ported: the Makefile, exit()-based CUDA_CHECK, the camelCase flags outside the
compatibility tool, the two-stream overlap of the batch copy with the first kernels (the library
creates no stream, AD21; it was worth 0.03 % of the update time) and the bench scripts.
What was fixed in the original before the port#
Recorded in the original’s CHANGES.md (D-a to D-h: correctness; DP1 to DP3 and H-D1/H-D2:
performance), against baseline-2026-09:
D-a the connected components ran on the wrong edge list (out-of-bounds reads; an illegal-address abort at 500K vertices and more); D-b the affected set dropped about two thirds of V_aff; D-e deletions were ineffective and a vertex inserted and deleted in the same batch stayed active forever.
D-c / D-d a stale double buffer and plain Jacobi’s period-2 oscillation sent the batches to the 100,000-iteration cap; the in-place update with two hashed half-sweeps (and the damped rule,
--update damped) converges in every batch.The two divisions by zero of the paper’s pseudo-code (a component without edges to either supernode, a vertex without active neighbours), the one-sided convergence check, D-h the generator’s int32 overflow (and N·d < 2^31 checked), D-f the full re-upload of the graph per batch (now a device-resident append-only graph), D-g the metrics (per snapshot, against IrLP).
DP1-DP3 the 8-lane sub-warp mapping with degree bins, the frontier-resident loop and the per-batch overheads: 50K x 10 from 16.9 s to 0.085 s, 500K x 10 from 41.5 s to 0.35 s, 5M x 10 from 185.8 s to 3.46 s of DynLP time against the correctness-equivalent baseline (
results/README.md).
The paper’s figures were measured on the code before these fixes; “Differences from the paper” and “Paper vs fixed code” on the label_propagation: binary harmonic label propagation under vertex batches page (sections 7 and 8) quote the original’s own words on what that changes (the accuracy of about 51 % against the synthetic true labels, the delta-approximation, the IrLP speedups that do not reproduce).
What differs in dynG#
A library, not a run.
runDynLPran a generated stream end to end; dynG hascompute()and oneupdate()per batch on the frozen graph container, with the seeds as inputs, the stream as a generator, and the original’s run as the documented published setup (ADR 0071).The rows are the graph’s. The original’s
DeviceGraphisrow_layout::slotted, a layout of the general graph container (withrow_layout::slackbeside it for the streaming mode), and its status array isvertex_status; the other algorithms refuse those layouts by name (AD11).Two schedules, two backends, two engines.
dampedandin_placeon a new sequential backend and on CUDA; on CUDA the verbatim fused engine (bitwise the original’s damped labels) and an operators engine with the same bits (ADR 0101).Errors instead of sticky flags. A contract violation that the original recorded in a device error flag and reported at the end of the run is a named exception at the update that causes it (
capacity_error,invalid_argument_error).What the original accepted unchecked (C8):
--tau 0, a NaN--tauand--maxIter <= 0are refused bydyng-compat-dynlpand by the options’ checks; a negative--taukeeps the original’s automatic threshold.Streaming. Slack rows that grow, the current graph’s tau, and float edge lists,
.dgt/.dgbvertex records and a kNN recipe (datasets/preprocess/knn_graph.py) for your own data (Streaming label propagation).
The mapping of every name and every DynLPConfig field is section 9 of
label_propagation: binary harmonic label propagation under vertex batches.