15
Machine Learning in Compiler Optimization By Namita Dave

Machine Learning in Compiler Optimization

  • Upload
    acton

  • View
    50

  • Download
    1

Embed Size (px)

DESCRIPTION

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. - PowerPoint PPT Presentation

Citation preview

Page 1: Machine Learning in Compiler Optimization

Machine Learning in Compiler

OptimizationBy Namita Dave

Page 2: Machine Learning in Compiler Optimization

OverviewWhat are compiler optimizations?Challenges with optimizationsCurrent SolutionsMachine learning techniquesStructure of Adaptive compilers

Page 3: Machine Learning in Compiler Optimization

IntroductionOptimization 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

Page 4: Machine Learning in Compiler Optimization

ChallengesInherently hard ProblemsInteractions between optimizations

Page 5: Machine Learning in Compiler Optimization

Inherently hard problemsDue to the interaction of compiler optimization

with the hardwareExample – Register allocation

Page 6: Machine Learning in Compiler Optimization

Interaction between optimizations

There can be positive or negative interactionsIt depends in the order in which optimizations

are appliedPositive Interaction Example

GCSE and Loop unrollingNegative interaction example

Instruction scheduling and Register allocation

Page 7: Machine Learning in Compiler Optimization

Instruction Scheduling vs Register Allocation

z = x[i] tmp = x[i+1+n]

Pre pass Post Pass

Page 8: Machine Learning in Compiler Optimization

Current SolutionsEmploy Heuristics

To decide whether to apply an optimization or notExample – In lining decisions

Phase orderingTo decide the sequence of optimizations so as to

minimize negative interactions

Page 9: Machine Learning in Compiler Optimization

Typical Optimizing compiler

Page 10: Machine Learning in Compiler Optimization

Problem?Compiler Heuristics and Phase ordering is

manual and predeterminedThe solution needs to be dependent on specifics

of program and the target platform

Page 11: Machine Learning in Compiler Optimization

SolutionUsing machine learning techniques, a near optimal solution can be developed.

Page 12: Machine Learning in Compiler Optimization

Heuristic selectionMachine 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 factorGenetic programming can be used for learning

priority functions

Page 13: Machine Learning in Compiler Optimization

Automatic Phase OrderingUnsupervised learning techniques can automate

phase orderingBased on the notion of similarity of programsOffline training data can be used to identify a

set of best phase orderings for similar programsBased on feature vectors, similar programs can

be found for a given new program

Page 14: Machine Learning in Compiler Optimization

Structure of Adaptive compiler

Page 15: Machine Learning in Compiler Optimization

Thank You