---
title: Row-Clustered Matrix Format Overview
url: https://www.emergentmind.com/topics/row-clustered-matrix-format
type: topic
---

# Row-Clustered Matrix Format Overview

Row-clustered matrix format denotes a family of matrix representations and orderings in which rows are grouped into contiguous clusters, strips, chunks, super-rows, or similarity-defined sets, and the cluster rather than the individual row becomes the primary unit of storage, traversal, scheduling, or interpretation. In sparse linear algebra, this idea appears in formats such as SELL-C-\(\sigma\), row-grouped CSR, Adaptive Row-Grouped CSR, CMRS, CSR-\(k\), RCMF, and 1D-VBR, all of which exploit row grouping to regularize memory access, improve SIMD/SIMT utilization, reduce index traffic, or increase reuse of secondary operands; in matrix ordering, it appears as a permutation problem that makes similar rows contiguous and condenses matrix mass into block-diagonal, banded, triangular, or nested patterns [1307.6209][1012.2270][2110.12776][2507.21253].

## 1. Definitions and scope

In the sparse-kernel literature, a row-clustered format usually groups adjacent rows into a local storage unit and then stores the cluster in a layout that is more regular than standard CSR. The group may be fixed-height, as in SELL-C-\(\sigma\) chunks and CMRS strips; block-sized and adaptive, as in row-grouped CSR and ARGCSR; hierarchical, as in CSR-\(k\) super-rows and super-super-rows; or variable-length and similarity-driven, as in RCMF clusters and 1D-VBR row partitions [1307.6209][1203.2946][1203.5737][2203.05096][2507.21253][2005.12414].

