asac : automatic sensitivity analysis for approximate computing pooja roy, rajarshi ray, chundong...

28
ASAC : Automatic Sensitivity Analysis for Approximate Computing Pooja ROY , Rajarshi RAY, Chundong WANG, Weng Fai WONG National University of Singapore LCTES 2014

Upload: daniel-neil-stevens

Post on 22-Dec-2015

224 views

Category:

Documents


5 download

TRANSCRIPT

Page 1: ASAC : Automatic Sensitivity Analysis for Approximate Computing Pooja ROY, Rajarshi RAY, Chundong WANG, Weng Fai WONG National University of Singapore

ASAC : Automatic Sensitivity Analysis for Approximate Computing

Pooja ROY, Rajarshi RAY, Chundong WANG, Weng Fai WONGNational University of Singapore

LCTES 2014

Page 2: ASAC : Automatic Sensitivity Analysis for Approximate Computing Pooja ROY, Rajarshi RAY, Chundong WANG, Weng Fai WONG National University of Singapore

2ASAC : Automatic Sensitivity Analysis for Approximate Computing

Why Approximate?

Page 3: ASAC : Automatic Sensitivity Analysis for Approximate Computing Pooja ROY, Rajarshi RAY, Chundong WANG, Weng Fai WONG National University of Singapore

Why Approximate?

ASAC : Automatic Sensitivity Analysis for Approximate Computing 3

Quality of Service

QOS Band

Acceptable QoS

High QoSRelaxed accuracy

Page 4: ASAC : Automatic Sensitivity Analysis for Approximate Computing Pooja ROY, Rajarshi RAY, Chundong WANG, Weng Fai WONG National University of Singapore

4ASAC : Automatic Sensitivity Analysis for Approximate Computing

Architecture

Compilation

Circuit

Programming (API)Carbin et.al.

(OOPSLA’13)

Exploring Previous Works

AlgorithmAnsel et.al. (CGO’11)

Baek et.al. (PLDI’10)

Carbin et.al. (ISSTA’10)

Esmaeilzadeh et.al. (ASPLOS’12)

Gupta et.al. (ISLPED’11)

Hoffman et.al. (ASPLOS’11)

Misailovic et.al. (TECS’13)

Sampson et.al. (PLDI’11)

Sidiroglou-Douskos et.al. (FSE’11)

Chippa et.al.

(DAC’10)

Kahng et.al. (DAC’12)

Zhu et.al. (POPL’12)

Venkataramani et.al. (MICRO’13)

Sampsin et.al. (MICRO’13)

Page 5: ASAC : Automatic Sensitivity Analysis for Approximate Computing Pooja ROY, Rajarshi RAY, Chundong WANG, Weng Fai WONG National University of Singapore

5ASAC : Automatic Sensitivity Analysis for Approximate Computing

Programming (API)

Architecture

Compilation

Circuit

Carbin et.al. (OOPSLA’13)

Exploring Previous Works

AlgorithmAnsel et.al. (CGO’11)

Baek et.al. (PLDI’10)

Carbin et.al. (ISSTA’10)

Esmaeilzadeh et.al. (ASPLOS’12)

Gupta et.al. (ISLPED’11)

Hoffman et.al. (ASPLOS’11)

Misailovic et.al. (TECS’13)

Sampson et.al. (PLDI’11)

Sidiroglou-Douskos et.al. (FSE’11)

Chippa et.al.

(DAC’10)

Kahng et.al. (DAC’12)

Zhu et.al. (POPL’12)

Venkataramani et.al. (MICRO’13)

Sampsin et.al. (MICRO’13)

Page 6: ASAC : Automatic Sensitivity Analysis for Approximate Computing Pooja ROY, Rajarshi RAY, Chundong WANG, Weng Fai WONG National University of Singapore

6ASAC : Automatic Sensitivity Analysis for Approximate Computing

Approximation based Programming Paradigm

New programming paradigm Explicit classification of program data

(variables, methods etc.)

Code Compilation framework to

support approximation

Approximable data

Non-approximable

data

Page 7: ASAC : Automatic Sensitivity Analysis for Approximate Computing Pooja ROY, Rajarshi RAY, Chundong WANG, Weng Fai WONG National University of Singapore

7ASAC : Automatic Sensitivity Analysis for Approximate Computing

Need of Automation

Code Compilation framework to

support approximation

Approximable data

Non-approximable

data

Original Code

• Programmer’s Annotation,• Provision of multiple versions

Rewrite using new language

constructs

Page 8: ASAC : Automatic Sensitivity Analysis for Approximate Computing Pooja ROY, Rajarshi RAY, Chundong WANG, Weng Fai WONG National University of Singapore

8ASAC : Automatic Sensitivity Analysis for Approximate Computing

