Manuscript Offprint
arXiv:2610.18382PrismStencil: Transforming Stencil Computations into Matrix Multiplications
Xianmeng Jiang
Institute of Computing Technology
Haidian Qu, Beijing Shi, China
Yuan Liang
Institute of Computing Technology
Haidian Qu, Beijing Shi, China
Zixuan Wang
Institute of Computing Technology
Haidian Qu, Beijing Shi, China
Kun Li
Tsinghua University
Haidian Qu, Beijing Shi, China
Abstract
Stencil computations are a fundamental class of workloads in scientific and engineering applications. Although Tensor Cores offer new opportunities for stencil acceleration, existing tensorization methods suffer from substantial redundant computation and insufficient data reuse. We propose PrismStencil, a stencil tensorization algorithm that introduces a novel mapping scheme between matrices and stencil grid points. PrismStencil employs multidimensional vector mapping to accommodate the multidimensional data dependencies of stencil computations and a unified gather–scatter tensorization scheme to exploit the relative sizes of the matrix dimensions in Tensor Core operations, thereby reducing the redundant computation introduced by tensorization. Moreover, it introduces a cross-product data-reuse mechanism that exploits the overlap among neighboring stencil updates to further enhance data reuse. Across representative stencil kernels on an NVIDIA A100 GPU, PrismStencil achieves average speedups of 2.13x and 2.17x over state-of-the-art Tensor Core stencil methods with FP64 and TF32 precision, respectively.
CCS Concepts
• Computing methodologies → Parallel algorithms.
1 Introduction
Stencil computation is one of the thirteen Berkeley motifs and represents a common class of nested-loop computations in scientific and engineering applications, dynamic programming, and image processing [1, 6, 12, 25, 33]. A stencil computation operates on data arranged on a regular spatial grid with one or more dimensions and proceeds through a sequence of time steps. At each time step, every grid point is updated using the values of a fixed set of nearby grid points from the previous time step.
A substantial body of work has been devoted to optimizing stencil computations, primarily through tiling [3, 7, 8, 24, 41] and vectorization [15, 18, 19, 44]. Tiling changes the traversal order of grid points to improve temporal and spatial locality while exposing coarse-grained parallelism across tiles. Vectorization processes multiple grid-point updates simultaneously using SIMD instructions, exposing fine-grained parallelism and increasing arithmetic throughput.
Yunquan Zhang
Institute of Computing Technology
Haidian Qu, Beijing Shi, China
Tensor Cores offer substantially higher arithmetic throughput than standard SIMD units through their matrix multiply-and-accumulate (MMA) instructions. Although originally designed for machine-learning workloads, they have increasingly been applied to scientific computing, including stencil computations. In particular, recent studies [5, 10, 21, 43] have explored tensorizing stencil computations by organizing the weighted neighbor accumulations for multiple grid-point updates into matrix multiplications.
However, existing methods still fall short of fully exploiting this potential. Prior work [11] has shown that the matrix representations adopted by these Tensor Core stencil methods inevitably contain many zero elements, resulting in substantial redundant computation that offsets the computational advantage of Tensor Cores. Furthermore, the matrix multiplications generated by stencil tensorization are typically small and therefore offer little opportunity for data reuse across MMA instructions through conventional matrix-multiplication blocking. Consequently, the available memory bandwidth is insufficient to keep Tensor Cores fully utilized.
To address these limitations, we propose PrismStencil, a stencil tensorization algorithm that introduces a novel mapping scheme between matrices and stencil grid points. Unlike existing methods that impose a fixed correspondence between matrix-multiplication dimensions and spatial grid structures, PrismStencil maps each matrix-multiplication dimension across multiple spatial dimensions to better accommodate the multidimensional data dependencies of stencil computations, thereby constructing denser matrix representations. PrismStencil also extends the tensorized computation mode to better exploit the relative sizes of the dimensions of an MMA instruction when organizing the stencil grid points involved in each matrix multiplication, further reducing the redundant computation introduced by tensorization.
Beyond the data reuse inherent in matrix multiplication itself, PrismStencil exploits the inherent overlap among neighboring stencil updates to expose additional reuse across matrix rows. It further reorders data carefully across the matrix dimensions while preserving mathematical equivalence, extending such reuse to the granularity defined by MMA instruction shapes. Together, these optimizations reduce repeated data movement and alleviate the memory-bandwidth bottleneck of tensorized stencil computation.
The main contributions of this work are as follows:
-
We propose a multidimensional vector mapping and a unified gather–scatter tensorization scheme that better accommodate the multidimensional structure of stencil computations and the dimensions of MMA instructions, substantially reducing the redundant computation introduced by tensorization.
-
We develop a cross-product data-reuse mechanism that exploits the inherent overlap among neighboring stencil updates and enables data reuse at the granularity of MMA instruction shapes, thereby reducing repeated data movement.
-
We implement PrismStencil for a diverse set of stencil kernels. Compared with state-of-the-art Tensor Core stencil methods, PrismStencil achieves average speedups of and for FP64 and TF32 computations, respectively.
2.1 Stencils
Stencil computations operate on a -dimensional regular grid, where each grid point is iteratively updated based on a fixed neighborhood pattern bounded by stencil radius , which specifies the maximum neighbor distance along each dimension. Two common stencil patterns are star-shaped stencils, which access only axis-aligned neighbors, and box-shaped stencils, which access all neighbors within a hypercube of edge length in dimensions, centered at the current grid point. Algorithm 1 illustrates a two-dimensional box-shaped stencil, where denotes the value at grid point at iteration . For each time step, we denote the input and output grid-point values by and , respectively, so that the update can be written as .
Algorithm 1: 2D Box Jacobi Stencil
1 for to T do 2 for to NY do 3 for to NX do 4 5 end 6 end 7 end
2.2 Tensor Core
Tensor Cores are specialized hardware units that accelerate matrix operations through matrix multiply-and-accumulate (MMA) instructions. An MMA operation computes the product of two input matrices and accumulates the result into an output matrix:
The matrix tiles involved in an MMA instruction, such as A, B, C, and D, are commonly referred to as fragments. The hardware-supported MMA shapes, denoted by , are limited. For NVIDIA A100 GPUs, FP64 MMA supports only the shape, while TF32 MMA supports the and shapes [27].
3 Challenge
3.1 Computational Inflation
Stencil computations and MMA operations exhibit a natural mismatch in their computation patterns. Therefore, using Tensor Cores to accelerate stencil computations often introduces redundant arithmetic. To quantify this overhead, we define the computational inflation factor as the ratio of the floating-point operation count after tensorization to the intrinsic operation count of the stencil kernel.
Prior tensorization approaches can be classified into two categories according to their computation patterns. The first category [10, 21, 43] decomposes a high-dimensional stencil kernel into a sum of multiple one-dimensional stencil kernels, tensorizes each one-dimensional kernel separately, and accumulates the partial results. For example, for a two-dimensional box-shaped stencil, these approaches compute a output grid-point matrix in steps. Each step corresponds to a one-dimensional stencil kernel with radius , where the input grid-point matrix has size . Since the input and output matrices must be aligned with the MMA fragment shape, the computational inflation factor is
where . The choices of and vary across different approaches. TCStencil [21] only discusses the case of and chooses . LoRAStencil [43] instead chooses and to avoid alignment overhead along the and dimensions. It further exploits symmetric stencil coefficients for optimization. For a fair comparison, however, we do not count the reduction enabled by stencil-kernel symmetry when analyzing the computation cost.
Different from the above approaches, ConvStencil [5] directly tensorizes high-dimensional stencil kernels. Using its dual-tessellation algorithm, ConvStencil computes an output grid-point matrix in two steps. In each step, the input grid-point matrix has size . Therefore, its computational inflation factor is
Table 1 compares the computational inflation factors of these approaches for common two-dimensional stencil kernels under the MMA shape. For TCStencil, the computational inflation factor increases with the stencil radius . This is because its output matrix size, , decreases as the radius grows, leading to increasingly severe alignment overhead. In contrast, the computational inflation factors of LoRAStencil and ConvStencil decrease as increases. For small-radius kernels, these two approaches use kernel fusion [5, 43] to transform them into larger-radius kernels and thereby mitigate computational inflation. However, this transformation also introduces extra computation [11]. For example, transforming three time steps of j2d9pt into one time step of j2d49pt introduces an additional computational inflation factor of . Consequently, after kernel fusion, the computational inflation factors of LoRAStencil and ConvStencil for j2d9pt become 4.16 and 3.85, respectively. Compared with the cases without kernel fusion, these factors are not significantly reduced; for LoRAStencil, the factor even increases. Moreover, even for large-radius kernels, Eq. (2), instantiated with and , and
Eq. (3) show that the computational inflation factors of LoRAS stencil and ConvStencil asymptotically approach 2 as grows. This indicates that substantial redundant computation remains in these prior tensorization schemes.
3.2 Memory Bound
For modern GPUs, the data throughput of Tensor Cores is often much higher than the shared-memory bandwidth. For example, on NVIDIA A100 GPUs, each Streaming Multiprocessor (SM) can issue one TF32 MMA instruction in one cycle on average, whereas loading the corresponding fragments , , and from shared memory requires 2, 1, and 4 cycles, respectively. This imbalance makes data movement from shared memory a critical bottleneck for feeding Tensor Cores.
Conventional matrix multiplication alleviates this bottleneck through register-level blocking, which provides a general form of data reuse by sharing loaded matrix elements across multiple MMA instructions. Such reuse becomes effective when the matrix dimensions , , and are sufficiently large to support substantial blocking. However, as discussed in Section 3.1, the matrix dimensions produced by stencil tensorization are typically comparable to the hardware-supported MMA shape and the stencil radius . Consequently, these matrix multiplications are too small for conventional register-level blocking to provide sufficient data reuse. SPIDER [10] retains the stencil-weight matrix in registers to avoid repeatedly loading the coefficients, but the input and output grid-point data in prior approaches [5, 10, 21, 43] still need to be repeatedly moved through shared memory. This repeated movement prevents Tensor Cores from being fully utilized and makes the overall stencil computation bounded by shared-memory bandwidth.
4 Algorithm
We first clarify the roles of the matrix dimensions. For a stencil computation transformed into a matrix multiplication, let denote the matrix formed by the input grid points, the matrix formed by the stencil-kernel weights, and the matrix formed by the output grid points. The matrix multiplication can be viewed as vector–matrix products executed in parallel. For each vector–matrix product, the input and output vectors correspond to input grid points and output grid points in the stencil grid, respectively. For each input–output grid-point pair, the corresponding entry of is set to the stencil-kernel weight if the two grid points are neighbors under the stencil pattern, and is set to zero otherwise. Therefore, the mapping of the input and output vectors to the stencil grid space determines the nonzero pattern of and directly affects computational inflation. In contrast, the dimension indexes multiple such vector–matrix products. It does not change the nonzero pattern of within each product, but determines how these products are placed in the grid space and thus affects data reuse across vector–matrix products.
PrismStencil redesigns the mapping between matrix dimensions and the stencil grid space according to stencil data dependences. Section 4.1 focuses on the and dimensions and studies how to map the input and output vectors of each vector–matrix product to the stencil grid space, thereby increasing the fraction of effective input–output neighbor pairs and reducing computational inflation. Section 4.2 then considers the dimension and the full matrix multiplication. By arranging vector–matrix products to expose cross-product data reuse, we reduce repeated shared-memory traffic and alleviate the memory-bandwidth bottleneck.

Vector-Matrix Product
| = | = | = | |||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | = | = | = | 0 | 0 | 0 | 0 | ||||||||
| 0 | = | = | = | 0 | 0 | 0 | 0 | ||||||||
| 0 | 0 | = | = | = | 0 | 0 | 0 | 0 | |||||||
| 0 | 0 | 0 | = | = | = | 0 | 0 | 0 | 0 | ||||||
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | = | = | = | 0 | 0 | 0 | ||
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | = | = | = | 0 | 0 | |||
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | = | = | = | 0 | ||||
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | = | = | = |
Figure 1: Comparison between the one-dimensional mapping used in prior work and the multidimensional mapping in PrismStencil. In the upper panel, each input grid point is shaded according to the number of its neighboring grid points in the output vector, with darker colors indicating more neighbors. The lower panel illustrates the corresponding construction of the stencil-weight matrix .
4.1 Tensorized Computation Schemes
4.1.1 Multidimensional Vector Mapping. As in prior tensorization approaches [5, 10, 21, 43], we begin with a vector–matrix product that performs a single time-step update for output grid points. The length- input vector contains the union of the neighboring input grid points required by these outputs.
The computational inflation of this vector–matrix product depends on the neighborhood overlap induced by the output-vector mapping. Larger overlap yields a more compact input-neighbor union and therefore a higher fraction of valid input–output pairs. Prior approaches [5, 10, 21, 43] map the output vector to an elongated one-dimensional region. Under such a mapping, substantial neighborhood sharing occurs only among nearby points along that dimension, while distant points, especially those near opposite endpoints, share few or no neighboring input grid points. This mapping is inefficient for multidimensional stencils, whose data dependences extend across multiple dimensions.
As illustrated in Figure 1, PrismStencil introduces a multidimensional vector mapping that distributes the output vector across multiple stencil dimensions, forming a compact region in the stencil grid space. This mapping allows output grid points to share neighboring input grid points along multiple dimensions, reducing the size of the input-neighbor union and hence the number of redundant input-output pairs.
Formally, we characterize the above output-vector mapping by considering a -dimensional stencil with radius . Suppose the length- output vector is mapped to a multidimensional region that contains output grid points along the -th dimension, where . To update these output grid points, the length- input vector is mapped to the union of their neighboring input grid points, which contains grid points. Since each output grid point has neighbors, the computational inflation factor is given by
where . Here, the alignment accounts for the fixed fragment sizes of MMA instructions: the and dimensions must be padded to multiples of the hardware-supported fragment dimensions and , respectively. For a fixed , the values of should be kept as balanced as possible to minimize , thereby minimizing the computational inflation factor in Eq. (4).
The remaining question is how to choose the length N of the output vector. In practice, we set N = n to match the hardware-supported size of the N dimension. Increasing N weakens the neighborhood overlap within the output vector and increases redundant computation, whereas decreasing N incurs significant hardware-alignment overhead. A smaller N can be preferable only in rare factorization cases. For example, if n = 17 in a 2D stencil, mapping the output vector to a region may be better than mapping it to a region, despite leaving one output position unused. However, hardware-supported MMA dimensions are typically powers of two, so such cases do not arise in the MMA shapes considered in this work.
As shown in Table 1, the multidimensional vector mapping reduces computational inflation by 33.3%, 20.0%, and 23.1% for j2d9pt, j2d25pt, and j2d49pt, respectively, compared with the best-performing prior approach.
4.1.2 Unified Gather–Scatter Tensorization Scheme. The tensorization design described above corresponds to a gather-style scheme for stencil computation. While the gather scheme lets selected output grid points accumulate weighted values from neighboring input grid points, the scatter scheme reverses this direction by letting selected input grid points contribute their weighted values to neighboring output grid points. In prior work [5, 10, 21, 43], the gather computation direction remains implicit, leaving the symmetric scatter-style alternative unexplored. In scalar or vectorized stencil implementations, gather and scatter formulations perform the same amount of computation. In tensorized computation, however, this symmetry no longer holds because the hardware-supported sizes of the K and N dimensions, i.e., k and n, are not necessarily equal, creating additional opportunities to reduce redundant computation.
Relative to the gather-style scheme, a scatter-style scheme can be constructed by symmetrically reversing the computation direction. Specifically, suppose the length-K input vector is mapped to a multidimensional region that contains input grid points along the -th dimension, where . The output vector is then mapped to the union of the neighboring output grid points of these inputs, a set of size . By the same reasoning, we keep the values of as balanced as possible and set to minimize the computational inflation factor. When , the input-vector mapping in the scatter-style scheme covers fewer grid points than the output-vector mapping in the gather-style scheme, causing their neighboring point sets to overlap more extensively and thus reducing computational inflation.
We further generalize the gather and scatter schemes into a unified gather–scatter tensorization scheme. For clarity, assume that the first dimensions follow the gather style, while the remaining dimensions follow the scatter style. Along each gather-style dimension , the output vector spans output grid points. The input vector must therefore cover the corresponding neighboring input range, which contains input grid points, and the number of effective input–output neighbor pairs along this dimension is . Similarly, along each scatter-style dimension , the input vector spans input grid points. The output vector must then cover the corresponding neighboring output range, which contains output grid points, and the number of effective input–output neighbor pairs along this dimension is . Thus, the input and output vectors in the resulting vector–matrix product have lengths and , respectively. The corresponding computational inflation factor is then given by
When , the scheme corresponds to a mixed gather-scatter form. By applying gather and scatter choices along different stencil dimensions, this form makes K and N more balanced, creating opportunities to use smaller values of and while still avoiding excessive alignment overhead. For example, for the j2d49pt kernel with , the gather and scatter schemes map the output or input vector to a region, both resulting in a computational inflation factor of 1.63. In contrast, the mixed scheme can choose and , which keeps both K and N aligned while further increasing the fraction of effective neighbor pairs. As a result, the computational inflation factor is reduced to 1.31. Figure 2 illustrates the computation process under this configuration.
Finally, given a stencil radius and an MMA shape , we use Eq. (5) to select the computation scheme with the lowest computational inflation factor. As shown in Table 1, building on the multidimensional vector mapping, the unified gather–scatter scheme further reduces the computational inflation factor by 33.3%, 16.7%, and 19.6% for j2d9pt, j2d25pt, and j2d49pt, respectively. More importantly, Table 1 shows that our scheme is the first to reduce

