Streaming Right Multiplication over Grammar-Compressed Matrices: A Memory-Bounded GPU Engine for Genotype and Graph Data
Abstract
Grammar-compressed matrices store a matrix's non-zero structure as a RePair straight-line program (SLP), supporting matrix-vector products in time and space proportional to the compressed size. We target the regime where this is decisive on a GPU: when the uncompressed matrix exceeds device memory, so footprint (not floating-point throughput) is the binding constraint. Our SLP is a directed acyclic graph (DAG) of out-degree 2, and the right product is a single bottom-up sweep (leaves to roots): a conflict-free gather. We make the grammar properly layered (every nonterminal child one level below its parent) via pass-through completion, which inserts identity nodes to carry values upward until consumed. This yields a streaming evaluation in which each level reads only the level below and writes the next, so the live set fits in two alternating read-only/write-only buffers instead of scaling with the whole grammar. On genotype matrices, where a polygenic score is exactly the right product , a CUDA implementation shows a clear space advantage: a device footprint 3.5 to 8 times smaller than a materialized cuSPARSE CSR baseline, single-vector times within a small factor of cuSPARSE, and consistently lower GPU energy. Because the sweep needs only an associative and commutative combine, the same engine evaluates any homomorphism into a commutative monoid over the grammar by swapping a small leaf/combine/emit policy; the same reachability sweep scales to a billion-edge Software Heritage graph (261 TB dense, 21 times smaller serialized than cuSPARSE's CSR). We frame this as an algorithm-engineering case study: structural metrics (depth, live-set width, completion cost) are measured, architecture-independent grammar properties, whereas time and energy are profiled on a single board.
Create a lesson
Metadata
- Categories
- cs.MS, cs.DC, cs.DS, cs.PF
- Comments
- Accepted at ALENEX 2027 (SIAM Symposium on Algorithm Engineering and Experiments). 16 pages, 4 figures, 7 tables. Artifact evaluated (Availability and Reproducibility badges). Code: https://doi.org/10.5281/zenodo.23139248; data: https://doi.org/10.5281/zenodo.22677747
Related papers
Ozaki 2.5: Engineering the Deconstruction Path of fp64-Emulated Dense Matrix Multiplication on FP8 Tensor Cores
Shared title terminologycs.MSSatoshi Matsuoka
Discontinuity-Aware Solvers for Vapor-Compression Cycles
Shared title terminologycs.MSShreyas Ekanathan, Avinash Subramanian, Oscar Smith et al.
Providing Accuracy Guarantees for the Fixed-Point Emulation of Matrix Multiplication
Shared title terminologycs.MSCole Brower, Peter Caday, John Gunnels
py-ARGOS: A Python package for automatic, statistically principled discovery of ordinary differential equations from data
Shared title terminologycs.MSYuzheng Zhang, Rui Carvalho
A 55-Addition Rank-23 Scheme for 3×3 Matrix Multiplication via Exact Two-Sided Minimization
Shared title terminologycs.MSGreg Sidebottom
Emulating DGEMM and ZGEMM with INT8 Matrix Engines on Intel Arc GPUs: Ozaki Scheme II on the Xe2 Architecture
Shared title terminologycs.MSRostislavs Rostovskis, Aleksandrs Platonenko