1 / 15

Machine Learning in Compiler Optimization

Machine Learning in Compiler Optimization. By Namita Dave. Overview. What are compiler optimizations? Challenges with optimizations Current Solutions Machine learning techniques Structure of Adaptive compilers. Introduction.

acton
Download Presentation

Machine Learning in Compiler Optimization

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. Machine Learning in Compiler Optimization By Namita Dave

  2. Overview • What are compiler optimizations? • Challenges with optimizations • Current Solutions • Machine learning techniques • Structure of Adaptive compilers

  3. Introduction • Optimization refers to process of modifying to achieve maximum efficiency in terms of storage, cost or time. • Machine learning techniques can be effectively used for optimizing based on specifics of program and target platform

  4. Challenges • Inherently hard Problems • Interactions between optimizations

  5. Inherently hard problems • Due to the interaction of compiler optimization with the hardware • Example – Register allocation

  6. Interaction between optimizations • There can be positive or negative interactions • It depends in the order in which optimizations are applied • Positive Interaction Example • GCSE and Loop unrolling • Negative interaction example • Instruction scheduling and Register allocation

  7. Instruction Scheduling vs Register Allocation z = x[i] tmp= x[i+1+n] Pre pass Post Pass

  8. Current Solutions • Employ Heuristics • To decide whether to apply an optimization or not • Example – In lining decisions • Phase ordering • To decide the sequence of optimizations so as to minimize negative interactions

  9. Typical Optimizing compiler

  10. Problem? • Compiler Heuristics and Phase ordering is manual and predetermined • The solution needs to be dependent on specifics of program and the target platform

  11. Solution Using machine learning techniques, a near optimal solution can be developed.

  12. Heuristic selection • Machine learning techniques like supervised classification, function approximation and function selection can be employed for heuristic selection • Example • Supervised classification can be used to predict best unroll loop factor • Genetic programming can be used for learning priority functions

  13. Automatic Phase Ordering • Unsupervised learning techniques can automate phase ordering • Based on the notion of similarity of programs • Offline training data can be used to identify a set of best phase orderings for similar programs • Based on feature vectors, similar programs can be found for a given new program

  14. Structure of Adaptive compiler

  15. Thank You

More Related