ACM Transactions on Architecture and Code Optimization

What Frontier LLMs Can (and Cannot) Optimize in GPU SpMV: A Three-Layer Analysis of Kernel Tuning, Work Mapping, and Storage Formats

Helin Cheng, Weifeng Liu

Key points

From the paper's conclusion
  • These results support LLM-based kernel tuning and work mapping, with experts leading new storage-format design.

Abstract

Sparse matrix-vector multiplication (SpMV) is a fundamental kernel in scientific computing, sparse linear solvers, graph algorithms, and machine-learning inference. Irregular nonzero distributions make efficient GPU execution difficult. SpMV optimization spans three layers: kernel tuning (L1), which optimizes memory access, intra-warp communication, and instruction execution without changing the row-to-thread assignment; work mapping (L2), which changes the row-to-thread assignment while preserving the sparse representation; and storage format (L3), which changes the data layout and auxiliary indices together with the kernel. LLM-driven GPU kernel optimization has advanced rapidly, including recent work on SpMV, but the optimization layers responsible for these gains remain insufficiently characterized. We use a three-layer experimental and analytical framework with eight controlled experiments, open and directed prompts, starting points from simple CSR to mature SpMV methods, and source analysis on 22 SuiteSparse matrices. We evaluate GPT-5.6 Sol and Terra, GPT-5.5, Claude Opus 5 and Sonnet 5, Claude Opus 4.7, and DeepSeek V4 Pro and Flash on a consumer RTX 5090 and a data-center A100. We also compare independent generations, NCU information in prompts, model configurations, and model versions. At the kernel-tuning and work-mapping layers, generated code reaches or modestly exceeds canonical human implementations, and the best results can approach mature storage-format references. At the storage-format layer, even when explicitly asked to design a new format, the analyzed implementations mainly reproduce or combine known techniques rather than introduce a new format core. The additional comparisons change individual implementations and performance, but do not consistently move models to a higher layer. These results support LLM-based kernel tuning and work mapping, with experts leading new storage-format design.

Read the paper

Discussion

Science Skim's AI key points, plus readers' public thoughts

Readers' thoughts

No reader thoughts yet.

Related papers