Figure 2: A mixed gather–scatter tensorization example for the j2d49pt stencil kernel with and .
Table 1: Theoretical computational inflation factors of different tensorization methods for different stencil kernels under the MMA shape.
| Method | j2d9pt | j2d25pt | j2d49pt |
|---|---|---|---|
| TCStencil [21] | 4.74 | 6.40 | 18.29 |
| LoRAS stencil [43] | 4.00 | 2.40 | 2.29 |
| ConvStencil [5] | 5.33 | 2.98 | 2.12 |
| Our (Section 4.1.1) | 2.67 | 1.92 | 1.63 |
| Our (Section 4.1.2) | 1.78 | 1.60 | 1.31 |
tensorization-induced computational inflation below 2.0 on a practical hardware-supported MMA shape. This indicates that our tensorized algorithm can still provide effective performance benefits over vectorized implementations even on platforms where MMA hardware provides only twice the compute throughput of SIMD hardware.
4.2 Cross-Product Data Reuse
We next consider the dimension and the full matrix multiplication, focusing on data reuse across different vector–matrix products. As illustrated in Figure 3, unlike conventional matrix multiplication, the stencil neighborhood pattern can cause vectors from different matrix rows to overlap in the grid space. Such overlap occurs among input vectors in the gather scheme and among output vectors in the scatter scheme, enabling additional cross-row data reuse.
Similar to multidimensional vector mapping, we distribute the dimension across multiple stencil dimensions to exploit the data reuse enabled by multidimensional stencil dependencies. Let denote the number of adjacent vector–matrix products arranged along the -th dimension, such that . For a gather-style dimension, each vector–matrix product individually requires input grid points along that dimension. However, adjacent products jointly require only input grid points, reducing the amortized number per product to . Similarly, for a scatter-style dimension, arranging adjacent products reduces the amortized number of output grid points written by each product from to . Thus, the amortized numbers of input and output grid points accessed by each vector–matrix product are and , respectively.
At the global-to-shared-memory level, exploiting this data reuse is straightforward. Before computation, we load the complete set of required input grid points from global memory into shared memory, and after computation, we write the corresponding output grid points back to global memory. For MMA instructions, however, data can be reused only at the fragment granularity rather than at the granularity of individual grid points. As illustrated in Figure 3, if the vector–matrix products are mapped to the dimension in lexicographic order and the input and output grid points within each product are likewise mapped to the and dimensions in lexicographic order, the reusable grid points generally do not form identical layouts across the corresponding fragments, preventing direct fragment-level reuse.
PrismStencil addresses this mismatch by reordering the , , and dimensions, as illustrated in Figure 3. These transformations preserve mathematical equivalence because the corresponding rows and columns of the matrices representing input grid points, output grid points, and stencil weights are permuted consistently. In practice, no physical data rearrangement is required; the reordering is realized simply by changing the grid-point coordinates from which each fragment is loaded and to which it is stored.
We first reorder the dimension so that reusable grid points are aligned to the same row position within different fragments whenever possible, where denotes the fragment size along the dimension, i.e., the number of rows in each fragment associated with grid-point data. Consider a vector–matrix product with lexicographic index , where denotes its coordinate among the products along the -th stencil dimension. We map this product to row of the dimension according to
The last two terms interleave the products along the spatially contiguous dimension, indexed by 0, across different fragments: determines the fragment, while determines the intra-fragment row. Consequently, adjacent products along this dimension are placed in the same row of different fragments, prioritizing them for reuse because they share substantially more grid points than nonadjacent products, while the remaining dimensions retain lexicographic ordering through the first term. For simplicity, we restrict to multiples of throughout this work; this restriction is not fundamental but avoids more complicated mappings and implementation logic.
After reordering the dimension, some fragments still cannot be directly reused because of two types of layout mismatch, as

Data Reuse (Grid Level)
Vector-Matrix Products

