Do We Need Tensor Cores for Stencil Computations?

Qiqi Gu, Chenpeng Wu, Heng Shi, Jianguo Yao, Haibing GuanarXiv 2026

TL;DR

This paper resolves a long-standing paradox in high-performance computing: why compute-centric Tensor Cores can significantly accelerate stencil computations, which are traditionally considered strictly memory-bound. By introducing an enhanced roofline performance model that accounts for algorithmic overheads like zero-padding and kernel fusion, the authors map out the exact "sweet spot" where Tensor Cores—and especially Sparse Tensor Cores—break through traditional performance ceilings.

What Problem Does This Paper Address?

Stencil computations are the bread and butter of scientific simulations, powering everything from weather forecasting to computational fluid dynamics. In a stencil operation, every point in a data grid is updated using a weighted sum of its spatial neighbors.

Because these operations require fetching a lot of data from memory relative to the few arithmetic operations performed, they have historically been classified as memory-bound. Conventional wisdom dictates that running stencils on hardware designed for massive matrix math, like NVIDIA's Tensor Cores, is pointless; you increase compute capacity without increasing memory bandwidth, leaving the hardware starved for data.

However, recent cutting-edge implementations (like ConvStencil and SPIDER) have achieved massive speedups using Tensor Cores, directly contradicting this assumption. This paper tackles the core question behind this paradox: How and when do Tensor Cores actually benefit stencil computations, and what is the underlying mechanism defying the memory wall?

Figure 1: Stencil Computation Pattern.

Methods

The authors approach this by systematically analyzing the architectural mismatches between stencils and Tensor Cores, focusing on two main types of algorithmic overhead introduced when transforming stencils into matrix operations:

  1. Sparse Redundancy ($S$): Mapping a localized stencil onto fixed-size Tensor Core matrix tiles requires zero-padding, which introduces wasted, redundant operations.
  2. Fusion Redundancy ($\alpha$): To mitigate padding overhead, developers use "kernel fusion" to aggregate multiple time steps into a single monolithic matrix operation. However, this prevents the reuse of intermediate values, inflating the total number of operations.

The core contribution of the paper is an enhanced roofline model that integrates these overhead factors into the traditional roofline framework. By analyzing the interplay between arithmetic intensity and hardware limits, they categorize the execution space into four distinct scenarios to mathematically define the "sweet spot" where Tensor Core acceleration becomes profitable.

Datasets

The model was evaluated using synthetic but highly representative stencil workloads modeled after real-world scientific applications. The benchmarks included:

  • Dimensions & Shapes: 2D domains ($10240 \times 10240$) and 3D domains ($1024 \times 1024 \times 1024$) utilizing both Box and Star configurations.
  • Radii & Fusion Depths: Stencil radii ($r$) ranging from 1 to 7, and temporal fusion depths ($t$) from 1 to 8.
  • Baselines: State-of-the-art stencil frameworks including cuDNN, DRStencil, and EBISU (for standard CUDA Cores), alongside ConvStencil and SPIDER (for Tensor Cores).

Key Insights and Ideas

  • Stencils are NOT inherently memory-bound: While naive stencils are limited by memory bandwidth, modern optimization techniques like aggressive temporal fusion drastically increase their arithmetic intensity. This shifts optimized stencils into a compute-bound regime where standard CUDA cores saturate.
  • The Throughput Trade-off: Tensor Cores introduce massive computational redundancy (doing extra math on zeros), but their raw compute throughput is so high that they can easily absorb this penalty and still finish faster than CUDA cores—provided the baseline workload is already compute-bound.
  • Sparse Tensor Cores are the Ultimate Enabler: NVIDIA’s Sparse Tensor Cores natively support 2:4 structured sparsity, allowing the hardware to skip operations on zero-padded elements. This effectively eliminates the "sparse redundancy" penalty, drastically expanding the profitable design space for Tensor Core acceleration.

Key Results

The authors validated their analytical model against empirical data profiled on an NVIDIA A100 GPU:

  • Model Accuracy: The predicted computational operations ($C$), memory traffic ($M$), and arithmetic intensity ($I$) closely matched actual hardware profiler metrics from NVIDIA Nsight Compute.
  • Breaking the Ceiling: In compute-bound scenarios (such as a Box-2D1R stencil with a fusion depth of 7), the Sparse Tensor Core implementation (SPIDER) achieved 7.73× and 6.64× speedups over the highly optimized CUDA core baseline (EBISU).
  • Sparse vs. Dense: Utilizing Sparse Tensor Cores provided a 3.06× performance boost over dense Tensor Core variants by successfully amortizing the zero-padding overhead.
Figure 2: Performance Comparison between CUDA Core and Tensor Core Implementations.

Limitations and Future Work

While the performance model proved highly accurate, the authors noted minor, systematic deviations from empirical results due to hardware complexities omitted for simplicity:

  • Halo Region Overlaps: The model excludes the redundant calculations and memory accesses caused by overlapping halo regions between adjacent thread blocks.
  • Cache Filtering Effects: The model assumes all data transfers originate directly from DRAM, whereas the GPU's L2 cache effectively filters out a portion of off-chip memory traffic in practice.

Future work could involve refining the model to dynamically account for these cache behaviors and multi-level memory hierarchies.

Summary updated

BibTeX
@misc{gu2026do,
  author = {Qiqi Gu and Chenpeng Wu and Heng Shi and Jianguo Yao and Haibing Guan},
  title = {{Do We Need Tensor Cores for Stencil Computations?}},
  year = {2026},
  eprint = {2603.00477},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2603.00477},
}
Figure