1 / 17

Statistical Selection of Compiler Options

Statistical Selection of Compiler Options. R.P.J. Pinkers P.M.W. Knijnenburg M. Haneda H.A.G. Wijshoff. Motivation. Modern compilers contain dozens of options. Options can positively or negatively interfere.

Télécharger la présentation

Statistical Selection of Compiler Options

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. Statistical Selectionof Compiler Options R.P.J. Pinkers P.M.W. Knijnenburg M. Haneda H.A.G. Wijshoff

  2. Motivation • Modern compilers contain dozens of options. • Options can positively or negatively interfere. • Optimal setting of those options depends on application as well as target architecture. • Standard –Ox settings produce sub-optimal results. • We propose almost automatic iterative procedure to select options for a given application and architecture based on statistical analysis

  3. Fragment Optimization Space gcc

  4. Fragment Optimization Space ijpeg

  5. Orthogonal Arrays • If there are N options or factors, the full optimization space contains 2N combinations. • This space is called afull factorial design. • A fractional factorial design is a subset of the full factorial design. • An Orthogonal Array (OA) or Taguchi design is a well-known approach to fractional factorial designs. • An OA allows us to determine the effect of a factor in the presence of other factors using a reduced space.

  6. Definition of Orthogonal Arrays • OA is N x k matrix of zeroes and ones. • The columns are interpreted as options. • Each row defines a compiler setting. • An OA has the property that two arbitrary columns contain the patterns equally often. • Each option Oi is turned on and off equally often. • If Oi is turned on, then each other option Oj is turned on and off equally often. 00 01 10 11

  7. Orthogonal Array (Example) 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 1 0 1 1 0 1 0 0 1 0 1 1 0 1 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 1 1 0 1 0 0 1 0 1 1 0 1 0 0 1 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 0 1 0 1 0 1 1 0 1 0 1 0 1 0 0 1 1 0 0 1 1 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 1 0 0 1 1 0 0 1 0 0 0 1 1 1 1 1 1 1 1 0 0 0 0 1 0 1 1 0 1 0 1 0 1 0 0 1 0 1 0 1 1 1 1 0 0 1 1 0 0 0 0 1 1 1 1 0 1 0 0 1 1 0 0 1 0 1 1 0

  8. Main Effects of Options • An OA allows us to calculate the main effect of options. • The main effect of an option Oi wrt an OA A is defined as where s denotes a row in A and T(s) denotes the execution time of the program when compiles with setting s.

  9. Relative Effects • Execution times are given in cycles or seconds. • Effects of options for different benchmarks cannot be compared easily. • We define relative effect of an option Oi as

  10. Improvement of Options • An option can improve or degrade performance. • The main effect is always positive and does not distinguish between improvement or degradation. • We define the improvement of an option Oi wrt an OA A as

  11. Iterative Algorithm Repeat: • Compile application with each row from A as compiler setting and execute optimized application. • Compute effect of each option. • If effect is larger than threshold of 10% • if option has positive improvement, switch option on • else switch option off. • Construct new OA A by dropping columns corresponding to selected options. until all options are set

  12. Experimental Setup • SimpleScalar simulator with GCC 2.6.3. • Contains 19 options divided in 14 factors • 6 SPEC95 benchmarks.

  13. Iteration 1 for gcc

  14. Iteration 2 for gcc

  15. Iteration 3 for gcc

  16. Comparison with Standard Settings

  17. Conclusions • We have proposed a method based on statistical analysis of the effect of options using Orthogonal Arrays. • Method uses (almost) no knowledge of compiler. • Can be implemented as a simple driver on top of any compiler. • Significant improvement can be obtained by automatically tuning compiler options over standard optimization settings.

More Related