Need of Automation

Writing ‘binutils’ from scratch?Expect app developers to provide many

versions?Recompile and test ‘Picassa’, ‘VLC,’ with

multiple QoS requirements?Providing for entire android/ios kernels?

Page 9: ASAC : Automatic Sensitivity Analysis for Approximate Computing Pooja ROY, Rajarshi RAY, Chundong WANG, Weng Fai WONG National University of Singapore

9ASAC : Automatic Sensitivity Analysis for Approximate Computing

Our Approach : ASAC

Automatic Sensitivity Analysis Statistical perturbation based framework Scalable

Specifically, considers internal program data for approximation

Page 10: ASAC : Automatic Sensitivity Analysis for Approximate Computing Pooja ROY, Rajarshi RAY, Chundong WANG, Weng Fai WONG National University of Singapore

10ASAC : Automatic Sensitivity Analysis for Approximate Computing

Key Idea

CodePerturb each

VariableAcceptable

QoSPerturbed

Output

sensitivity

Sensitivity particular variables’ contribution towards the output

Based on ‘sensitivity’ the variables are ranked Low ranked variables can be approximated Higher ranked variables are critical

Page 11: ASAC : Automatic Sensitivity Analysis for Approximate Computing Pooja ROY, Rajarshi RAY, Chundong WANG, Weng Fai WONG National University of Singapore

11ASAC : Automatic Sensitivity Analysis for Approximate Computing

Key Idea

CodePerturb each

VariableAcceptable

QoSPerturbed

Output

sensitivity

How to systematically perturb the variables?

How to translate the perturbed output to sensitivity ranking?

Page 12: ASAC : Automatic Sensitivity Analysis for Approximate Computing Pooja ROY, Rajarshi RAY, Chundong WANG, Weng Fai WONG National University of Singapore

12ASAC : Automatic Sensitivity Analysis for Approximate Computing

Hyperbox Sampling

int sum(){int i;double a = 0.1, sum = 0.0;for(i=0;i<10;i++){sum += a/10;}return sum;}

sum

a

i

Creating hyperbox with value range of each variable

Page 13: ASAC : Automatic Sensitivity Analysis for Approximate Computing Pooja ROY, Rajarshi RAY, Chundong WANG, Weng Fai WONG National University of Singapore

13ASAC : Automatic Sensitivity Analysis for Approximate Computing

Hyperbox Sampling

int sum(){int i;double a = 0.1, sum = 0.0;for(i=0;i<10;i++){sum += a/10;}return sum;}

sum

a

i

Discretizing each dimension by ‘k’

Page 14: ASAC : Automatic Sensitivity Analysis for Approximate Computing Pooja ROY, Rajarshi RAY, Chundong WANG, Weng Fai WONG National University of Singapore

14ASAC : Automatic Sensitivity Analysis for Approximate Computing

int sum(){int i;double a = 0.1, sum = 0.0;for(i=0;i<10;i++){sum += a/10;}return sum;}

Hyperbox Sampling

sum

a

i

Choosing samples based on “Latin Hyperbox Sampling”

Page 15: ASAC : Automatic Sensitivity Analysis for Approximate Computing Pooja ROY, Rajarshi RAY, Chundong WANG, Weng Fai WONG National University of Singapore

15ASAC : Automatic Sensitivity Analysis for Approximate Computing

int sum(){int i;double a = 0.1, sum = 0.0;for(i=0;i<10;i++){sum += a/10;}return sum;}

Hyperbox Sampling

sum

a

i

0.2

3

0.7Controlled perturbation

Page 16: ASAC : Automatic Sensitivity Analysis for Approximate Computing Pooja ROY, Rajarshi RAY, Chundong WANG, Weng Fai WONG National University of Singapore

16ASAC : Automatic Sensitivity Analysis for Approximate Computing

Perturbed Outputs

Rule 1 For a program with ‘n’ variables, discretization

constant ‘k’ and ‘m’ randomly chosen points , number of perturbed outputs are -

m* ( (k-i) )i=0

(k1) n1

Not trivial!

Page 17: ASAC : Automatic Sensitivity Analysis for Approximate Computing Pooja ROY, Rajarshi RAY, Chundong WANG, Weng Fai WONG National University of Singapore

17ASAC : Automatic Sensitivity Analysis for Approximate Computing

Key Idea

CodePerturb each

VariableAcceptable

QoSPerturbed

Output

sensitivity

How to systematically perturb the variables? How to translate the perturbed output to sensitivity ranking?

Page 18: ASAC : Automatic Sensitivity Analysis for Approximate Computing Pooja ROY, Rajarshi RAY, Chundong WANG, Weng Fai WONG National University of Singapore

