skip to main content
research-article
Free Access

Continuous learning of compiler heuristics

Published:20 January 2013Publication History
Skip Abstract Section

Abstract

Optimizing programs to exploit the underlying hardware architecture is an important task. Much research has been done on enabling compilers to find the best set of code optimizations that can build the fastest and less resource-hungry executable for a given program. A common approach is iterative compilation, sometimes enriched by machine learning techniques. This provides good results, but requires extremely long compilation times and an initial training phase lasting even for days or weeks.

We present long-term learning, a new algorithm that allows the compiler user to improve the performance of compiled programs with reduced compilation times with respect to iterative compilation, and without an initial training phase. Our algorithm does not just build good programs: it acquires knowledge every time a program is compiled and it uses such knowledge to learn compiler heuristics, without the need for an expert to manually define them. The heuristics are evolved during every compilation, by evaluating their effect on the generated programs. We present implementations of long-term learning on top of two different compilers, and experimental data gathered on multiple hardware configurations showing its effectiveness.

References

  1. Agakov, F. V., Bonilla, E. V., Cavazos, J., Franke, B., Fursin, G., et al. 2006. Using machine learning to focus iterative optimization. In Proceedings of the International Symposium on Code Generation and Optimization. 295--305. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. Ansel, J., Chan, C. P., Wong, Y. L., Olszewski, M., Zhaq, Q., et al. 2009. Petabricks: A language and compiler for algorithm choice. In Proceedings of the 2009 ACM SIGPLAN Conference on Programming Language Design and Implementation. 38--49. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Ansel, J., Pacula, M., Amarasinghe, S. P., and O'Reilly, U. -M. 2011. An efficient evolutionary algorithm for solving incrementally structured problems. In Proceedings of the 13th Annual Conference on Genetic and Evolutionary Computation. 1699--1706. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Arlandini, C. and Invernizzi, A. 2008. Lagrange: Un nuovo server per il calcolo ad alte pretazioni. Bollettino del CILEA 0, 110.Google ScholarGoogle Scholar
  5. Blum, A. 1996. On-Line algorithms in machine learning. In Proceedings of the Workshop on OnLine Algorithms. Springer, 306--325. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Bodin, F., Kisuki, T., Knijnenburg, P., O'Boyle, M., and Rohou, E. 1998. Iterative compilation in a non-linear optimization space. In Proceedings of the Workshop on Profile and Feedback Directed Compilation in conjunction with the International Conference on Parallel Architectures and Compilation Techniques (PACT).Google ScholarGoogle Scholar
  7. Cavazos, J., Fursin, G., Agakov, F. V., Bonilla, E. V., O'Boyle, M. F. P., et al. 2007. Rapidly selecting good compiler optimizations using performance counters. In Proceedings of the 5th Annual International Symposium on Code Generation and Optimization. 185--197. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Dubach, C., Cavazos, J., Franke, B., Fursin, G., O'Boyle, M. F. P., et al. 2007. Fast compiler optimisation evaluation using code-feature based performance prediction. In Proceedings of the 4th International Conference on Computing Frontiers. 131--142. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. Dubach, C., Jones T. M., Bonilla E. V., Fursin, G., and O'Boyle, M. F. P. 2009 Portable compiler optimisation across embedded programs and microarchitectures using machine learning. In Proceedings of the 42nd Annual IEEE/ACM International Symposium on Microarchitecture. 78--88. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. Fogel, G. 2000. What is evolutionary computation? IEEE Spectrum 37, 2, 26--32. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Fursin, G. 2010. Collective benchmark (cbench), a collection of open-source programs with multiple datasets assembled by the community to enable realistic benchmarking and research on program and architecture optimization. http://ctuning.org/cbenchGoogle ScholarGoogle Scholar
  12. Fursin, G., Cavazos, J., O'Boyle, M. F. P., and Temam, O. 2007 Midatasets: Creating the conditions for a more realistic evaluation of iterative optimization. In Proceedings of the International Conference on High Performance Embedded Architectures & Compilers. 245--260. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. Fursin, G., Kashnikov, Y., Memon, A. W., Chamski, Z., Teman, O., et al. 2011. Milepost gcc: Machine learning enabled self-tuning compiler. Int. J. Parallel Program 39, 3, 296--327.Google ScholarGoogle ScholarCross RefCross Ref
  14. Fursin, G., Miranda, C., Temam, O., Namolaru, M., Yom-Tov, E., et al. 2008. Milepost gcc: Machine learning based research compiler. In Proceedings of the GCC Developers Summit.Google ScholarGoogle Scholar
  15. Fursin, G. and Temam, O. 2010. Collective optimization: A practical collaborative approach. ACM Trans. Archit. Code Optim. 7, 4, 20. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Guthaus, M. R., Ringenberg, J. S., Ernst, D., Austin, T. M., Mudge, T., et al. 2001. Mibench: A free, commercially representative embedded benchmark suite. In Proceedings of the IEEE International Workshop on Workload Characterization (WWC'01). IEEE Computer Society, Los Alamitos, CA, 3--14. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. Kaelbling, L. P., Littman, M. L., and Moore, A. W. 1996. Reinforcement learning: A survey. CoRR csAI/9605103.Google ScholarGoogle Scholar
  18. Kisuki, T., Knijnenburg, P., O'Boyle, M., and Wijshoff, H. A. G. 2000. Iterative compilation in program optimization. http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.36.3007Google ScholarGoogle Scholar
  19. Kohavi, R. 1995. A study of cross- validation and bootstrap for accuracy estimation and model selection. In Proceedings of the 14th International Joint Conference on Artificial Intelligence. 1137--1145. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. Kulkarni, P. A., Hines, S., Hiser, J., Whalley, D. B., Davidson, J. W., et al. 2004. Fast searches for effective optimization phase sequences. In Proceedings of the ACM SIGPLAN 2004 Conference on Programming Language Design and Implementation. 171--182. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. Lattner, C. and Adve, V. S. 2004. LLVM: A compilation framework for lifelong program analysis & transformation. In Proceedings of the International Symposium on Code Generation and Optimization. 75--88. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. Leather, H. 2011. Machine learning in compilers. Ph.D thesis, Institute of Computing Systems Architecture, School of Information, University of Edinburgh.Google ScholarGoogle Scholar
  23. Leather, H., Bonilla, E. V., and O'Boyle, M. F. P. 2009. Automatic feature generation for machine learning based optimizing compilation. In Proceedings of the 7th Annual IEEE/ACM International Symposium on Code Generation and Optimization. 81--91. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. Long, S. 2011. Sustainable learning-based optimization based on rknm outlier detection. In Proceedings of the 5th Workshop on Statistical and Machine Learning Approaches to Architecture and Compliation (SMART'11).Google ScholarGoogle Scholar
  25. Merrill, J. 2003. GENERIC and GIMPLE: A new tree representation for entire functions. In Proceeedings of the GCC Summit. Red Hat Inc.Google ScholarGoogle Scholar
  26. Monsifrot, A., Bodin, F., and Quiniou, R. 2002. A machine learning approach to automatic production of compiler heuristics. In Proceedings of the 10th International Conference on Artificial Intelligence: Methodology, Systems, and Applications. 41--50. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. Namolaru, M., Cohen, A., Fursin, G., Zaks, A., and Freund, A. 2010. Practical aggregation of semantical program properties for machine learning based optimization. In Proceedings of the International Conference on Compilers, Architectures and Synthesis for Embedded Systems. 197--206. Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. Park, E., Kulkarni, S., and Cavazos, J. 2011. An evaluation of different modeling techniques for iterative compilation. In Proceedings of the 14th International Conference on Compilers, Architectures and Synthesis for Embedded Systems. 65--74. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. Russell, S. J. and Norvig, P. 2010. Artificial Intelligence -- A Modern Approach 3rd ED. Pearson Education. Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. Stephenson, M., Amarasinghe, S. P., Martin, M. C., and O'Reilly, U.-M. 2003. Meta optimization: Improving compiler heuristics with machine learning. In Proceedings of the ACM SIGPLAN 2003 Conference on Programming Language Design and Implementation. 77--90. Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. Tartara, M. and Crespi Reghizzi, S. 2012. Parallel iterative compilation: Using MapReduce to speedup machine learning in compilers. In Proceedings of the 3rd International Workshop on MapReduce and its Applications (MAPREDUCE'12). Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. Thomson, J., O'Boyle, M. F. P., Fursin, G., and Franke, B. 2009. Reducing training time in a one-shot machine learning-based compiler. In Proceedings of the 22nd International Workshop on Languages and Compilers for Parallel Computing (LCPC'09). 399--407. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Continuous learning of compiler heuristics

    Recommendations

    Comments

    Login options

    Check if you have access through your login credentials or your institution to get full access on this article.

    Sign in

    Full Access

    • Published in

      cover image ACM Transactions on Architecture and Code Optimization
      ACM Transactions on Architecture and Code Optimization  Volume 9, Issue 4
      Special Issue on High-Performance Embedded Architectures and Compilers
      January 2013
      876 pages
      ISSN:1544-3566
      EISSN:1544-3973
      DOI:10.1145/2400682
      Issue’s Table of Contents

      Copyright © 2013 ACM

      Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

      Publisher

      Association for Computing Machinery

      New York, NY, United States

      Publication History

      • Published: 20 January 2013
      • Revised: 1 November 2012
      • Accepted: 1 November 2012
      • Received: 1 June 2012
      Published in taco Volume 9, Issue 4

      Permissions

      Request permissions about this article.

      Request Permissions

      Check for updates

      Qualifiers

      • research-article
      • Research
      • Refereed

    PDF Format

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader