The Machine Guided Energy Efficient Compiler (MAGEEEC) project was an InnovateUK supported research program led by Embecosm in partnership with the University of Bristol from May 2013 to November 2014. Its goal was to make machine learning feasible in commercial compilers, specifically for generating energy efficient code on deeply embedded systems. The target was to achieve a 20% reduction in typical code energy usage in deeply embedded systems.
MAGEEC built on the previous MILEPOST project, which demonstrated the concept of machine learning optimization in compilers using GCC 4.4. MILEPOST was a three year collaboration between ARC international plc, IBM Haifa, The University of Edinburgh and INRIA, running from 2006 through 2009 and funded by the European Union. While MILEPOST demonstrated the potential of the approach it was not easily portable to other compilers, was inflexible in its optimization criteria and used only one machine learning method. Indeed even migrating the code from GCC 4.4 to GCC 4.5, a task carried out by Embecosm in 2010, proved a significant engineering challenge.
MAGEEC was explicitly designed to be portable to different compilers, to allow different optimization criteria and to allow different machine learning strategies to be used. Funded under the energy efficiency initiative, we specifically chose to demonstrate the technique by optimizing for energy efficiency of the compiler code. Embecosm had previously demonstrated that compilers have significant potential to improve the energy efficiency of code.
Under this project we implemented the first version of the MAGEEC framework, and integrated it with the low cost energy measurement board (the MAGEEC Wand) designed by Dr Simon Hollis, then at Bristol University. This allowed us to sample energy usage on small computers up to 2 million times per second to an accuracy of 1%, essential if we were to get accurate training data. This first version of MAGEEC used the plugin interface to control the GCC pass manager directly. We were able to demonstrate machine learning that could reduce energy consumption in deeply embedded computers, using Atmel AVR processors as the evaluation system. The first public demonstration was given at Cambridge University in 2014 as part of the GNU Tools Cauldron conference.
The research program continued from 2015 in the TSERO project.