Padding in the mathematics of arrays

Multi-dimensional array manipulation constitutes a core component of numerous numerical methods, e.g. finite difference solvers of Partial Differential Equations (PDEs). The efficiency of such computations is tightly connected to traversing array data in a hardware-friendly way. The Mathematics of Arrays (MoA) allows reasoning about array computations at a high level and enables systematic transformations of array-based programs. We have previously shown that stencil computations reduce to MoA's Denotational Normal Form (DNF). Here we bring to light MoA's Operational Normal Forms (ONFs) that allow for adapting array computations to hardware characteristics. ONF transformations start from the DNF. Alongside the ONF transformations, we extend MoA with rewriting rules for padding. These new rules allow both a simplification of array indexing and a systematic approach to introducing halos to PDE solvers. Experiments on various architectures confirm the flexibility of the approach.

[1]  Eva Burrows,et al.  An array API for finite difference methods , 2018, ARRAY@PLDI.

[2]  Lenore M. Restifo Mullin,et al.  Effective data parallel computation using the Psi calculus , 1996, Concurr. Pract. Exp..

[3]  Artjoms Šinkarovs,et al.  Data layout types : a type-based approach to automatic data layout transformations for improved SIMD vectorisation , 2015 .

[4]  Sergei Gorlatch,et al.  High performance stencil code generation with Lift , 2018, CGO.

[5]  Magne Haveraaen,et al.  Finite difference methods fengshui: alignment through a mathematics of arrays , 2019, ARRAY@PLDI.

[6]  Sven-Bodo Scholz,et al.  Convolutional neural networks in APL , 2019, ARRAY@PLDI.

[7]  Harry B. Hunt,et al.  A Transformation--Based Approach for the Design of Parallel/Distributed Scientific Software: the FFT , 2008, ArXiv.

[8]  Michel Steuwer,et al.  LIFT: A functional data-parallel IR for high-performance GPU code generation , 2017, 2017 IEEE/ACM International Symposium on Code Generation and Optimization (CGO).

[9]  M. Snir,et al.  Ghost Cell Pattern , 2010, ParaPLoP '10.

[10]  Kenneth E. Iverson,et al.  A programming language , 1899, AIEE-IRE '62 (Spring).

[11]  Philip S. Abrams,et al.  An APL machine , 1970 .

[12]  Owen Kaser,et al.  Faster remainder by direct computation: Applications to compilers and software libraries , 2019, Softw. Pract. Exp..

[13]  L. Mullin A mathematics of arrays , 1988 .

[14]  Ole Jørgen Abusdal Transformations for Array programming , 2020 .