Statistical selection of compiler options
This presentation is the property of its rightful owner.
Sponsored Links
1 / 17

Statistical Selection of Compiler Options PowerPoint PPT Presentation


  • 76 Views
  • Uploaded on
  • Presentation posted in: General

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.

Download Presentation

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.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Presentation Transcript


Statistical selection of compiler options

Statistical Selectionof Compiler Options

R.P.J. Pinkers

P.M.W. Knijnenburg

M. Haneda

H.A.G. Wijshoff


Motivation

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


Fragment optimization space gcc

Fragment Optimization Space gcc


Fragment optimization space ijpeg

Fragment Optimization Space ijpeg


Orthogonal arrays

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.


Definition of orthogonal arrays

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


Orthogonal array example

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


Main effects of options

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.


Relative effects

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


Improvement of options

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


Iterative algorithm

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


Experimental setup

Experimental Setup

  • SimpleScalar simulator with GCC 2.6.3.

  • Contains 19 options divided in 14 factors

  • 6 SPEC95 benchmarks.


Iteration 1 for gcc

Iteration 1 for gcc


Iteration 2 for gcc

Iteration 2 for gcc


Iteration 3 for gcc

Iteration 3 for gcc


Comparison with standard settings

Comparison with Standard Settings


Conclusions

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.


  • Login