1 / 29

Mitigating the Compiler Optimization Phase-Ordering Problem using Machine Learning

Mitigating the Compiler Optimization Phase-Ordering Problem using Machine Learning . Sameer Kulkarni John Cavazos. Introduction to Phase Ordering Present State-of-the-Art Proposed Solution Understand code Predict optimization An example Results Questions. What is Phase Ordering?.

santo
Download Presentation

Mitigating the Compiler Optimization Phase-Ordering Problem using Machine Learning

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Mitigating the Compiler Optimization Phase-Ordering Problem using Machine Learning Sameer Kulkarni John Cavazos

  2. Introduction to Phase Ordering Present State-of-the-Art Proposed Solution • Understand code • Predict optimization An example Results Questions

  3. What is Phase Ordering? Change ordering of a given set optimizations

  4. Why is it important? • Plethora of optimizations to choose. • All interact with each other • Register Allocation & Instruction Scheduling • Loop Unrolling & CSE • Branch Optimization & Static Analysis

  5. Introduction to Phase Ordering Present State-of-the-Art Proposed Solution • Understand code • Predict optimization An example Results Questions

  6. Present Solutions • Developer’s intuition • Using a static sequence using search • Pseudo Random Search (ML) • Hill Climbing, • Genetic Algorithm

  7. Using Genetic Algorithms… Generation 1 Generation 2

  8. Disadvantages of State-of-art • One size fits all approach • Change in Compiler • Change in Architecture • Change in Code • Expensive Search

  9. A simple experiment Select a set of optimizations, and set a sequence length Generate 500 random sequences Use each of the optimization sequence to compile and run a set of benchmarks

  10. Introduction to Phase Ordering Present State-of-the-Art Proposed Solution • Understand code • Predict optimization An example Results Questions

  11. Proposed Solution

  12. Static Source Code Features • Method level information • Instruction Mix • conditionals • memory ops • size • locals space

  13. Static Source Code Features • Method level information • Instruction Mix • conditionals • memory ops • size • locals space

  14. Proposed Solution

  15. Neural Network

  16. Proposed Solution

  17. Neuro Evolution of Augmented Topologies Evolutionary approach to ANNs Starts with a minimally connected network

  18. Using NEAT… Generation n Generation 1 Generation 2

  19. Introduction to Phase Ordering Present State-of-the-Art Proposed Solution • Understand code • Predict optimization An example Results Questions

  20. scimark.lubencmark Generated by default O3 Generated by NEAT

  21. Advantages • Source code agnostic • Customized optimization sequence • Train once, use every-time • Elegant stopping criteria • Optimization sequence length is not static • Saves time by intelligent selection

  22. Introduction to Phase Ordering Present State-of-the-Art Proposed Solution • Understand code • Predict optimization An example Results Questions

  23. Results on SpecJVM98 Speedup normalized over O3

  24. Results on SpecJVM2008 Speedup normalized over O3

  25. Results on DaCapo Speedup normalized over O3

  26. Mitigating the Compiler Optimization Phase-Ordering Problem using Machine Learning Thank you!

More Related