Optimal Tile Size Selection Problem Using Machine Learning
Abid Muslim Malik · 2012
One of the key feature of modern architectures is deep memory hierarchies. In order to exploit this feature, one has to expose data locality with-in a program. Loop tiling is an optimization phase in modern compilers which is used to transform a loop for exposing data locality. Selecting the best tile size for a given architecture and compiler is known as Optimal Tile Size Selection Problem. It is a NP-hard problem. People have build cost models for this problem that characterize the performance of a program as a function of tile sizes. The best tile size for a given loop is determined directly by using these models. Hand crafting an accurate tile size selection cost model is hard. Can we automatically learn a tile size selection model? This is an important question. In this paper, we have shown that a fairly accurate model can be learned using simple program dynamic features with standard machine learning techniques. We evaluate our approach on different architecture and compiler combinations. The model given by us consistently shows near-optimal performance (within 4% of the optimal) across all architecture and compiler combinations.