Skip to main content

Selecting the Best Compiler Optimizations: A Bayesian Network Approach

  • Chapter
  • First Online:
Automatic Tuning of Compilers Using Machine Learning

Part of the book series: SpringerBriefs in Applied Sciences and Technology ((BRIEFSPOLIMI))

Abstract

After presenting our DSE approach for finding good compiler optimizations, we present our autotuning framework to tackle the problem of selecting the best compiler passes. It leverages machine learning and an application characterization to find the most promising optimization passes given an application. This chapter proposes COBAYN: Compiler autotuning framework using Bayesian Networks . An autotuning methodology based on machine learning to speed up application performance and to reduce the cost of the compiler optimization phases. The proposed framework is based on the application characterization done dynamically by using independent micro-architecture features and Bayesian networks. The chapter also presents an evaluation based on static analysis and hybrid feature collection approaches. Besides, we compare our approach against several state-of-the-art machine-learning models. Experiments are carried out on an ARM embedded platform and GCC compiler by considering two benchmark suites with 39 applications. The set of compiler configurations selected by the model (less than 7% of the search space), demonstrated an application performance speedup of up to 4.6\(\times \) on Polybench (1.85\(\times \) on average) and 3.1\(\times \) on Cbench (1.54\(\times \) on average) with respect to standard optimization levels. Moreover, the comparison of the proposed technique with (i) random iterative compilation, (ii) machine learning-based iterative compilation and (iii) non-iterative predictive modeling techniques, shows on average, 1.2\(\times \), 1.37\(\times \) and 1.48\(\times \) speedup, respectively. Finally, the proposed method demonstrates 4\(\times \) and 3\(\times \) speedup, respectively on cBench and Polybench, in terms of exploration efficiency given the same quality of the solutions generated by the random iterative compilation model.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Notes

  1. 1.

    This is by construction due to the initialization of the MWST and the K2 algorithms used to discover the network topology.

