1 / 20

Accuracy-Aware Program Transformations

Accuracy-Aware Program Transformations. Sasa Misailovic MIT CSAIL. Collaborators. Martin Rinard , Michael Carbin , Stelios Sidiroglou , Henry Hoffmann, Deokhwan Kim, Fan Long, Daniel Roy, Zeyuan Allen Zhu, Michael Kling, Jonathan Kelner , Anant Agarwal.

gwylan
Download Presentation

Accuracy-Aware Program Transformations

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. Accuracy-Aware Program Transformations Sasa Misailovic MIT CSAIL

  2. Collaborators Martin Rinard, Michael Carbin, SteliosSidiroglou, Henry Hoffmann, Deokhwan Kim, Fan Long, Daniel Roy, Zeyuan Allen Zhu, Michael Kling, Jonathan Kelner, Anant Agarwal

  3. Trade Accuracyfor Energy and Performance [Rinard ICS’06, OOPSLA’07; Misailovic, Sidiroglou, Hoffmann, Rinard ICSE’10; Carbin, Rinard, ISSTA’10; Hoffmann, Sidiroglou, Carbin, Misailovic, Agarwal, Rinard ASPLOS’11; Sidiroglou, Misailovic, Hoffmann, Rinard FSE’11; Misailovic, Roy, Rinard, SAS‘11; Zhu, Misailovic, Kelner, Rinard POPL’12; Carbin, Kim, Misailovic, RinardPLDI’12; Misailovic, Sidiroglou, Rinard, RACES‘12; Misailovic, Kim, Rinard TECS PEC’13; Carbin, Kim, Misailovic, Rinard PEPM’13; Carbin, Misailovic, Rinard, OOPSLA ‘13; …]

  4. Harness Approximate Computing • How to systematicallygenerate approximate programs? • How to predict accuracyof the results ofapproximate programs? • How to find the most profitable approximate programs? Automated Transformations Probabilistic Reasoning Explicit Search and Mathematical Optimization

  5. Transformations • Do less work • Loop perforation • Sampling, Task skipping for (i = 0; i < n; i += 2){ … } Do different kind of work Randomized substitution r = f_0(x)  f_1(x); Exploit Execution Environment Unreliable operation placement Unreliable memory regions, Lock elision r = var+. 2; lock(x); function(); unlock(x);

  6. Whereand whenshould we apply the transformations? • What are the benefitsand costs?

  7. Optimization Framework • Find Candidates for Transformation • Analyze Effects of the Transformations • Navigate Tradeoff Space c c c for (i = 0; i < n; i++){ … } for (i = 0; i < n; i += 2){ … }

  8. [Misailovic, Sidiroglou, Hoffmann, Rinard ICSE’10; Hoffmann, Sidiroglou, Carbin, Misailovic, Agarwal, Rinard ASPLOS’11; Sidiroglou, Misailovic, Hoffmann, RinardFSE’11] Explicit Search Algorithm for Perforation Find Transformation Candidates: • Profile program to find time-consuming for loops Analyze the Effects of Transformation: • Performance: Compare execution times • Accuracy: Compare the quality of the results • Safety: memory safety, well formed output Navigate Tradeoff Space: • Combine multiple perforatable loops • Prioritize loops by their individual performance and accuracy • Greedy or Exhaustive Search with Pruning

  9. x264 Cumulative Loop Scores Mean Normalized Time Accuracy loss (%)

  10. Computational Kernels: Several perforatable computations execute for the majority of the time Computational patterns: Distance metrics Data Statistics Iteration steps Monte-Carlo

  11. Next Step: Analyses with Guarantees • Accuracy analysis: Results valid for a whole range of inputs, not just those used in testing • Navigation:Explore the space of transformed programs to find those with optimal tradeoffs

  12. Accuracy Analysis: Probabilistic Reasoning For approximate program configuration [Misailovic, Roy, Rinard SAS ’11; Zhu, Misailovic, Kelner, Rinard POPL ’12; Misailovic, Sidiroglou, Rinard, RACES ‘12, Misailovic, Kim, Rinard TECS PEC ’13,Carbin, Misailovic, Rinard, OOPSLA ’13, Misailovic, Rinard WACAS ‘14,Misailovic, Carbin, Achour, Qi, Rinard MIT-TR ‘14]

  13. [Zhu, Misailovic, Kelner, Rinard POPL 2012; Misailovic, Rinard WACAS 2014] Optimization of Map-Fold Computations outList = Map ( Func(x), inputList ) Func0: (0,T0) Func1: (1,T1) Func2: (2,T2) Accuracy Requirement:

  14. [Zhu, Misailovic, Kelner, Rinard POPL 2012; Misailovic, Rinard WACAS 2014] Optimization of Map-Fold Computations Configuration: • Probability to execute each version of Func • Range: , • Sum: Accuracy Loss Constraint: • Goal: Linear + Dynamic programming Func0: (0,T0) Func1: (1,T1) Func2: (2,T2) outList= Map( Func0(x)  Func1(x)  Func2(x) , inputList )

  15. [Misailovic, Carbin, Achour, Qi, Rinard MIT-TR 14] Chisel: Automatic Generation of Approximate Rely Programs Developer’s reliability specification float<0.99*R(x)>f(float in unrelx) { y = g(x) +. h(x); return y *. y; } Variable and Operation Annotations

  16. [Misailovic, Carbin, Achour, Qi, Rinard MIT-TR 14] Chisel: Automatic Generation of Approximate Rely Programs • Configuration: • Unreliable variable or unreliable operation • Range: Reliability Constraint: • Goal: • Integer Linear Programming Developer’s specification float<0.99*R(x)> f(float x) { y = g(x) +h(x); return y * y; }

  17. Navigate Search Space: Mathematical Optimization Find configuration s. t. [Zhu, Misailovic, Kelner, Rinard POPL ’12; Misailovic, Rinard WACAS ‘14Misailovic, Carbin, Achour, Qi, Rinard, MIT-TR ‘14]

  18. Looking Forward • Fully Exploit Optimization Opportunities: both application- and hardware-level transformations • Reasoning About Uncertainty: • logic-based techniques • probabilistic techniques • empirical techniques • Practical Aspects: provide intuition and control for developers and domain experts

  19. Takeaway • Accuracy-aware transformations • Improve performance • Reduce energy consumption • Facilitate dynamic adaptation and software specialization • Program analysis and search can help find profitable, safe, and predictable tradeoffs

  20. Takeaway • Accuracy-aware transformations • Improve performance • Reduce energy consumption • Facilitate dynamic adaptation and software specialization • Program analysis and search can help find profitable, safe, and predictable tradeoffs

More Related