arXiv:2610.36822cs.DCOct 2026

Manuscript Offprint

arXiv:2610.36822

Taming Multi-Dimensional Skew in Sparse Matrix Multiplication with Contention-Aware Scheduling [Technical Report]

Wentao Huang, Qiming Huang, Yunhong Ji, Mian Lu, Yuqiang Chen, Bingsheng He, Kian-Lee Tan

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Wentao Huang

National University of

Singapore

huangwentao@u.nus.edu

Qiming Huang

National University of

Singapore

huang_qiming@u.nus.edu

Yunhong Ji

Renmin University of

China

jiyunhong@ruc.edu.cn

Mian Lu

Phancy Group Co., Ltd.

lumian@4paradigm.com

Yuqiang Chen

Phancy Group Co., Ltd.

chenyuqiang@4paradigm.com

Bingsheng He

National University of

Singapore

dcsheb@nus.edu.sg

Kian-Lee Tan

National University of

Singapore

dcstankl@nus.edu.sg

ABSTRACT

Sparse general matrix-matrix multiplication (SpGEMM) is a key kernel in graph analytics, relational queries, and machine learning. Yet, its performance remains a significant challenge, due to the inherent sparsity and, more critically, the prevalent skew patterns often found in real-world workloads. This paper investigates this problem and demonstrates that an unbalanced workload distribution is the main culprit, harming performance through two co-existing root causes: first, multi-dimensional skew, where imbalance across computation cost, output density, and data locality cannot be captured by any single balancing metric; and second, cache contention, where dense substructures induce severe on-chip interference.

To that end, we propose adaptive morsel scheduling (AMS), a dynamic scheduling framework that decouples skew dimensions via fixed-result-size morsels and integrates contention-aware load balancing (CALB) and data-conscious simultaneous multithreading activator (SMTact) to alleviate cache-level contention, alongside a hybrid accumulation mechanism (HYB) that adaptively selects the best accumulator per morsel. Evaluations across matrix squaring, relational queries, graph analytics, and other sparse matrix kernels show that AMS significantly outperforms state-of-the-art methods on skewed workloads while maintaining comparable performance on non-skewed ones. These gains, along with improved bandwidth utilization, remain valid across a wide range of workloads and hardware systems.

PVLDB Reference Format:

Wentao Huang, Qiming Huang, Yunhong Ji, Mian Lu, Yuqiang Chen, Bingsheng He, and Kian-Lee Tan. Taming Multi-Dimensional Skew in Sparse Matrix Multiplication with Contention-Aware Scheduling [Technical Report]. PVLDB, 20(3): XXX-XXX, 2026. doi:XX.XX/XXX.XX

PVLDB Artifact Availability:

This work is licensed under the Creative Commons BY-NC-ND 4.0 International License. Visit https://creativecommons.org/licenses/by-nc-nd/4.0/ to view a copy of this license. For any use beyond those covered by this license, obtain permission by emailing info@vldb.org. Copyright is held by the owner/author(s). Publication rights licensed to the VLDB Endowment.

Proceedings of the VLDB Endowment, Vol. 20, No. 3 ISSN 2150-8097. doi:XX.XX/XXX.XX

The source code, data, and/or other artifacts have been made available at https://github.com/fukien/contention-aware-spgemm.

1 INTRODUCTION

Matrix multiplication is a fundamental computational kernel, and its sparse variant, sparse general matrix-matrix multiplication (SpGEMM), is especially important in practice. The reason is that sparse matrices are a natural model for real-world graph data, which makes SpGEMM a core building block for applications such as graph analytics, entity resolution, and machine learning [38, 61, 76, 79, 87, 103, 126]. Recently, SpGEMM has emerged as a transformative method for processing relational join-aggregate and join-project queries [31, 51–53, 58, 67, 100–102]. By treating relational tables as algebraic sparse matrices, entire query pipelines can be executed as unified algebraic operations. This enables aggregation or projection to be performed on-the-fly alongside the join, effectively bypassing the prohibitive costs of materializing excessive intermediate results (see Figure 1 for a comparison). In all such cases, the performance of the application is dictated by the efficiency of the underlying parallel SpGEMM execution. Reflecting its critical role, numerous studies have investigated SpGEMM optimization, reaching a broad consensus that it is a fundamentally bandwidth-intensive kernel where throughput is ultimately governed by available memory bandwidth [45, 84].

Though it is bandwidth-bound, running SpGEMM on a high-bandwidth platform does not necessarily translate to higher throughput 1^{1}. This is primarily attributed to the load imbalance caused by the widely observed skew patterns in real-world workloads [13, 27, 66, 72, 94, 112, 125]. For instance, in a typical OLAP ClickHouse benchmark [96], the top 5% of users generate 24.4% (47.8 million) of all clicks, while the median number of clicks per user is only 2. Similarly, in a common PageRank workload [53, 118], the top 1.8% of pages receive more incoming links than the remaining 98.2% combined. From a matrix perspective, such skewed key frequencies and power-law graph degrees translate into highly irregular nonzero structures, resulting in significant load imbalance. When running SpGEMM on these workloads, a small subset of cores becomes overloaded while others remain underutilized [38, 45, 84]. This not only limits compute efficiency but also prevents full utilization of

1^{1}While SpGEMM above a certain density threshold can be compute-limited, the growing compute-bandwidth gap [41, 74, 91, 108] makes compute progressively less likely than bandwidth to be the primary bottleneck.

Relational View: Join-then-Aggregate

RS
xyuzyvxzf(u,v)
x0x_0y0y_0u0u_0z0z_0y0y_0v0v_0x0x_0z0z_0f(u0,v0)f(u_0,v_0)
x1x_1y1y_1u1u_1⋈\bowtiez1z_1y2y_2v1v_1→\rightarrowx1x_1z2z_2f(u1,v2)f(u_1,v_2)
x2x_2y2y_2u2u_2z2z_2y1y_1v2v_2x2x_2z1z_1f(u2,v1)f(u_2,v_1)
x0x_0y3y_3u3u_3z0z_0y3y_3v3v_3x0x_0z0z_0f(u3,v3)f(u_3,v_3)
xzΣf(u,v)\Sigma f(u,v)
x0x_0z0z_0Σf0,3(u,v)\Sigma f_{0,3}(u,v)
x1x_1z2z_2f(u1,v2)f(u_1,v_2)
x2x_2z1z_1f(u2,v1)f(u_2,v_1)

Algebraic View: Matrix Multiplication

Figure

Figure 1: Comparing two approaches for evaluating a join-aggregate query, “SELECT x, z, SUM(f(u,v)) FROM R, S WHERE R.y = S.y GROUP BY x, z”, where f denotes a mathematical function. The “relational view” (top) joins tables R(x,y,u)R(x, y, u) and S(z,y,v)S(z, y, v) on attribute y followed by an aggregation, a process that produces excessive intermediate results, such as (x0,z0,f(u0,v0))(x_{0}, z_{0}, f(u_{0}, v_{0})) and (x0,z0,f(u3,v3))(x_{0}, z_{0}, f(u_{3}, v_{3})) , which are ultimately aggregated into one final group-by result (shaded in light pink). The “algebraic view” (bottom) models the operation as a matrix product MR×MSM_{R} \times M_{S} where y serves as the shared dimension to compute the aggregate result directly, bypassing the materialization of costly intermediate results.

the available memory bandwidth, leaving system resources idle, and therefore, rendering high-bandwidth platforms less effective.

Moreover, the challenge of addressing load imbalance in skewed workloads is particularly critical and is further exacerbated by the “memory scaling wall,” where memory technology advancements lag behind those of processing units [91, 108]. This trend results in decreasing memory bandwidth and capacity per processing core [57, 116], which further compounds the load imbalance problem for two reasons:

First, decreasing bandwidth-per-core has an acutely negative impact on SpGEMM workloads with load imbalance, where a few straggling threads drag down performance. Since these threads largely rely on core-level bandwidth, their overall performance is inevitably reduced due to the insufficient bandwidth-per-core caused by the “memory scaling wall.”

Second, the prevalent approach to compensating for decreasing bandwidth-per-core, namely the adoption of heterogeneous memory expansion technologies like CXL [56, 71, 116, 117], can inadvertently amplify this problem. Since CXL-attached memory typically exhibits higher access latency than local DRAM 2^{2}, straggling threads that run disproportionately long are more exposed to CXL's latency penalty, further widening the gap between fast and slow threads. Figure 2 illustrates this using a hashing-based SpGEMM algorithm [84] on a skewed workload, where per-thread runtimes vary due to load imbalance. 3^{3} Because total runtime is governed by the slowest thread, the disproportionate latency on stragglers negates the aggregate bandwidth gain, yielding worse overall performance than pure DRAM. This counterintuitive result is also reported in existing CXL studies [77, 78, 104, 107]. As a result, addressing load imbalance is becoming more imperative than ever.

Figure

Figure 2: Comparison of per-thread elapsed time for hashing-based SpGEMM [84] on a G500 skewed matrix (scale=17, edge-factor=16) [22] between a conventional main-memory system (28.50 GB/s bandwidth) and a CXL-augmented system (46.50 GB/s bandwidth) (see § 4 for experimental setups).

However, addressing load imbalance in SpGEMM is not trivial. While numerous strategies have been proposed [38, 45, 88], we maintain that existing approaches fall short due to two co-existing root causes: multi-dimensional skew and cache contention, both of which not only hinder load balancing but also degrade overall performance.

First, existing methods fail to accommodate the multi-dimensional skew inherent in sparse matrices. Current methods rely on static schemes that balance along a single metric (e.g., flop count) to minimize scheduling overhead. However, skew manifests across multiple dimensions, including computation cost, materialization overhead, and data locality, making it impossible for any single static metric to achieve balanced execution across all threads.