Original Matrix
Fragment
M
| A | B | C | D | A | B | C | D | A | B | E | F | G | H | E | F | G | H | E | F | 0 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| A | B | C | D | A | B | C | D | A | B | E | F | G | H | E | F | G | H | E | F | 1 |
| A | B | C | D | A | B | C | D | A | B | E | F | G | H | E | F | G | H | E | F | 2 |
| A | B | C | D | A | B | C | D | A | B | E | F | G | H | E | F | G | H | E | F | 3 |
| A | B | C | D | A | B | C | D | A | B | E | F | G | H | E | F | G | H | E | F | 4 |
| A | B | C | D | A | B | C | D | A | B | E | F | G | H | E | F | G | H | E | F | 5 |
| A | B | C | D | A | B | C | D | A | B | E | F | G | H | E | F | G | H | E | F | 6 |
| A | B | C | D | A | B | C | D | A | B | E | F | G | H | E | F | G | H | E | F | 7 |
M-Dimension Permutation
M
| A | B | C | D | A | B | C | D | A | B | E | F | G | H | E | F | G | H | E | F | 0 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| A | B | C | D | A | B | C | D | A | B | E | F | G | H | E | F | G | H | E | F | 4 |
| A | B | C | D | A | B | C | D | A | B | E | F | G | H | E | F | G | H | E | F | 1 |
| A | B | C | D | A | B | C | D | A | B | E | F | G | H | E | F | G | H | E | F | 5 |
| A | B | C | D | A | B | C | D | A | B | E | F | G | H | E | F | G | H | E | F | 2 |
| A | B | C | D | A | B | C | D | A | B | E | F | G | H | E | F | G | H | E | F | 6 |
| A | B | C | D | A | B | C | D | A | B | E | F | G | H | E | F | G | H | E | F | 3 |
| A | B | C | D | A | B | C | D | A | B | E | F | G | H | E | F | G | H | E | F | 7 |
| A | B | E | F | C | D | G | H | A | B | E | F | C | D | G | H | A | B | E | F |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| A | B | E | F | C | D | G | H | A | B | E | F | C | D | G | H | A | B | E | F |
| A | B | E | F | C | D | G | H | A | B | E | F | C | D | G | H | A | B | E | F |
| A | B | E | F | C | D | G | H | A | B | E | F | C | D | G | H | A | B | E | F |
| A | B | E | F | C | D | G | H | A | B | E | F | C | D | G | H | A | B | E | F |
| A | B | E | F | C | D | G | H | A | B | E | F | C | D | G | H | A | B | E | F |
| A | B | E | F | C | D | G | H | A | B | E | F | C | D | G | H | A | B | E | F |
| A | B | E | F | C | D | G | H | A | B | E | F | C | D | G | H | A | B | E | F |
K-Dimension Permutation
Figure 3: Overview of the matrix-reordering algorithm, using the gather-style tensorization of the j2d49pt kernel with an MMA shape of , , and as an example. The letter and color of each grid point jointly encode its coordinates in the grid space. For clarity, only the first two grid rows represented by the input matrix are shown.
illustrated in Figure 4. The first is a structural mismatch. In the example, the input region has length along the dimension, which is not divisible by the row length of fragment A. Consequently, lexicographic mapping causes a fragment row to cross the boundary of the dimension, and corresponding grid points in adjacent vector-matrix products are grouped with different neighboring points. The second is an offset mismatch. Because the offset

Fragment Row
Structural Mismatch (k = 4)

Offset Mismatch (k = 5)
Figure 4: Illustration of structural and offset mismatches that prevent data reuse at the fragment-row granularity.
between adjacent vector-matrix products is not divisible by , corresponding grid points are mapped to different columns within their fragments. Moreover, is fixed by the hardware and cannot be adjusted directly to eliminate these mismatches.
To address this problem, we further map the and dimensions of an MMA fragment across multiple stencil dimensions, such that and . Equivalently, we reorder the and dimensions in a block-major layout: grid points are first grouped into multidimensional blocks of shape or , and are then ordered lexicographically both across blocks and within each block. To eliminate both structural and offset mismatches, each gather-style dimension must satisfy and , while each scatter-style dimension must satisfy and . For example, Figure 3 chooses and , allowing nearly all fragments containing reusable grid points to be directly reused.
The above constraints do not always admit valid choices of and . We can further relax them by exploiting the register-level operand layout of MMA instructions. For example, on NVIDIA A100 GPUs, for the , , and MMA shape, each thread holds fragment in two registers. The minimum granularity for reusing its data is therefore smaller than the entire fragment, allowing us to use an effective register-level size of in place of and relax the constraint accordingly. With such register-level relaxation, valid choices of and exist on all hardware platforms evaluated in this work. On a platform where no valid factorization can be found, the algorithm can fall back to the -dimension reordering alone and still exploit partial data reuse at the fragment granularity.
5 Implementation
On NVIDIA A100 GPUs, we assign each matrix multiplication described in Section 4 to a single warp. This design follows the warp-level programming interface of MMA instructions and ensures that fragment-level data reuse remains within the same warp, as fragments cannot be directly shared across warps. This ownership is particularly important for scatter-style schemes. The overlap of output grid points among different vector-matrix products creates opportunities for data reuse but also introduces potential write conflicts. By assigning the entire matrix multiplication to one warp, all MMA instructions that update the same output fragment are issued within a single instruction stream, allowing the compiler and hardware to coordinate their execution without write conflicts.

Figure 5: Illustration of eliminating shared-memory bank conflicts through padding. The number on each grid point denotes the thread that loads it, while the color indicates its shared-memory bank assignment. For simplicity, the example assumes a 16-thread warp and 16 shared-memory banks. With FP64 data, each grid point occupies two banks, and each fragment is loaded in two phases by the first and second groups of eight threads. A load is conflict-free when the grid points accessed by the eight threads in each phase have distinct colors.
In addition, the matrix reordering introduced in Section 4.2 improves fragment-level data reuse but also makes the grid-space distribution of elements within each fragment more irregular, potentially introducing shared-memory bank conflicts. For fragment , the stencil-weight matrix is small and remains fixed throughout the computation. We therefore preprocess its layout so that loading fragment follows a contiguous access pattern. For fragments and , as illustrated in Figure 5, we add appropriate padding to their shared-memory layouts to eliminate bank conflicts.
Finally, we adopt N.5D blocking [24, 30, 42] to organize computation across warps and thread blocks, thereby exposing parallelism at both levels. This blocking scheme also improves data reuse between global and shared memory, reducing the associated data-transfer overhead.
6 Experimental Results
6.1 Setup
6.1.1 Platform. All experiments were conducted on an NVIDIA A100 80GB SXM GPU. CUDA 12.9 was used with the -03 -gpu-architect compiler options enabled.
6.1.2 Benchmark. As summarized in Table 2, we selected eight representative stencil kernels following prior work [5, 24]. All benchmarks were evaluated in both TF32 and FP64 precision. To ensure fair comparison across different implementations, all stencil kernels employed non-symmetric coefficients.
6.1.3 State-of-the-Art Baselines. PrismStencil was compared against state-of-the-art CUDA Core implementations, including AN5D [24] and EBISU [42], and Tensor Core-based implementations, including TCStencil [21], ConvStencil [5], LoRAStencil [43], and SPIDER [10]. AN5D and EBISU provide both FP64 and FP32 implementations and are used as the CUDA Core baselines in the corresponding experiments. ConvStencil and LoRAStencil provide only FP64 implementations and are therefore excluded from the TF32 comparison.
Table 2: Stencil benchmark
| Kernel | RAD | Kernel | RAD | ||
|---|---|---|---|---|---|
| j2d5pt | 1 | 10 | j2d9pt | 1 | 18 |
| j2d25pt | 2 | 50 | j2d49pt | 3 | 98 |
| j2d81pt | 4 | 162 | j3d7pt | 1 | 14 |
| j3d27pt | 1 | 54 | j3d125pt | 2 | 250 |
FS denotes FLOPs per stencil.
Table 3: Problem size configuration for FP64 on NVIDIA A100
| Method | j2d9pt | j3d27pt |
|---|---|---|
| ConvStencil | ||
| LoRAStencil | ||
| AN5D | ||
| EBISU | ||
| PrismStencil |
TCStencil and SPIDER provide only FP16 implementations. Their TF32 performance is estimated as half of their measured FP16 performance, because both Tensor Core throughput and memory-system throughput for TF32 are half of those for FP16 on the evaluated GPU.
Strictly speaking, the FP32 performance of CUDA Core implementations is not directly comparable with the TF32 performance of Tensor Core implementations because the two formats provide different numerical precision. The comparison is included primarily to evaluate the relative performance advantage of Tensor Core-based stencil computation in a setting where Tensor Cores provide approximately eight times the arithmetic throughput of CUDA Cores.
6.1.4 Problem Size. Problem sizes were selected following prior work [42]. Slightly different sizes were used for different algorithms to avoid incomplete tiling and ensure a fair comparison, while keeping the spatial dimensions as similar as possible. Representative configurations are reported in Table 3, and the complete set is provided in the Supplemental Material.
architecture=native
6.1.5 Metrics. Performance is reported in TFLOPS and calculated as
Here, FS is given in Table 2, T denotes the size of the temporal dimension, N is the number of spatial dimensions, and denotes the size of the i-th spatial dimension. The numerator therefore counts only the floating-point operations required by the original stencil algorithm, and the reported TFLOPS represents the effective algorithmic throughput rather than the actual floating-point throughput executed by the hardware. The variable t denotes the kernel execution time in seconds and thus captures all implementation overheads, including additional computation caused by computational inflation. After appropriate warm-up, each kernel was measured ten times, and the peak performance was reported.