18ASAC : Automatic Sensitivity Analysis for Approximate Computing

Perturbed Outputs

‘good’ sample – within QoS band ‘bad’ sample – outlies the QoS band

(cumulative distribution function (cdf) for each variable)

Page 19: ASAC : Automatic Sensitivity Analysis for Approximate Computing Pooja ROY, Rajarshi RAY, Chundong WANG, Weng Fai WONG National University of Singapore

19ASAC : Automatic Sensitivity Analysis for Approximate Computing

Hypothesis Testing

Kolmogorov-Smirnov test calculates the max distance between the curves

Rule 2 The maximum distance between the curves

is the sensitivity score for the variable. Higher the score, the more the variable contributes towards the program output.

Page 20: ASAC : Automatic Sensitivity Analysis for Approximate Computing Pooja ROY, Rajarshi RAY, Chundong WANG, Weng Fai WONG National University of Singapore

20ASAC : Automatic Sensitivity Analysis for Approximate Computing

Approximable vs. Critical

Sensitivity score ( > 0.5) is critical For evaluation

Mild Error Injection : 1/3 (or 1/2) of approximable variables

Medium Error Injection : 1/6 of approximable variables Aggressive Error Injection : All of the approximable

variables Programs

SciMark2 MiBench (JPEG) SPEC2006 (464.H264ref)

Page 21: ASAC : Automatic Sensitivity Analysis for Approximate Computing Pooja ROY, Rajarshi RAY, Chundong WANG, Weng Fai WONG National University of Singapore

21ASAC : Automatic Sensitivity Analysis for Approximate Computing

ASAC Correctness

Page 22: ASAC : Automatic Sensitivity Analysis for Approximate Computing Pooja ROY, Rajarshi RAY, Chundong WANG, Weng Fai WONG National University of Singapore

22ASAC : Automatic Sensitivity Analysis for Approximate Computing

ASAC Correctness

Benchmarks

True Positive

False Positive

False Negative

True Negative

Precision Recall Accuracy

SOR 5 0 1 2 0.83 1 0.88

SMM 1 0 1 6 0.50 1 0.88

Monte 2 0 1 2 0.67 1 0.80

FFT 15 2 2 12 0.88 0.88 0.87

LU 7 1 1 5 0.88 0.88 0.86

Average 0.75 0.95 0.86

*as compared to ‘manually annotated baseline’ (EnerJ, PLDI’11)

Page 23: ASAC : Automatic Sensitivity Analysis for Approximate Computing Pooja ROY, Rajarshi RAY, Chundong WANG, Weng Fai WONG National University of Singapore

23ASAC : Automatic Sensitivity Analysis for Approximate Computing

ASAC : JPEG

Encode (Mild)

Encode (Aggressive) Decode (Aggressive)

Decode (Mild)Input

Page 24: ASAC : Automatic Sensitivity Analysis for Approximate Computing Pooja ROY, Rajarshi RAY, Chundong WANG, Weng Fai WONG National University of Singapore

24ASAC : Automatic Sensitivity Analysis for Approximate Computing

ASAC : H264

Error Rate SNR_Y SNR_U SNR_V BitRate

No Error 36.67 40.74 42.32 149.62

Mild 36.69 37.64 37.65 146.6

Medium 34.05 36.92 36.79 147.12

Aggressive 29.78 32.89 32.99 146.03

Page 25: ASAC : Automatic Sensitivity Analysis for Approximate Computing Pooja ROY, Rajarshi RAY, Chundong WANG, Weng Fai WONG National University of Singapore

25ASAC : Automatic Sensitivity Analysis for Approximate Computing

ASAC Runtime

Page 26: ASAC : Automatic Sensitivity Analysis for Approximate Computing Pooja ROY, Rajarshi RAY, Chundong WANG, Weng Fai WONG National University of Singapore

26ASAC : Automatic Sensitivity Analysis for Approximate Computing

ASAC Sanity Check

• JPEG : Encode and Decode with error injected in variables marked as ‘non-approximable’

• H264 – Application crash

Page 27: ASAC : Automatic Sensitivity Analysis for Approximate Computing Pooja ROY, Rajarshi RAY, Chundong WANG, Weng Fai WONG National University of Singapore

27ASAC : Automatic Sensitivity Analysis for Approximate Computing

Concluding

ASAC Automatic classification of approximable and

non-approximable data Scalable No profiling Can be applied to program without available

source codeApproximation

Saves energy and without performance loss

Page 28: ASAC : Automatic Sensitivity Analysis for Approximate Computing Pooja ROY, Rajarshi RAY, Chundong WANG, Weng Fai WONG National University of Singapore

28ASAC : Automatic Sensitivity Analysis for Approximate Computing

Thank you