Jisuanji kexue (Oct 2022)

Prediction of Optimal Loop Tiling Size for stencil Computation Based on Neural Network Model

  • BAO Yi-kun, ZHANG Peng, XU Xiao-wen, MO Ze-yao

DOI
https://doi.org/10.11896/jsjkx.220100147
Journal volume & issue
Vol. 49, no. 10
pp. 18 – 26

Abstract

Read online

Stencil computation is one kind of the most important loop kernels in scientific and engineering computing applications.Loop tiling can effectively improve the data locality of stencil computation and the degree of computational parallelism,but the best tile size is hard to choose.Traditional tile size selection methods usually have shortcomings in some ways of time overhead,labor cost and model accuracy.In this paper,a tile size selection method based on artificial neural network is proposed to predict the optimal tile size of three-dimensional Jacobi stencil loop programs.Experimental results show that,for 11 real stencil programs,the performance improvement of the programs using the model prediction tile size compared with the non tiling is 2% and 35% in serial and parallel tests respectively.Compared with the well-known grid search method,our method has a similar prediction accuracy,but only takes one 30 thousandth of the online time cost.In addition,compared with the Turbo-tiling method,our method improves the performance of tiled codes nearly 9% in average.

Keywords