Figure 6: Sensitivity of PrismStencil to the M dimension under FP64 precision. B/Stencil denotes the amortized shared-memory traffic per grid-point update in one time step.
6.2 Sensitivity to the M Dimension
Figure 6 shows the performance and shared-memory traffic of PrismStencil as the size of the M dimension varies. As M increases, the shared-memory traffic steadily decreases until register spilling occurs. This reduction gradually approaches the minimum grid-point traffic required by each stencil update: one read and one write per grid point, corresponding to 16 bytes per stencil update for FP64 data.
The performance of PrismStencil also exhibits an overall increasing trend with M, primarily benefiting from the reduced shared-memory traffic, and reaches its maximum immediately before register spilling. Although increasing M raises per-thread register usage and consequently lowers thread occupancy, it also exposes more independent operations within each matrix multiplication. The resulting increase in instruction-level parallelism compensates for the reduction in thread-level parallelism, leaving the overall parallelism largely unaffected. Based on these results, all subsequent experiments select the largest value of M that does not cause register spilling.
6.3 State-of-the-Art Comparison
Figure 7 compares PrismStencil with state-of-the-art approaches in terms of performance and shared-memory traffic under FP64 and TF32 precision.
On average, PrismStencil achieves higher performance with TF32 than with FP64. This improvement is lower than the difference in peak Tensor Core throughput between the two precisions. This gap arises because the shared-memory system processes TF32 elements at only twice the rate of FP64 elements, causing the arithmetic-to-memory throughput ratio to increase by a factor of four under TF32. Consequently, supplying data to Tensor Cores becomes relatively more demanding, making it more difficult for TF32 kernels to approach their peak arithmetic throughput.
Compared with state-of-the-art Tensor Core approaches, PrismStencil consistently demonstrates substantial performance advantages and lower shared-memory traffic. Under FP64 precision, PrismStencil achieves an average speedup of over LoRAStencil while reducing shared-memory traffic by 72.9% on average. Under TF32 precision, it achieves an average speedup of over SPIDER and reduces shared-memory traffic by 53.8% on average.
Compared with state-of-the-art CUDA Core approaches, PrismStencil provides limited speedups for the star-shaped j2d5pt and j3d7pt stencils. These kernels have relatively low arithmetic intensity and are therefore more severely constrained by memory traffic. Moreover, adjacent grid points in star-shaped stencils share fewer neighbors, resulting in less data reuse and greater computational inflation for Tensor Core-based computation. For box-shaped stencils, PrismStencil achieves average speedups of and over AN5D under FP64 and TF32 precision, respectively.
6.4 Performance Breakdown
Figure 8 presents a performance breakdown of PrismStencil under different combinations of computation and memory-access designs.
The results show that stencil tensorization must improve both computational efficiency and memory-access efficiency. Reducing computational inflation increases TFLOPS per unit of Tensor Core utilization, but the achieved performance still depends on the utilization level. For example, configuration II-B has lower computational inflation than configuration I. Under TF32, however, both configurations are severely constrained by shared-memory traffic; consequently, II-B exhibits lower Tensor Core utilization while achieving nearly the same performance as I. In contrast, improving memory access increases Tensor Core utilization and performance without changing the ratio between TFLOPS and Tensor Core utilization. Once the memory bottleneck is alleviated, the performance benefit of reducing computational inflation becomes more pronounced. Accordingly, the performance improvement from configuration II-A to configuration III is consistently greater than that from configuration I to configuration II-B.
7 Discussion
Sparse Tensor Cores exploit structured zeros to provide higher effective throughput. Since stencil-to-matrix transformations naturally introduce zeros for nonneighboring grid-point pairs, the resulting weight matrices are well suited to sparse Tensor Core acceleration.
SPIDER [10] extends the decomposition-based tensorization scheme characterized by Eq. (2) to sparse Tensor Cores. By setting and , it performs twice the intrinsic stencil operations before alignment. Reordering the stencil-weight matrix to satisfy 2:4 structured sparsity allows sparse Tensor Cores to skip half of these operations, leaving only alignment-induced computational inflation, given by . Although this factor is competitive with dense Tensor Core schemes under the same MMA shape, sparse Tensor Cores typically require larger shapes to reach peak throughput; for example, on NVIDIA A100 GPUs, FP16 dense and sparse Tensor Cores require and , respectively.
As shown in Table 4, SPIDER is highly sensitive to alignment. At r = 7, its matrix dimensions align well with the sparse MMA shape; although PrismStencil has a slightly higher computational inflation factor, both methods are already close to the lower bound of 1, making the difference negligible. At smaller radii, however, SPIDER incurs substantially greater alignment overhead and retains a higher computational inflation factor than PrismStencil even with kernel fusion [5, 43].
For the same MMA shape, PrismStencil incurs lower computational inflation than existing dense Tensor Core tensorization schemes, making it better positioned to accommodate the larger


Figure 7: Comparison of PrismStencil with state-of-the-art approaches in terms of performance and shared-memory traffic. Bars show performance (higher is better), while upward-pointing triangles show shared-memory traffic in B/Stencil (lower is better). For TCStencil and SPIDER, the shared-memory traffic is multiplied by two because their FP16 data elements are half the width of TF32 elements.
I: Multidimensional Vector Mapping
II-A: I + Matrix Reordering
II-B: Unified Gather--Scatter Tensorization
III: II-B + Matrix Reordering