References

  1. Palermo G, Silvano C, Zaccaria V (2005) Multi-objective design space exploration of embedded systems. J Embed Comput 1(3):305–316

    Google Scholar 

  2. Hoste K, Eeckhout L (2008) Cole: compiler optimization level exploration. In: Proceedings of the 6th annual IEEE/ACM international symposium on code generation and optimization, pp 165–174

    Google Scholar 

  3. Chen Y, Fang S, Huang Y, Eeckhout L, Fursin G, Temam O, Chengyong W (2012) Deconstructing iterative optimization. ACM Trans Archit Code Optim (TACO) 9(3):21

    Google Scholar 

  4. Agakov F, Bonilla E, Cavazos J, Franke B, Fursin G, O’Boyle MFP, Thomson J, Toussaint M, Williams CKI (2006) Using machine learning to focus iterative optimization. In: Proceedings of the international symposium on code generation and optimization. IEEE Computer Society, pp 295–305

    Google Scholar 

  5. Ashouri AH, Mariani G, Palermo G, Silvano C (2014) A Bayesian network approach for compiler auto-tuning for embedded processors. In: 2014 IEEE 12th symposium on embedded systems for real-time multimedia, ESTIMedia 2014, pp 90–97. http://doi.acm.org/10.1109/ESTIMedia.2014.6962349

  6. Ashouri AH, Mariani G, Palermo G, Park E, Cavazos J, Silvano C (2016) Cobayn: compiler autotuning framework using bayesian networks. ACM Trans Archit Code Optim (TACO), 13(2):21:1–21:25. http://doi.acm.org/10.1145/2928270

  7. Bodin F, Kisuki T, Knijnenburg P, O’Boyle M, Rohou E (1998) Iterative compilation in a non-linear optimisation space. In: Workshop on profile and feedback-directed compilation

    Google Scholar 

  8. Cooper KD, Schielke PJ, Subramanian D (1999) Optimizing for reduced code space using genetic algorithms. In: ACM SIGPLAN Notices

    Google Scholar 

  9. Kisuki T, Knijnenburg PMW, O’Boyle MFP (2000) Combined selection of tile sizes and unroll factors using iterative compilation. In: Proceedings of the 2000 international conference on parallel architectures and compilation techniques (PACT’00), Philadelphia, Pennsylvania, USA, 15–19 October 2000, pp 237–248

    Google Scholar 

  10. Kisuki T, Knijnenburg PMW, O’Boyle MFP, Bodin F, Wijshoff HAG (1999) A feasibility study in iterative compilation. In: High performance computing. Springer, pp 121–132

    Google Scholar 

  11. Ashouri AH, Zaccaria V, Xydis S, Palermo G, Silvano C (2013) A framework for compiler Level statistical analysis over customized VLIW architecture. In: VLSI-SoC, pp 124–129. http://dx.doi.org/10.1109/VLSI-SoC.2013.6673262

  12. Cavazos J, Fursin G, Agakov F (2007) Rapidly selecting good compiler optimizations using performance counters. In: International symposium on code generation and optimization (CGO’07)

    Google Scholar 

  13. Stephenson M, Amarasinghe S (2003) Meta optimization: improving compiler heuristics with machine learning. ACM SIGPLAN Notices 38:77–90

    Article  Google Scholar 

  14. Park E, Cavazos J, Alvarez MA (2012) Using graph-based program characterization for predictive modeling. In: Proceedings of the international symposium on code generation and optimization, pp 295–305

    Google Scholar 

  15. Hoste K, Eeckhout L (2007) Microarchitecture-independent workload characterization. IEEE Micro 27(3):63–72

    Article  Google Scholar 

  16. Fursin G, Miranda C, Temam O (2008) MILEPOST GCC: machine learning based research compiler. In: GCC Summit

    Google Scholar 

  17. Luk C-K, Cohn R, Muth R, Patil H, Klauser A, Lowney G, Wallace S, Reddi VJ, Hazelwood K (2005) Pin: building customized program analysis tools with dynamic instrumentation. In: Proceedings of the 2005 ACM SIGPLAN conference on programming language design and implementation, PLDI ’05, pp 190–200, New York, NY, USA. ACM

    Google Scholar 

  18. Fursin G, Kashnikov Y, Memon AW (2011) Milepost gcc: machine learning enabled self-tuning compiler. Int J Parallel Prog 39(3):296–327

    Article  Google Scholar 

  19. Gorsuch RL (1988) Exploratory factor analysis. In: Handbook of multivariate experimental psychology. Springer, pp 231–258

    Google Scholar 

  20. Thompson B (2002) Statistical, practical, and clinical: how many kinds of significance do counselors need to consider? J Couns Dev 80(1):64–71

    Article  Google Scholar 

  21. Jin Z, Cheng AC (2008) Improve simulation efficiency using statistical benchmark subsetting—an implantbench case study. In: 45th ACM/IEEE on design automation conference, DAC 2008, pp 970–973

    Google Scholar 

  22. Bhatia R (2009) Positive definite matrices. Princeton University Press, Princeton

    Google Scholar 

  23. Lee J, Mathews VJ (1994) A stability condition for certain bilinear systems. IEEE Trans Signal Process 42(7):1871–1873

    Article  Google Scholar 

  24. Tanaka M, Nakata K (2014) Positive definite matrix approximation with condition number constraint. Optim Lett 8(3):939–947

    Article  MathSciNet  MATH  Google Scholar 

  25. R Core Team et al (2013) R: A language and environment for statistical computing. Austria, Vienna

    Google Scholar 

  26. Kulkarni PA, Whalley DB, Tyson GS, Davidson JW (2009) Practical exhaustive optimization phase order exploration and evaluation. ACM Trans Archit Code Optim 6(1):1:1–1:36

    Google Scholar 

  27. Murphy KP (2001) The bayes net toolbox for matlab. Comput Sci Stat 33:2001

    Google Scholar 

  28. Heckerman D, Chickering DM (1995) Learning bayesian networks: the combination of knowledge and statistical data. Mach Learn 20:197–243

    Google Scholar 

  29. Texas Instruments (2012) Pandaboard. OMAP4430 SoC dev. board, revision A, 2

    Google Scholar 

  30. 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

    Google Scholar 

  31. Grauer-Gray S, Xu L, Searles R, Ayalasomayajula S, Cavazos J (2012) Auto-tuning a high-level language targeted to gpu codes. In: Innovative parallel computing (InPar), pp 1–10. IEEE

    Google Scholar 

  32. Pouchet L-N (2012) Polybench: the polyhedral benchmark suite. http://www.cs.ucla.edu/~pouchet/software/polybench/[cited July,]

  33. Roberto S, Concha B, Pedro L, Lozano JA, Echegoyen C, Mendiburu A, Armananzas R, Shakya S (2010) Mateda-2.0: estimation of distribution algorithms in matlab. J Stat Softw 35(7):1–30

    Google Scholar 

  34. Kaiser HF (1958) The varimax criterion for analytic rotation in factor analysis. Psychometrika 23(3):187–200

    Article  MATH  Google Scholar 

  35. Park E, Cavazos J, Pouchet LN (2013) Predictive modeling in a polyhedral optimization space. Int J Parallel Prog 41:704–750

    Google Scholar 

  36. Hall M, Frank E, Holmes G, Pfahringer B, Reutemann P, Witten IH (2009) The weka data mining software: an update. ACM SIGKDD Explorations Newsletter 11(1):10–18

    Google Scholar 

  37. Hoefler T, Belli R (2015) Scientific benchmarking of parallel computing systems: twelve ways to tell the masses when reporting performance results. In: Proceedings of the international conference for high performance computing, networking, storage and analysis, p 73. ACM

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Amir H. Ashouri .

Rights and permissions

Reprints and permissions

Copyright information

© 2018 The Author(s)

About this chapter

Check for updates. Verify currency and authenticity via CrossMark

Cite this chapter

Ashouri, A.H., Palermo, G., Cavazos, J., Silvano, C. (2018). Selecting the Best Compiler Optimizations: A Bayesian Network Approach. In: Automatic Tuning of Compilers Using Machine Learning. SpringerBriefs in Applied Sciences and Technology(). Springer, Cham. https://doi.org/10.1007/978-3-319-71489-9_3

Download citation

  • DOI: https://doi.org/10.1007/978-3-319-71489-9_3

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-319-71488-2

  • Online ISBN: 978-3-319-71489-9

  • eBook Packages: EngineeringEngineering (R0)

Publish with us

Policies and ethics