FlashSketch: Sketch-Kernel Co-Design for Fast Sparse Sketching on GPUs
Rajat Vadiraj Dwaraknath, Sungyoon Kim, Mert Pilanci
Overview
This talk introduces FlashSketch, a novel sketch-kernel co-design framework engineered to accelerate sparse randomized sketching on Graphical Processing Units (GPUs). Presented at ICML by Sungyoon Kim on behalf of co-authors Rajat Vadiraj Dwaraknath and Mert Pilanci, the work addresses a fundamental bottleneck in modern large-scale machine learning: accelerating heavy linear algebra tasks and gradient compression workflows without sacrificing mathematical guarantees. Randomized sketching reduces massive computational matrices into smaller, manageable sizes, but standard sparse distributions suffer catastrophically on parallel hardware due to irregular memory access patterns and global atomic contention.

Key moments
- 0:00 Introduction and crash course on randomized sketching
- 2:00 GPU bottleneck analysis of existing SJLT kernels
- 3:30 Proposed block-perm SJLT distribution and mixing knob kappa
- 5:00 Application to efficient data attribution and GRASS pipeline
- 6:00 Conclusion and future research directions
- 6:28 Audience Q and A on tuning kappa and theory tightness
FlashSketch: Sketch-Kernel Co-Design for Fast Sparse Sketching on GPUs
Speakers: Rajat Vadiraj Dwaraknath; Sungyoon Kim; Mert Pilanci
Conference: ICML
YouTube: https://slideslive.com/39083761
Overview
This talk introduces FlashSketch, a novel sketch-kernel co-design framework engineered to accelerate sparse randomized sketching on Graphical Processing Units (GPUs). Presented at ICML by Sungyoon Kim on behalf of co-authors Rajat Vadiraj Dwaraknath and Mert Pilanci, the work addresses a fundamental bottleneck in modern large-scale machine learning: accelerating heavy linear algebra tasks and gradient compression workflows without sacrificing mathematical guarantees. Randomized sketching reduces massive computational matrices into smaller, manageable sizes, but standard sparse distributions suffer catastrophically on parallel hardware due to irregular memory access patterns and global atomic contention.
The core innovation of FlashSketch lies in optimizing the random matrix distribution and the hardware GPU kernel simultaneously. By introducing a block-permuted sparse sketching distribution parameterized by a structural control knob, the authors bridge the gap between theoretical statistical mixing and GPU memory locality. This article provides a comprehensive examination of the theoretical foundations, systems architecture, experimental validations, and practical implications of FlashSketch for machine learning practitioners and infrastructure teams.
Background
▶ Watch: Introduction and crash course on randomized sketching (0:00)
Randomized sketching is a foundational technique in randomized linear algebra and scalable machine learning. The primary objective is to transform a large computational task—such as an $n \times d$ matrix least-squares problem minimizing $\|Ax - b\|^2$—into a smaller $m \times d$ problem ($m \ll n$) by multiplying it with a random sketch matrix $S \in \mathbb{R}^{m \times n}$. To ensure that the solution of the sketched problem closely approximates the optimal solution of the original problem, $S$ must satisfy the oblivious subspace embedding (OSE) property. Formally, an OSE guarantees that for all vectors $x$ in a given subspace $U$, the random projection approximately preserves the Euclidean norm: $\|Sx\|_2 \approx \|x\|_2$ with high probability.
Historically, various random matrix distributions have been proposed to achieve this, including Gaussian matrices, Subsampled Randomized Hadamard Transforms (SRHT), and Sparse Johnson-Lindenstrauss Transforms (SJLT). Among these, SJLT achieves the lowest theoretical floating-point operation (FLOP) cost because each column contains only $k$ non-zero signed entries normalized by $1/\sqrt{k}$.
However, applying SJLT on modern GPU architectures exposes severe systems-level bottlenecks. Because SJLT distributes non-zeros randomly across columns, mapping rows of the input matrix $A$ to the sketched matrix $SA$ results in completely random memory access patterns that GPUs cannot cache or vectorize efficiently. Furthermore, multiple rows of $A$ frequently target the same output row in $SA$. This collision forces hardware threads to serialize via global atomic addition instructions (atomicAdd), creating severe serialization bottlenecks in global memory. Prior attempts to implement SJLT kernels on GPUs have consistently hit this wall, forcing researchers to choose between statistical rigor (pure SJLT) and hardware efficiency.
Key Findings
▶ Watch: Proposed block-perm SJLT distribution and mixing knob kappa (3:30)
FlashSketch resolves the tension between statistical quality and hardware execution speed through a co-designed random matrix distribution and GPU kernel. The primary findings and contributions of the work include:
- Elimination of Global Atomic Contention: By restructuring the sparse sketching distribution into block-diagonal and block-permuted patterns, FlashSketch restricts data interactions to localized GPU shared memory, avoiding costly global atomic operations.
- The $\kappa$ Control Knob: The introduction of a permutation parameter, $\kappa$, provides a tunable trade-off between statistical mixing quality (OSE tightness) and memory locality.
- State-of-the-Art Compression Speed: In demanding real-world workloads such as GRASS-based data attribution pipelines, FlashSketch compresses model gradients significantly faster than classical dense or sparse sketch matrices while retaining competitive downstream accuracy.
- Theoretical OSE Guarantees: The authors prove that the proposed block-permuted SJLT distribution maintains the oblivious subspace embedding property with high probability, provided that the sketch dimension and $\kappa$ scale adequately with the problem size.
Technical Deep Dive
▶ Watch: Application to efficient data attribution and GRASS pipeline (5:00)
The architectural breakthrough of FlashSketch stems from a paradigm shift: instead of fitting a hardware kernel to an existing random distribution (like SJLT), the distribution itself is redesigned to respect GPU memory hierarchies.
From Naive SJLT to Localized Sketching
In a naive SJLT bipartite graph, rows of matrix $A$ connect to rows of $SA$ through completely random edges. Localized sketching addresses this by partitioning $A$ into $m$ distinct vertical blocks, where each block of $A$ contributes exclusively to a corresponding block of $SA$. While this guarantees that GPU tiles of $SA$ depend only on matching tiles of $A$—allowing threads to use fast on-chip shared memory for atomic writes instead of global memory—it severely restricts randomness and statistical mixing.
Block-Permuted SJLT Architecture
To recover statistical performance without sacrificing hardware efficiency, FlashSketch introduces block-permuted SJLT, governed by four core parameters:
- $m$: The grid resolution, defining an $m \times m$ block configuration.
- $B_R$: The block height, determining the total sketch dimension ($mB_R$).
- $\kappa$: The number of disjoint permutations of $m$, which controls the degree of statistical mixing.
- $k$: The SJLT order, representing the number of non-zero entries per column within each block.
The matrix is constructed by sampling $\kappa$ distinct random permutations ($\pi_1, \pi_2, \dots, \pi_\kappa$). Each permutation dictates a localized sketching pass, and the $\kappa$ localized sketches are merged into a single comprehensive sketch. When $\kappa = 1$, the scheme reduces to pure localized sketching. As $\kappa$ increases toward $m$, rows mix more thoroughly across blocks. When $\kappa = m$, the distribution approaches classical SJLT.
GPU Kernel Optimization
The accompanying custom GPU kernel exploits this block-permuted structure. By organizing thread blocks to load tiles into shared memory matching the block dimensions ($B_R \times m$), memory reads coalesce naturally along contiguous tensor dimensions. Write collisions are restricted to shared memory buffers during local reduction phases, reducing global memory traffic and bypassing the serialization penalty of global atomicAdd instructions.
Experimental Setup & Results
▶ Watch: Conclusion and future research directions (6:00)
To validate the efficiency and efficacy of FlashSketch, the authors evaluate the framework on large-scale machine learning systems tasks, most notably data attribution. Data attribution aims to quantify the exact influence of individual training points on model predictions by computing dot products between training and test gradient vectors.
In the GRASS data attribution pipeline, millions of high-dimensional gradients must be sparsified and sketched efficiently.
- Baselines: The evaluation compares FlashSketch against classical sketch distributions (Gaussian, SRHT, standard SJLT) and existing GPU SJLT kernel implementations.
- Throughput Metrics: Measured in time per item compressed (seconds/items), FlashSketch achieves superior throughput compared to all baseline sparse sketching methods.
- Downstream Quality: Despite enforcing structural constraints on the random projections via the $\kappa$ parameter, FlashSketch maintains competitive attribution accuracy. In practice, the authors note that small values of $\kappa$ (e.g., $\kappa \in \{1, 2, 4\}$) yield exceptional empirical performance, outperforming conservative theoretical bounds. The authors observe that while theoretical OSE proofs require sufficiently large $\kappa$, empirical performance remains robust even at low configurations due to the inherent over-parameterization resilience of sparse sketches.
Practical Implications
▶ Watch: Audience Q and A on tuning kappa and theory tightness (6:28)
For infrastructure teams, ML platform engineers, and model deployers, FlashSketch represents a major step forward in operationalizing randomized numerical linear algebra on modern accelerators.
- Overcoming Hardware-Algorithm Mismatches: Many advanced randomized algorithms (like sketching, random feature expansions, and streaming matrix approximations) exhibit poor arithmetic intensity or irregular memory access when naively ported to GPUs. FlashSketch demonstrates that co-designing the random distribution with the execution kernel is a viable blueprint for resolving hardware friction.
- Scalable Gradient Compression: As model sizes and training set sizes scale into the billions of parameters, calculating exact influence functions, Fisher information matrices, or second-order optimization steps becomes intractable. Fast sparse sketching via FlashSketch makes real-time gradient attribution and memory-efficient fine-tuning practical.
- Tradeoffs and Limitations: Practitioners must carefully tune $\kappa$. Setting $\kappa$ too low risks under-mixing, which can degrade the OSE quality for ill-conditioned matrices, whereas setting $\kappa$ too high increases cross-block memory synchronization overhead. Furthermore, while the current theory assumes completely random permutations, practical implementations often utilize structured or pseudorandom permutations to maximize hardware utilization, presenting an opportunity for tighter future theoretical bounds.
Key Takeaways
- Co-Design Paradigm: FlashSketch proves that co-optimizing random matrix distributions alongside GPU kernel memory hierarchies unlocks performance unattainable by optimizing software alone.
- Mitigating Global Contention: Restricting sparse matrix non-zeros into block-permuted patterns confines write collisions to fast on-chip shared memory, eliminating global
atomicAddbottlenecks. - The $\kappa$ Parameter: The mixing parameter $\kappa$ provides a practical, tunable control knob balancing statistical OSE guarantees against GPU execution locality.
- Real-World Impact: FlashSketch accelerates demanding pipelines like GRASS data attribution, achieving faster compression per item with competitive downstream task accuracy.
- Robust Empirical Performance: Practical deployments show that low settings for $\kappa$ (such as 1, 2, or 4) deliver excellent empirical results, suggesting that current theoretical bounds for sparse sketches can be further tightened.
About the Speaker(s)
- Rajat Vadiraj Dwaraknath: First author of the FlashSketch paper; did not attend the conference talk.
- Sungyoon Kim: Presenting the FlashSketch talk on behalf of the first author Rajat.
Co-authors: Mert Pilanci.
Reviews
→ Top-rated talks at International Conference on Machine Learning 2026
All talks from International Conference on Machine Learning 2026