Tensor Core Utilization (%)
Tensor Core Utilization (%)
Figure 8: Performance breakdown of PrismStencil for the j2d49pt kernel. Data points from other state-of-the-art approaches on the same kernel are included for reference.
MMA shapes required by sparse Tensor Cores while maintaining low computational overhead. Extending PrismStencil to sparse Tensor Cores is therefore a promising direction and is left for future work.
8 Related Work
Tiling [3, 9, 23, 32, 34, 35] has been extensively studied to improve data reuse in stencil computations. Representative techniques include tessellating [40, 41], split tiling [8, 15], diamond tiling [2, 3], hexagonal tiling [7, 9], overlapped tiling [17, 46], and N.5D blocking [26]. N.5D blocking has become a mainstream tiling strategy for GPU stencil optimization, with representative systems including STENCILGEN [30], AN5D [24], and EBISU [42]. Complementing these data-locality optimizations, vectorization [14, 18, 19, 38, 39, 44] has been widely used to improve the computational throughput of stencil kernels.
Table 4: Computational inflation factors of PrismStencil and SPIDER for two-dimensional box-shaped stencils with different radii, using the dense and sparse Tensor Core MMA shapes, respectively.
| Kernel Radius | 1 | 2 | 3 | 7 |
|---|---|---|---|---|
| SPIDER | 10.67 | 4.27 | 2.29 | 1.07 |
| SPIDER + Kernel Fusion | 3.82 | 2.75 | 2.11 | 1.07 |
| PrismStencil | 1.78 | 1.92 | 1.31 | 1.14 |
More recently, matrix acceleration units have enabled stencil computations to exploit higher-throughput matrix instructions on both CPUs and GPUs. On CPUs, STOP [45] reformulates scatter-style stencil computations as sequences of vector outer products, while HStencil [16] jointly employs outer-product-based matrix units and vector units to accelerate stencil computation. SMEStencil [37] improves memory-access efficiency for three-dimensional high-order stencils through architecture-specific optimizations. On
GPUs, Tensor Core-based approaches [5, 10, 20, 21, 43] reformulate stencil computations using dense or sparse matrix multiplications. Dense approaches such as ConvStencil [5] and TCStencil [21] incur substantial zero-padding overhead [11], whereas sparse approaches [10, 20] reduce this overhead by exploiting structured sparsity. FlashFFTStencil [13] instead adopts an FFT-based formulation, which can reduce computational complexity in suitable cases.
Other directions of stencil optimization include composite stencil optimization that combines DAG-based transformations with other optimization techniques [22, 31] and distributed-memory stencil optimization that improves scalability and communication efficiency [4, 28, 29, 36].
9 Conclusion
This work presented PrismStencil, a stencil tensorization algorithm that addresses the computational and memory-access inefficiencies of existing Tensor Core stencil methods. PrismStencil introduces multidimensional vector mapping and a unified gather–scatter tensorization scheme to better capture the multidimensional structure of stencil computations and reduce the redundant computation introduced by tensorization. It further develops a cross-product data-reuse mechanism that exploits the inherent overlap among neighboring stencil updates to enhance data reuse. Across representative stencil kernels on an NVIDIA A100 GPU, PrismStencil achieves average speedups of and over state-of-the-art Tensor Core stencil methods with FP64 and TF32 precision, respectively.
References
[1] S. Acharya, B. R. Baliga, K. Karki, J. Y. Murthy, C. Prakash, and S. P. Vanka. 2007. Pressure-Based Finite-Volume Methods in Computational Fluid Dynamics. Journal of Heat Transfer 129, 4 (01 2007), 407–424. doi:10.1115/1.2716419
[2] Vinayaka Bandishti, Irshad Pananilath, and Uday Bondhugula. 2012. Tiling stencil computations to maximize parallelism. In SC '12: Proceedings of the International Conference on High Performance Computing, Networking, Storage and Analysis. 1–11. doi:10.1109/SC.2012.107
[3] Uday Bondhugula, Vinayaka Bandishti, and Irshad Pananilath. 2017. Diamond Tiling: Tiling Techniques to Maximize Parallelism for Stencil Computations. IEEE Transactions on Parallel and Distributed Systems 28, 5 (2017), 1285–1298. doi:10.1109/TPDS.2016.2615094
[4] Ying Cai, Chao Yang, Wenjing Ma, and Yulong Ao. 2018. Extreme-Scale Realistic Stencil Computations on Sunway TaihuLight with Ten Million Cores. In 2018 18th IEEE/ACM International Symposium on Cluster, Cloud and Grid Computing (CCGRID). 566–571. doi:10.1109/CCGRID.2018.00086
[5] Yuetao Chen, Kun Li, Yuhao Wang, Donglin Bai, Lei Wang, Lingxiao Ma, Liang Yuan, Yunquan Zhang, Ting Cao, and Mao Yang. 2024. ConvStencil: Transform Stencil Computation to Matrix Multiplication on Tensor Cores. In Proceedings of the 29th ACM SIGPLAN Annual Symposium on Principles and Practice of Parallel Programming (Edinburgh, United Kingdom) (PPoPP '24). Association for Computing Machinery, New York, NY, USA, 333–347. doi:10.1145/3627535.3638476
[6] GP Glinski, C Bailey, and KA Pericleous. 2001. A non-Newtonian computational fluid dynamics study of the stencil printing process. Proceedings of the Institution of Mechanical Engineers, Part C: Journal of Mechanical Engineering Science 215, 4 (2001), 437–446. https://doi.org/10.1243/0954406011520869
[7] Tobias Grosser, Albert Cohen, Justin Holewinski, P. Sadayappan, and Sven Verdoolaege. 2018. Hybrid Hexagonal/Classical Tiling for GPUs. In Proceedings of Annual IEEE/ACM International Symposium on Code Generation and Optimization (Orlando, FL, USA) (CGO '14). Association for Computing Machinery, New York, NY, USA, 66–75. doi:10.1145/2544137.2544160
[8] Tobias Grosser, Albert Cohen, Paul H. J. Kelly, J. Ramanujam, P. Sadayappan, and Sven Verdoolaege. 2013. Split tiling for GPUs: automatic parallelization using trapezoidal tiles. In Proceedings of the 6th Workshop on General Purpose Processor Using Graphics Processing Units (Houston, Texas, USA) (GPGPU-6). Association for Computing Machinery, New York, NY, USA, 24–31. doi:10.1145/2458523.2458526
[9] Tobias Grosser, Sven Verdoolaege, Albert Cohen, and P. Sadayappan. 2014. The Relation Between Diamond Tiling and Hexagonal Tiling. Parallel Processing
Letters 24, 03 (2014), 1441002. arXiv:https://doi.org/10.1142/S0129626414410023 doi:10.1142/S0129626414410023
[10] Qiqi Gu, Chenpeng Wu, Heng Shi, and Jianguo Yao. 2026. SPIDER: Unleashing Sparse Tensor Cores for Stencil Computation via Strided Swapping. In Proceedings of the 31st ACM SIGPLAN Annual Symposium on Principles and Practice of Parallel Programming (Sydney, NSW, Australia) (PPoPP '26). Association for Computing Machinery, New York, NY, USA, 218–231. doi:10.1145/3774934.3786414
[11] Qiqi Gu, Chenpeng Wu, Heng Shi, Jianguo Yao, and Haibing Guan. 2026. Do We Need Tensor Cores for Stencil Computations? arXiv:2603.00477 [cs.DC] https://arxiv.org/abs/2603.00477
[12] Tobias Gysi, Carlos Osuna, Oliver Fuhrer, Mauro Bianco, and Thomas C. Schulthess. 2015. STELLA: a domain-specific tool for structured grid methods in weather and climate models. In Proceedings of the International Conference for High Performance Computing, Networking, Storage and Analysis (Austin, Texas) (SC '15). Association for Computing Machinery, New York, NY, USA, Article 41, 12 pages. doi:10.1145/2807591.2807627
[13] Haozhi Han, Kun Li, Wei Cui, Donglin Bai, Yiwei Zhang, Liang Yuan, Yifeng Chen, Yunquan Zhang, Ting Cao, and Mao Yang. 2025. FlashFFTStencil: Bridging Fast Fourier Transforms to Memory-Efficient Stencil Computations on Tensor Core Units. In Proceedings of the 30th ACM SIGPLAN Annual Symposium on Principles and Practice of Parallel Programming (Las Vegas, NV, USA) (PPoPP '25). Association for Computing Machinery, New York, NY, USA, 355–368. doi:10.1145/3710848.3710897
[14] Tom Henretty, Kevin Stock, Louis-Noël Pouchet, Franz Franchetti, J. Ramanujam, and P. Sadayappan. 2011. Data Layout Transformation for Stencil Computations on Short-Vector SIMD Architectures. In Compiler Construction, Jens Knoop (Ed.). Springer Berlin Heidelberg, Berlin, Heidelberg, 225–245. https://doi.org/10.1007/978-3-642-19861-8_13
[15] Tom Henretty, Richard Veras, Franz Franchetti, Louis-Noël Pouchet, J. Ramanujam, and P. Sadayappan. 2013. A stencil compiler for short-vector SIMD architectures. In Proceedings of the 27th International ACM Conference on International Conference on Supercomputing (Eugene, Oregon, USA) (ICS '13). Association for Computing Machinery, New York, NY, USA, 13–24. doi:10.1145/2464996.2467268
[16] Han Huang, Jiabin Xie, Guangnan Feng, Xianwei Zhang, Dan Huang, Zhiguang Chen, and Yutong Lu. 2025. HStencil: Matrix-Vector Stencil Computation with Interleaved Outer Product and MLA. In Proceedings of the International Conference for High Performance Computing, Networking, Storage and Analysis (SC '25). Association for Computing Machinery, New York, NY, USA, 1816–1829. doi:10.1145/3712285.3759769
[17] Sriram Krishnamoorthy, Muthu Baskaran, Uday Bondhugula, J. Ramanujam, Atanas Rountev, and P. Sadayappan. 2007. Effective automatic parallelization of stencil computations. In Proceedings of the 28th ACM SIGPLAN Conference on Programming Language Design and Implementation (San Diego, California, USA) (PLDI '07). Association for Computing Machinery, New York, NY, USA, 235–244. doi:10.1145/1250734.1250761
[18] Kun Li, Liang Yuan, Yunquan Zhang, and Yue Yue. 2021. Reducing redundancy in data organization and arithmetic calculation for stencil computations. In Proceedings of the International Conference for High Performance Computing, Networking, Storage and Analysis (St. Louis, Missouri) (SC '21). Association for Computing Machinery, New York, NY, USA, Article 84, 15 pages. doi:10.1145/3458817.3476154
[19] Kun Li, Liang Yuan, Yunquan Zhang, Yue Yue, and Hang Cao. 2022. An Efficient Vectorization Scheme for Stencil Computation. In 2022 IEEE International Parallel and Distributed Processing Symposium (IPDPS). 650–660. doi:10.1109/IPDPS53621.2022.00069
[20] Qi Li, Kun Li, Haozhi Han, Liang Yuan, Yunquan Zhang, Yifeng Chen, Junshi Chen, Hong An, Ting Cao, and Mao Yang. 2025. SparStencil: Retargeting Sparse Tensor Cores to Scientific Stencil Computations via Structured Sparsity Transformation. In Proceedings of the International Conference for High Performance Computing, Networking, Storage and Analysis (SC '25). Association for Computing Machinery, New York, NY, USA, 1495–1509. doi:10.1145/3712285.3759820
[21] Xiaoyan Liu, Yi Liu, Hailong Yang, Jianjin Liao, Mingzhen Li, Zhongzhi Luan, and Depei Qian. 2022. Toward accelerated stencil computation by adapting tensor core unit on GPU. In Proceedings of the 36th ACM International Conference on Supercomputing (Virtual Event) (ICS '22). Association for Computing Machinery, New York, NY, USA, Article 28, 12 pages. doi:10.1145/3524059.3532392
[22] Xiaoyan Liu, Xinyu Yang, Kejie Ma, Shanghao Liu, Kaige Zhang, Hailong Yang, Yi Liu, Zhongzhi Luan, and Depei Qian. 2024. Moirae: Generating High-Performance Composite Stencil Programs with Global Optimizations. In Proceedings of the International Conference for High Performance Computing, Networking, Storage, and Analysis (Atlanta, GA, USA) (SC '24). IEEE Press, Article 20, 15 pages. doi:10.1109/SC41406.2024.00026
[23] Tareq M. Malas, Georg Hager, Hatem Ltaief, and David E. Keyes. 2017. Multidimensional Intratile Parallelization for Memory-Starved Stencil Computations. ACM Trans. Parallel Comput. 4, 3, Article 12 (Dec. 2017), 32 pages. doi:10.1145/3155290
[24] Kazuaki Matsumura, Hamid Reza Zohouri, Mohamed Wahib, Toshio Endo, and Satoshi Matsuoka. 2020. AN5D: automated stencil framework for high-degree temporal blocking on GPUs. In Proceedings of the 18th ACM/IEEE International Symposium on Code Generation and Optimization (San Diego, CA, USA) (CGO '20). Association for Computing Machinery, New York, NY, USA, 199–211. doi:10.1145/3368826.3377904
[25] Ravi Teja Mullapudi, Vinay Vasista, and Uday Bondhugula. 2015. PolyMage: Automatic Optimization for Image Processing Pipelines. In Proceedings of the Twentieth International Conference on Architectural Support for Programming Languages and Operating Systems (Istanbul, Turkey) (ASPLOS '15). Association for Computing Machinery, New York, NY, USA, 429–443. doi:10.1145/2694344.2694364
[26] Anthony Nguyen, Nadathur Satish, Jatin Chhugani, Changkyu Kim, and Pradeep Dubey. 2010. 3.5-D Blocking Optimization for Stencil Computations on Modern CPUs and GPUs. In SC '10: Proceedings of the 2010 ACM/IEEE International Conference for High Performance Computing, Networking, Storage and Analysis. 1–13. doi:10.1109/SC.2010.2
[27] NVIDIA Corporation. 2025. Parallel Thread Execution ISA Version 9.1. https://docs.nvidia.com/cuda/parallel-thread-execution/index.html. Accessed: 2025-01-08.
[28] Yu Pei, Qinglei Cao, George Bosilca, Piotr Luszczek, Victor Eijkhout, and Jack Dongarra. 2020. Communication Avoiding 2D Stencil Implementations over PaRSEC Task-Based Runtime. In 2020 IEEE International Parallel and Distributed Processing Symposium Workshops (IPDPSW). 721–729. doi:10.1109/IPDPSW50202.2020.00127
[29] Johannes Pekkilä, Miikka S. Väisälä, Maarit J. Käpylä, Matthias Rheinhardt, and Oskar Lappi. 2022. Scalable communication for high-order stencil computations using CUDA-aware MPI. Parallel Comput. 111 (2022), 102904. doi:10.1016/j.parco.2022.102904
[30] Prashant Singh Rawat, Miheer Vaidya, Aravind Sukumaran-Rajam, Mahesh Ravishankar, Vinod Grover, Atanas Rountev, Louis-Noël Pouchet, and P. Sadayappan. 2018. Domain-Specific Optimization and Generation of High-Performance GPU Code for Stencil Computations. Proc. IEEE 106, 11 (2018), 1902–1920. doi:10.1109/JPROC.2018.2862896
[31] Prashant Singh Rawat, Miheer Vaidya, Aravind Sukumaran-Rajam, Atanas Rountev, Louis-Noël Pouchet, and P. Sadayappan. 2019. On Optimizing Complex Stencils on GPUs. In 2019 IEEE International Parallel and Distributed Processing Symposium (IPDPS). 641–652. doi:10.1109/IPDPS.2019.00073
[32] Sunil Shrestha, Guang R. Gao, Joseph Manzano, Andres Marquez, and John Feo. 2015. Locality aware concurrent start for stencil applications. In 2015 IEEE/ACM International Symposium on Code Generation and Optimization (CGO). 157–166. doi:10.1109/CGO.2015.7054196
[33] Gagandeep Singh, Dionysios Diamantopoulos, Christoph Hagleitner, Juan Gomez-Luna, Sander Stuijk, Onur Mutlu, and Henk Corporaal. 2020. NERO: A Near High-Bandwidth Memory Stencil Accelerator for Weather Prediction Modeling. In 2020 30th International Conference on Field-Programmable Logic and Applications (FPL). 9–17. doi:10.1109/FPL50879.2020.00014
[34] Robert Strzodka, Mohammed Shaheen, Dawid Pajak, and Hans-Peter Seidel. 2010. Cache oblivious parallelograms in iterative stencil computations. In Proceedings of the 24th ACM International Conference on Supercomputing (Tsukuba, Ibaraki, Japan) (ICS '10). Association for Computing Machinery, New York, NY, USA, 49–59. doi:10.1145/1810085.1810096
[35] Robert Strzodka, Mohammed Shaheen, Dawid Pajak, and Hans-Peter Seidel. 2011. Cache Accurate Time Skewing in Iterative Stencil Computations. In 2011 International Conference on Parallel Processing. 571–581. doi:10.1109/ICPP.2011.47
[36] Hengjie Wang and Aparna Chandramowlishwaran. 2020. Pencil: a pipelined algorithm for distributed stencils. In Proceedings of the International Conference for High Performance Computing, Networking, Storage and Analysis (Atlanta, Georgia) (SC '20). IEEE Press, Article 85, 16 pages. https://doi.org/10.1109/SC41405.2020.00089
[37] Yinuo Wang, Tianqi Mao, Lin Gan, Wubing Wan, Zeyu Song, Jiayu Fu, Lanke He, Wenqiang Wang, Zekun Yin, Wei Xue, and Guangwen Yang. 2026. SMEStencil: Optimizing High-Order Stencils on ARM Multicore Using SME Unit. IEEE Transactions on Parallel & Distributed Systems 37, 03 (March 2026), 651–665. doi:10.1109/TPDS.2025.3650515
[38] Charles Yount. 2015. Vector Folding: Improving Stencil Performance via Multidimensional SIMD-vector Representation. In 2015 IEEE 17th International Conference on High Performance Computing and Communications, 2015 IEEE 7th International Symposium on Cyberspace Safety and Security, and 2015 IEEE 12th International Conference on Embedded Software and Systems. 865–870. doi:10.1109/HPCC-CSS-ICESS.2015.27
[39] Liang Yuan, Hang Cao, Yunquan Zhang, Kun Li, Pengqi Lu, and Yue Yue. 2021. Temporal vectorization for stencils. In Proceedings of the International Conference for High Performance Computing, Networking, Storage and Analysis (St. Louis, Missouri) (SC '21). Association for Computing Machinery, New York, NY, USA, Article 82, 13 pages. doi:10.1145/3458817.3476149
[40] Liang Yuan, Shan Huang, Yunquan Zhang, and Hang Cao. 2019. Tessellating Star Stencils. In Proceedings of the 48th International Conference on Parallel Processing (Kyoto, Japan) (ICPP '19). Association for Computing Machinery, New York, NY, USA, Article 43, 10 pages. doi:10.1145/3337821.3337835
[41] Liang Yuan, Yunquan Zhang, Peng Guo, and Shan Huang. 2017. Tessellating stencils. In Proceedings of the International Conference for High Performance Computing, Networking, Storage and Analysis (Denver, Colorado) (SC '17). Association for Computing Machinery, New York, NY, USA, Article 49, 13 pages. doi:10.1145/3126908.3126920
[42] Lingqi Zhang, Mohamed Wahib, Peng Chen, Jintao Meng, Xiao Wang, Toshio Endo, and Satoshi Matsuoka. 2023. Revisiting Temporal Blocking Stencil Optimizations. In Proceedings of the 37th ACM International Conference on Supercomputing (Orlando, FL, USA) (ICS '23). Association for Computing Machinery, New York, NY, USA, 251–263. doi:10.1145/3577193.3593716
[43] Yiwei Zhang, Kun Li, Liang Yuan, Jiawen Cheng, Yunquan Zhang, Ting Cao, and Mao Yang. 2024. LoRAS stencil: Low-Rank Adaptation of Stencil Computation on Tensor Cores. In Proceedings of the International Conference for High Performance Computing, Networking, Storage, and Analysis (Atlanta, GA, USA) (SC '24). IEEE Press, Article 53, 17 pages. doi:10.1109/SC41406.2024.00059
[44] Yiwei Zhang, Kun Li, Liang Yuan, Haozhi Han, Yunquan Zhang, Ting Cao, and Mao Yang. 2025. Jigsaw: Toward Conflict-free Vectorized Stencil Computation by Tessellating Swizzled Registers. In Proceedings of the 30th ACM SIGPLAN Annual Symposium on Principles and Practice of Parallel Programming (Las Vegas, NV, USA) (PPoPP '25). Association for Computing Machinery, New York, NY, USA, 481–495. doi:10.1145/3710848.3710886
[45] Wenxuan Zhao, Liang Yuan, Baicheng Yan, Penghao Ma, Yunquan Zhang, Long Wang, and Zhe Wang. 2024. Stencil Computation with Vector Outer Product. In Proceedings of the 38th ACM International Conference on Supercomputing (Kyoto, Japan) (ICS '24). Association for Computing Machinery, New York, NY, USA, 247–258. doi:10.1145/3650200.3656611
[46] Xing Zhou, Jean-Pierre Giacalone, María Jesús Garzarán, Robert H. Kuhn, Yang Ni, and David Padua. 2012. Hierarchical overlapped tiling. In Proceedings of the Tenth International Symposium on Code Generation and Optimization (San Jose, California) (CGO '12). Association for Computing Machinery, New York, NY, USA, 207–218. doi:10.1145/2259016.2259044
A Problem Size
Received 20 February 2007; revised 12 March 2009; accepted 5 June 2009
Table 5: Problem size configuration for FP64 on NVIDIA A100
| Kernel | j2d5pt | j2d9pt | j2d25pt | j2d49pt | j2d81pt |
|---|---|---|---|---|---|
| ConvStencil | N/A | N/A | |||
| LoRAStencil | N/A | N/A | |||
| AN5D | |||||
| EBISU | N/A | ||||
| PrismStencil |
| Kernel | j3d7pt | j3d27pt | j3d125pt |
|---|---|---|---|
| ConvStencil | N/A | ||
| LoRAStencil | N/A | ||
| AN5D | |||
| EBISU | N/A | ||
| PrismStencil |
Table 6: Problem size configuration for FP32/TF32 on NVIDIA A100
| Kernel | j2d5pt | j2d9pt | j2d25pt | j2d49pt | j2d81pt |
|---|---|---|---|---|---|
| TCStencil | N/A | N/A | |||
| SPIDER | |||||
| AN5D | |||||
| EBISU | N/A | ||||
| PrismStencil |
| Kernel | j3d7pt | j3d27pt | j3d125pt |
|---|---|---|---|
| AN5D | |||
| EBISU | N/A | ||
| PrismStencil |
TCStencil and SPIDER are omitted for 3D kernels because their AD/AE artifacts do not provide implementations for 3D stencils.