In the ordering literature, row clustering refers instead to a permutation of rows, and optionally columns, so that similar rows appear contiguously and the reordered matrix exhibits a prescribed geometric pattern. The square symmetric case uses a similarity transform \(B' = P^\top B P\), while rectangular or asymmetric cases may use independent row and column permutations \(P_r\) and \(P_c\) [2110.12776].

| Format or framework | Cluster unit | Primary purpose |
|---|---|---|
| SELL-C-\(\sigma\) | chunk of \(C\) rows | SIMD/SIMT-friendly SpMV |
| RgCSR / ARGCSR | CUDA block-sized row group | coalescing and load balance on GPUs |
| CMRS | strip of height \(h\) | warp-per-strip SpMV |
| CSR-\(k\) | super-rows and super-super-rows | heterogeneous CSR-compatible SpMV |
| RCMF | row cluster \(S_\ell\) with column slices | reuse of \(B\) in SpGEMM |
| 1D-VBR | contiguous row partition \(\Pi\) | block reuse across adjacent rows |
| OPP-based ordering | permutation-defined contiguous row groups | interpretable geometric patterns |

A common misconception is that row clustering denotes a single storage format. The published literature instead uses the term across at least three distinct settings: sparse storage layout, cluster-wise execution order, and permutation-based matrix ordering. This suggests that the unifying concept is not a specific array layout but the decision to treat a small set of rows as a coherent structural object.

## 2. SELL-C-\(\sigma\) as a canonical SIMD/SIMT row-clustered format

SELL-C-\(\sigma\) is the most explicit formalization of a row-clustered sparse format in the SpMV literature. The matrix is partitioned into \(N_c = N/C\) chunks of height \(C\), with chunk \(i\) containing rows \(iC,\dots,(i+1)C-1\). Prior to chunking, rows may be locally sorted within windows of size \(\sigma\), where \(\sigma=1\) means no sorting and \(\sigma \to N\) yields global sorting. For chunk \(i\), the stored length is the longest row length in the chunk,
$$
\mathrm{cl}[i] = \max_{k=iC}^{(i+1)C-1}\mathrm{rowLen}[k].
$$
Values and column indices are then stored column-major within each chunk, with rows interleaved at stride \(C\), and shorter rows padded to \(\mathrm{cl}[i]\) using padded values \(0\) and padded column indices \(0\) [1307.6209].

The format’s central efficiency metric is chunk occupancy,
$$
\beta = \frac{N_{\mathrm{nz}}}{\sum_{i=0}^{N_c-1} C \cdot \mathrm{cl}[i]},
$$
which measures the fraction of stored entries that are useful nonzeros. The same paper derives the double-precision code balance
$$
B_{\mathrm{SELL}}^{\mathrm{DP}}(\alpha,\beta,N_{\mathrm{nzr}}) =
\left(\frac{6}{\beta} + 4\alpha + \frac{8}{N_{\mathrm{nzr}}}\right)\frac{\mathrm{bytes}}{\mathrm{flop}},
$$
and a bandwidth-bound performance estimate \(P = b/B_{\mathrm{SELL}}^{\mathrm{DP}}\). Here \(\alpha\) captures effective right-hand-side traffic per nonzero, while \(1/\beta\) isolates padding overhead in the streamed value and index arrays [1307.6209].

The two tuning parameters serve different roles. \(C\) is a hardware-facing parameter: \(C=4\) for Intel Sandy Bridge AVX double precision, \(C=16\) for Intel Xeon Phi to satisfy 64-byte alignment constraints, and \(C=32\) for NVIDIA Tesla/Kepler K20 to match the warp size. \(\sigma\) is a locality-facing parameter: moderate values such as \(128\)–\(256\) often raise \(\beta\) substantially while preserving right-hand-side locality, whereas very large \(\sigma\) can increase \(\alpha\) by destroying spatial and temporal locality. On the kkt_power matrix on SNB, \(\beta\) increased toward \(1\) as \(\sigma\) increased, SELL surpassed CRS around \(\sigma \approx 128\), and \(\alpha\) remained stable until \(\sigma \approx 2^{15}\), after which performance declined [1307.6209].

SELL-C-\(\sigma\) was proposed as a hardware-independent “catch-all” format. For memory-bound, large-\(N_{\mathrm{nzr}}\) matrices such as RM07R and ML_Geer, the model with \(\beta=1\) gave upper bounds of SNB \(\approx 7.2\) Gflop/s, Xeon Phi \(\approx 27.5\) Gflop/s, and K20 \(\approx 25.2\) Gflop/s; measured SELL-C-\(\sigma\) performance at tuned \(\sigma\) reached \(\approx 80\%\) of bound on K20 and Xeon Phi and \(\gtrsim 90\%\) on SNB. At the same time, the paper emphasizes the expected degradation on small-\(N_{\mathrm{nzr}}\) matrices, where performance drops by \(\approx 2\times\) or more because the \(12/N_{\mathrm{nzr}}\) term dominates [1307.6209].

## 3. GPU row-grouped and strip-based formats

Earlier GPU-oriented row-clustered formats pursued the same objective through CUDA-centric layouts. Row-grouped CSR (RgCSR) partitions rows into fixed-size groups of size \(G\), stores each group like a local ELLPACK slab, and interleaves the \(k\)-th element of each row across the group. The padded element count is
\[
S = \sum_g G_g m_g,
\]
with waste ratio \(W = (S-\mathrm{nnz})/\mathrm{nnz}\) and storage efficiency \(E=\mathrm{nnz}/S\). Each thread computes one row, and in iteration \(k\) threads in a warp read consecutive values and column indices, producing coalesced transactions. On GTX 280, the best observed performance at \(G=128\) with cached \(x\) was \(32.8\) Gflop/s in single precision and \(18.82\) Gflop/s in double precision; RgCSR was faster than HYB on \(77.1\%\) of matrices in single precision and \(80.7\%\) in double precision across \(1{,}596\) matrices, but extreme row-length variability could inflate artificial zeros above \(40\times\) for \(G=128\) and \(85\times\) for \(G=256\) [1012.2270].

Adaptive Row-Grouped CSR (ARGCSR) preserved the group idea but made the internal decomposition adaptive. Rows are assigned to groups associated with CUDA blocks, long rows are split into fixed-size chunks processed by multiple threads, and all threads in the block iterate exactly `chunkSize` steps. The format stores `values`, `columns`, a per-group descriptor `argcsrGroupInfo {firstRow, size, offset, chunkSize}`, and `globalThreadsMapping`, which records how many threads are assigned to each row. Extra threads are greedily assigned to the longest rows, shrinking `chunkSize` and reducing padding. Padding entries use sentinel column index \(-1\), enabling early exit in the kernel [1203.5737].

The quantitative evaluation of ARGCSR was unusually broad. On \(1{,}600\) matrices on Tesla C2070, ARGCSR was faster than Hybrid on \(1{,}318\) matrices, faster than Row-grouped CSR on \(1{,}072\), and faster than cuSPARSE on \(1{,}358\). It was particularly effective on irregular matrices from circuit/EDA and indefinite problems; rajat23 reached \(5.1\) Gflop/s and a speed-up of \(11\) versus CPU CSR with `desiredChunkSize = 1`, while Schenk_AFE reached nearly \(18\) Gflop/s with `desiredChunkSize = 32` [1203.5737].

CMRS took a different but related route by assigning one warp to a strip of \(h\) contiguous rows. The core arrays are `Val`, `ColInd`, `StripPtr`, and `RowInStrip`; in the bit-packed variant, `RowInStrip` is stored in the low bits of `ColInd` with `CMRS_BITS = 4`. Nonzeros in the strip are concatenated contiguously, so a warp marches through `Val` and `ColInd` in stride \(32\), accumulates into a shared-memory buffer of size \(W \times h\), and reduces to \(h\) row sums. The analytical speedup model relative to CSR-vector is expressed through a bandwidth waste factor \(f(h,\mu)=1+(\lambda-b)/(h\mu b)\), showing directly why larger strip heights help when the average row length \(\mu\) is small [1203.2946].

Empirically, CMRS achieved up to \(\approx 60\%\) speedup over the best of five alternative GPU kernels. On K20M, the reported maxima were \(\approx 62\%\) in single precision and \(\approx 34\%\) in double precision, with CMRS dominating especially for moderate \(\mu\), while HYB often remained strongest for very small \(\mu\) [1203.2946].

## 4. Hierarchical and block-aware row clustering

CSR-\(k\) extends standard CSR by keeping `vals`, `col_idx`, and `row_ptr` unchanged and adding \(k-1\) pointer arrays that define a hierarchy of contiguous row clusters. In CSR-3, `sr_ptr` partitions rows into super-rows and `ssr_ptr` partitions super-rows into super-super-rows. On CPUs, CSR-2 was the preferred configuration; on NVIDIA GPUs, CSR-3 mapped more naturally to the block/grid hierarchy. The format is coupled with a multilevel bandwidth-limiting reordering called Band-\(k\), intended to pull nonzeros closer to the diagonal and align the hierarchy with locality in the \(x\) vector [2203.05096].

The format was explicitly targeted at heterogeneous portability for regular sparse matrices, defined by \(\mathrm{Var}(n)\le 10\), where \(n_i\) is the number of nonzeros in row \(i\). On A100, CSR-3 achieved \(\approx 187.3\) GFlop/s on regular matrices versus \(\approx 169.5\) for CSR5 and \(\approx 153.3\) for cuSPARSE; on V100, CSR-3 achieved \(\approx 98.4\) GFlop/s versus \(\approx 93.0\) for CSR5. The same paper also reported that CSR-3 lagged badly on irregular matrices, where cuSPARSE and CSR5 remained superior [2203.05096].

1D-VBR represents another row-clustered specialization, but in a block-format setting rather than a SIMD strip setting. It groups adjacent rows into a contiguous partition \(\Pi\), keeps the column partition trivial, and stores each nonzero block as a dense \(u_k \times 1\) micro-vector. The core arrays are `spl_Π`, `pos`, `ofs`, `idx`, and `val`, and the memory footprint is
\[
s_{\mathrm{1D\mbox{-}VBR}}(A,\Pi)=
[3(K+1)+N_{\mathrm{index}}(A,\Pi)]\,s_{\mathrm{index}} +
N_{\mathrm{value}}(A,\Pi)\,s_{\mathrm{value}}.
\]
Because the column partition is fixed, the optimal row partition can be computed exactly by a linear-time dynamic program under several cost models, including block count, memory, and an empirical low-rank runtime model [2005.12414].

The empirical results favored 1D-VBR as a speed-oriented row-clustered format. 1D-VBR Min Compute achieved a median speedup of \(2.22\times\) versus CSR, median normalized multiply time of \(0.45\times\) CSR, and median critical point of \(16.9\) multiplies. Full VBR Min Memory compressed more aggressively, with median memory around \(0.56\times\) CSR, but 1D-VBR was often faster because it eliminated per-block width variability and reduced control overhead [2005.12414].

## 5. Cluster-wise multiplication beyond SpMV

Row clustering has also been used to reorganize sparse matrix–matrix multiplication. RCMF, a Row-Clustered Matrix Format for SpGEMM, partitions the rows of \(A\) into clusters \(H=\{S_\ell\}\), computes the per-cluster column union
\[
U_\ell = \bigcup_{i\in S_\ell}\{j\mid A_{i,j}\neq 0\},
\]
and stores the matrix cluster-by-cluster and column-by-column inside each cluster. Its data structures include `cluster_ptr`, `col_idx`, `cluster_size`, `slice_ptr`, `val`, `mask`, `row_order`, and `cluster_id`. During execution, the algorithm iterates over clusters and then over column slices; when column \(j\) is encountered, row \(B_{j,*}\) is fetched once and reused across all rows in \(S_\ell\) that contain \(A_{i,j}\) [2507.21253].

The paper separates clustering from reordering and studies fixed-length, variable-length, and hierarchical clustering. Variable-length clustering uses Jaccard similarity,
\[
\mathrm{Jaccard}(i,r)=\frac{|N(i)\cap N(r)|}{|N(i)\cup N(r)|},
\]
with default parameters \( \mathrm{jacc\_th}\approx 0.3 \) and \( \mathrm{max\_cluster\_th}\approx 8 \). Hierarchical clustering computes \(\mathrm{SpGEMM}(A\times A^\top)\), keeps TopK matches per row with \(\mathrm{TopK}=\mathrm{max\_cluster\_th}-1\), and merges rows with union-find. On \(110\) SuiteSparse matrices, hierarchical clustering achieved a \(1.39\times\) geomean speedup, improved \(\approx 70\%\) of inputs, reached up to \(4.68\times\), and had preprocessing cost less than \(20\times\) a single SpGEMM on \(\approx 90\%\) of inputs [2507.21253].

A different use of row clustering appears in the exact and approximate multiplication of \(0\)-\(1\) matrices. There, rows of \(A\) are clustered around \(\ell\) centers in Hamming space, producing a centers matrix \(A'\), a row-to-center map, and per-row difference sets
\[
\mathrm{ind}(A,i)=\{m\in[q]:A_{im}\neq A'_{\mathrm{center\_id}[i],m}\}.
\]
If \(\lambda_A\) is the minimum maximum radius of an \(\ell\)-center clustering of the rows, then each entry of \(AB\) can be approximated within additive error at most \(2\lambda_A\) in \(O(n^2\ell)\) time for square matrices; symmetrically, column clustering of \(B\) yields additive error at most \(2\lambda_B\) in \(O(n^2k)\) time. After preprocessing, exact point queries can be answered in \(O(\lambda_A)\) or \(O(\lambda_B)\) time, and exact multiplication can be performed in \(O(n^2(\ell+k+\min\{\lambda_A,\lambda_B\}))\) time [2503.19631].

These two strands use the same structural idea in different ways: RCMF treats a cluster as an execution tile for reuse of sparse rows of \(B\), while the \(0\)-\(1\) framework treats a cluster as a representative-center approximation space. A plausible implication is that row clustering can be valuable even when the stored format itself remains close to CSR.

## 6. Permutation-based row clustering and geometric patterns

Outside sparse-kernel storage, row clustering is formalized as an optimal permutation problem. Given an input matrix \(B\) and a filter matrix \(A\) encoding a target pattern, the objective is
\[
E(P)=\|PA-BP\|^2
=\|A\|^2+\|B\|^2-2\operatorname{tr}(B^\top P A P^\top),
\]
and one seeks \(P^\ast=\arg\min_P E(P)\). In the square symmetric case, the clustered matrix is \(B' = P^{\top}BP\); in rectangular or asymmetric cases, one may use independent row and column permutations \(P_r\) and \(P_c\) [2110.12776].

The framework supports several pattern families by choosing \(A\): square filters with \(Q\) diagonal blocks and density \(\rho(Q)=1/Q\), triangle filters with density \(1/(2Q)\), band filters defined by analytic \(j_{\min}(i,p)\) and \(j_{\max}(i,p)\), and nestedness filters defined by \(A_{ij}=1\) if \(j \le f(i;p)=N-(i-1)^p(N-1)^{1-p}\). The discrete problem is NP-hard as a quadratic assignment problem, so the paper uses a doubly stochastic relaxation over the Birkhoff polytope, a statistical-mechanics formulation with partition function \(Z(\beta)=\sum_P e^{-\beta E(P)}\), and Sinkhorn-Knopp scaling. The reported algorithm initializes \(X^{(0)}\leftarrow 1/N\), uses \(\beta=10\), \(\alpha=10^{-3}\), \(\epsilon\) starting at \(10\) and decreasing to \(0\), and tolerances \(\delta_{\mathrm{tol}}=\Delta_{\mathrm{tol}}=10^{-5}\) [2110.12776].

The empirical examples are biological. On a \(33\times 33\) neuronal correlation matrix for *C. elegans*, a two-block square filter separated forward and backward locomotion neurons, while a three-block filter isolated a “Turn” block involving ring interneurons RIVL/RIVR, motor neurons SMDVR/SMDVL and RMEV, labial neurons OLQDR/OLQVL, and polymodal ALA. On the gap-junction adjacency matrix with \(N=253\), \(M=514\) undirected edges, and \(\sum_{ij}B_{ij}=1028\), the nestedness packing fraction
\[
\phi(p)=\frac{1}{2M}\sum_{i=1}^N \sum_{j=1}^{f(i;p)} (P^{\top}_\ast B P_\ast)_{ij}
\]
was empirically \(\approx 10\%\) larger than in a degree-preserving randomized network across \(p\in(0,1]\) [2110.12776].

This line of work uses “row-clustered matrix format” in an ordering sense rather than a low-level storage sense. The clustered object is the permutation \(P^\ast\) and the geometric pattern it induces, not necessarily a new values-and-indices layout.

## 7. Trade-offs, limitations, and recurring design tensions

Across these formats, the main trade-off is between regularity and distortion. SELL-C-\(\sigma\) exposes this most clearly: larger \(C\) improves SIMD/SIMT alignment, but higher \(C\) can lower \(\beta\); larger \(\sigma\) can improve \(\beta\) by grouping similar row lengths, but can also worsen right-hand-side locality by increasing \(\alpha\) [1307.6209]. GPU row-grouped formats exhibit the same pattern in more concrete form: RgCSR and fixed-length RCMF can suffer large padding overheads when row patterns in a cluster are dissimilar, while ARGCSR and variable-length RCMF mitigate this by adaptive thread assignment or adaptive cluster formation [1012.2270][1203.5737][2507.21253].

Another recurring tension is preprocessing cost versus amortized speedup. CSR-\(k\) relies on Band-\(k\) reordering and microarchitecture-specific tuning formulas; RCMF hierarchical clustering adds one \(\mathrm{SpGEMM}(A\times A^\top)\); 1D-VBR and OPP-based ordering solve nontrivial optimization problems before the first kernel invocation. These costs are acceptable when many multiplies follow, but the papers repeatedly note that single-use or rapidly changing sparsity patterns weaken the case for conversion or reordering [2203.05096][2507.21253][2005.12414][2110.12776].

The formats also have sharply delimited applicability domains. CSR-\(k\) is explicitly strongest for regular matrices with \(\mathrm{Var}(n)\le 10\) and underperforms cuSPARSE and CSR5 on irregular GPU workloads [2203.05096]. CMRS loses much of its advantage on permutation-like matrices with \(\mu=1\), where \(\eta_+\approx \eta_-\approx 0.09\) on K20M because \(x\) accesses remain uncoalesced [1203.2946]. ARGCSR can be beaten by cuSPARSE or HYB on some power-system matrices and by earlier row-grouped or sliced-ELLPACK methods on some structured PDE matrices [1203.5737]. 1D-VBR and VBR become unattractive when adjacent rows share few columns, because explicit zeros inside dense blocks increase \(N_{\mathrm{value}}\) [2005.12414].

Finally, permutation-based formulations introduce a separate sensitivity: the filter must reflect the true target geometry. The OPP framework states directly that if the filter \(A\) poorly represents the underlying pattern, or the data are noisy, the overlap term \(\operatorname{tr}(B^\top P A P^\top)\) may not align well with the intended structure [2110.12776]. In that sense, row clustering is not a universal improvement but a controlled regularization strategy whose success depends on how much meaningful structure is already present in the rows.

Source: https://www.emergentmind.com/topics/row-clustered-matrix-format