Second, in skewed workloads, existing approaches suffer from significant cache contention, induced by dense substructures that are co-scheduled together. In SpGEMM, irregular sparsity forces practitioners to cache row-wise intermediates to reduce random access costs. However, dense substructures within skewed matrices incur excessive irregular random entry access, which creates heavy cache pressure and even induces significant cache contention, which has long been overlooked as a key performance factor. This cache contention is particularly pronounced under simultaneous multithreading (SMT), which aims to increase computation parallelism but worsens the interference.

In this paper, we address these challenges through a novel approach, adaptive morsel scheduling (AMS). In contrast to de facto methods, AMS revisits dynamic scheduling, a strategy conducive to load balancing that is often dismissed due to concerns regarding scheduling overhead and poor performance [45, 84]. Through analysis (§ 2.3), we find that task granularity is the primary performance factor: a granularity that is too fine fails to preserve spatial locality and therefore suffers from excessive cache thrashing. Hence,

2^{2} Since DRAM is the primary technology used in memory manufacturing, we use the terms “DRAM” and “memory” interchangeably throughout this paper.

3^{3} We use the following notation for R-MAT graphs [22]: ER, SSCA, and G500 denote non-skewed Erdős–Rényi, skewed SSCA, and highly skewed Graph500 graphs, respectively; scale sets the number of rows to 2scale2^{scale} , and edgefactor sets the average nonzeros per row.

we employ a morsel-wise dynamic scheduling strategy, where a “morsel” 4^{4} is defined as a basic scheduling unit of several consecutive matrix rows. AMS ensures a morsel is large enough to maintain spatial locality, thereby greatly mitigating cache thrashing, and more importantly achieves load balance on skewed workloads through dynamic scheduling, effectively preventing computational idling and improving memory bandwidth utilization.

To alleviate cache contention, AMS introduces two lightweight and generalizable techniques: contention-aware load balancing (CALB), which mitigates cache interference by adaptively scheduling dense morsels, and data-conscious simultaneous multithreading activator (SMTact), which selectively enables SMT based on workload contention. These optimizations are simple in design, yet effective in practice, and easy to generalize to other sparse matrix kernels (e.g., SpMM and SpMV). Importantly, their performance benefits remain effective across heterogeneous bandwidth-boosted systems (e.g., CXL systems), ensuring that latency heterogeneity does not cause performance degradation.

Furthermore, the morsel-wise scheduling strategy enables a hybrid accumulation mechanism (HYB) for SpGEMM, where different accumulation algorithms can be selectively applied to morsels based on their intrinsic characteristics, thereby achieving more efficient execution and enhanced overall SpGEMM performance.

The contributions of this paper are summarized as follows:

(1) We examine and characterize two co-existing root causes of performance degradation in skewed SpGEMM workloads: multidimensional skew, where no single static metric can balance all threads, and cache contention, where dense substructures induce severe on-chip interference that existing methods overlook.

(2) We develop a novel morsel-wise dynamic scheduling framework, adaptive morsel scheduling (AMS), that systematically addresses both multi-dimensional skew and cache contention in SpGEMM. AMS decouples skew dimensions through fixed-result-size morsels, integrates two key techniques, contention-aware load balancing (CALB) and data-conscious simultaneous multithreading activator (SMTact), to alleviate on-chip cache interference, and enables hybrid accumulation mechanism (HYB) for morsel-wise accumulation adaptively. Our approach is straightforward in design, yet novel and generalizable, and effective in practice.

(3) We evaluate AMS across a wide range of workloads, including matrix squaring, relational join-aggregate and join-project queries, graph analytics, and other sparse kernels, on both a main-memory and a CXL-augmented system, and show that it performs on par with state-of-the-art methods on non-skewed workloads while significantly outperforming them on skewed ones, addressing both computational idling and bandwidth underuse.

The rest of the paper is organized as follows. We first present the background and motivation in § 2, followed by a description of AMS in § 3. We then show the experimental results in § 4 and discuss related work in § 5. Finally, we conclude the paper in § 6.

Algorithm 1 Parallel Gustavson's Algorithm for SpGEMM

1: Input: CSR matrices A∈Rm×kA \in \mathbb{R}^{m \times k} and B∈Rk×nB \in \mathbb{R}^{k \times n} 2: Output: CSR matrix C∈Rm×nC \in \mathbb{R}^{m \times n} 3: parallel for i←0i \leftarrow 0 to m−1m - 1 do ▹\triangleright Parallel over rows of A 4: Initialize empty accumulator for row i 5: for all (k,Aik)∈row i(k, A_{ik}) \in \text{row } i of A do 6: for all (j,Bkj)∈row k(j, B_{kj}) \in \text{row } k of B do 7: if j∈accumulatorj \in \text{accumulator} then 8: accumulator[j] += Aik⋅BkjA_{ik} \cdot B_{kj} 9: else 10: accumulator[j] ←Aik⋅Bkj\leftarrow A_{ik} \cdot B_{kj} 11: end if 12: end for 13: end for 14: Store accumulator as row i of C 15: end parallel for