Skip to main content

The Phase-Ordering Problem: A Complete Sequence Prediction Approach

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

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

Abstract

This chapter proposes our second approach to tackle the phase-ordering problem. We already showed our intermediate speedup prediction method in Chap. 4. Here, we present our full-sequence speedup prediction method called MiCOMP. MiCOMP: Mitigating the Compiler Phase-ordering problem using optimization sub-sequences and machine learning, is an autotuning framework to mitigate the compiler phase-ordering problem based on machine-learning techniques effectively. The idea is to cluster the optimization passes of the LLVM O3 setting into different clusters to predict the speedup of the complete-sequence of all the optimization clusters. The predictive model uses (i) dynamic features, (ii) an encoded version of the compiler sequence and (iii) an exploration heuristic to tackle the problem. Experimental results using the LLVM compiler framework and the Cbench suite show the effectiveness of the encoding technique to application-based reordering of passes while using a number of predictive models. We performed statistical analysis on the prediction space and compared against (i) standard optimization levels O2 and O3, (ii) random iterative compilation, and (iii) two recent non-iterative approaches. We demonstrate that our proposed methodology outperforms the performance of -O1, -O2, and -O3 optimization levels in just a few iterations, reaching an average performance speedup of 1.26 (up to 1.51) on the Cbench benchmark suite.

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.

    http://llvm.org/docs/Passes.html.

  2. 2.

    Model construction is heavily correlated with the type of machine learning algorithm we use. We observed LR to be the fastest and MLP to be slowest for our data.

  3. 3.

    We provide harmonic mean rather than arithmetic mean as we are dealing with averaging speedups. Note that harmonic-mean is always less than or equal to arithmetic-mean.

  4. 4.

    We are aware of the many other encoding possibilities that are more efficient (currently having \(N \times M\) length). However, we believe that extending the current encoding scheme to a more sophisticated version is out of scope of the work. Moreover, the proposed clustering technique can effectively reduce the number of N, thus the encoding scheme is scalable for higher orders.

References

  1. Ashouri AH, Bignoli A, Palermo G, Silvano C (2016) Predictive modeling methodology for compiler phase-ordering. In: Proceedings of the 7th workshop on parallel programming and run-time management techniques for many-core architectures and the 5th workshop on design tools and architectures for multicore embedded computing platforms. PARMA-DITAM ’16, pp 7–12, New York, NY, USA, 2016. ACM. http://doi.acm.org/10.1145/2872421.2872424

  2. Kulkarni S, Cavazos J (2012) Mitigating the compiler optimization phase-ordering problem using machine learning. ACM SIGPLAN Notices

    Google Scholar 

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

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

    Google Scholar 

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

    Google Scholar 

  6. Park E, Kulkarni S, 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, pp 65–74

    Google Scholar 

  7. Sarwar B, Karypis G, Konstan J, Riedl J (2001) Item-based collaborative filtering recommendation algorithms. In: Proceedings of the 10th international conference on World Wide Web, pp 285–295. ACM

    Google Scholar 

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

  9. Ashouri AH, Killian W, Cavazos J, Gianluca P, Silvano C (2018) A survey on compiler autotuning using machine learning, ACM Computing Surveys (CSUR)

    Google Scholar 

  10. Johnson RA, Wichern DW (2002) Appl Multivar Stat Anal, vol 5. Prentice hall Upper Saddle River, NJ

    Google Scholar 

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

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

    Article  Google Scholar 

  13. Schaeffer SE (2007) Graph clustering. Comput Sci Rev 1(1):27–64

    Article  MATH  Google Scholar 

  14. Zhang W, Zhao D, Wang X (2013) Agglomerative clustering via maximum incremental path integral. Pattern Recogn 46(11):3056–3065

    Article  MATH  Google Scholar 

  15. Agresti A, Liu I et al (1999) Modeling a categorical variable allowing arbitrarily many category choices. Biometrics 55(3):936–943

    Article  MATH  Google Scholar 

  16. Orup H (1999) On-the-fly one-hot encoding of leading zero count, October 26. US Patent 5,974,432

    Google Scholar 

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

    Article  Google Scholar 

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

  19. 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, pp 295–305. IEEE Computer Society

    Google Scholar 

  20. 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, June 2016. http://doi.acm.org/10.1145/2928270

  21. Hyndman RJ, Koehler AB (2006) Another look at measures of forecast accuracy. Int J Forecast 22(4):679–688

    Article  Google Scholar 

  22. Smale S, Zhou D-X (2003) Estimating the approximation error in learning theory. Anal Appl 1(01):17–41

    Article  MathSciNet  MATH  Google Scholar 

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

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

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). The Phase-Ordering Problem: A Complete Sequence Prediction 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_5

Download citation

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

  • 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