Efficient Stencil Computation with Temporal Blocking by Halide DSL

Hiroki Aikawa, Toshio Endo, Tomoya Yuki, Takahiro Hirofuchi, Tsutomu Ikegami · 2022

The stencil computation is a memory centric computation, where memory access becomes a bottleneck. Therefore locality improvement method like temporal blocking is essential to improve the speed. Introducing temporal blocking, however, introduces heavy programming costs. This paper proposes a methodology to implement efficient stencil software with temporal blocking easier using the domain-specific language Halide. Generally, boundary conditions, such as Neumann and Dirichlet boundary conditions, are needed in stencil computations. Also user-defined boundary computations may be needed in general fluid dynamics applications. We indicate a pitfall in combining temporal blocking and boundary conditions on Halide and show a solution to improve performance. We also apply our methodology to the Hotspot3D bench-mark from Rodinia benchmark suite and demonstrate 3.5 to 5.0 times performance improvement over the original OpenMP implementation.

Read the paper · More papers on PaperTik