Learning From Generated Stencil Programs
Jakub Lichman · Repository for Publications and Research Data (ETH Zurich) · 2020
Stencil computations are a well-studied field with many different implementations that utilize various types of compiler optimizations.Recent approaches in this field have used machine learning to automatize the selection of code transformations.Some autotuning techniques have shown massive improvements in execution times as they were able to significantly outperform human experts.Motivated by these improvements, we further explore the connection of these fields in the context of climate modeling and weather prediction.In this work, we propose a novel random stencil program generator, which learns the program structure from an arbitrary set of human-written stencils and generates a set of random programs of a given size that have the learned structure.We show that the properties of the generated programs match those of the original dataset.Furthermore, we train a Gradient Boosting Trees (GBT) model on the dataset created from the replicated stencils, which can accurately predict register usage of the human-written stencils and is 50 times faster than the register allocation method of nvcc compiler.Our model's average predictions are within 10% of the actual register usage.i Furthermore, I would like to thank the SPCL lab for providing me with access to Google Cloud and my family and friends for never-ending support.iii