asac : automatic sensitivity analysis for approximate computing pooja roy, rajarshi ray, chundong...
TRANSCRIPT
ASAC : Automatic Sensitivity Analysis for Approximate Computing
Pooja ROY, Rajarshi RAY, Chundong WANG, Weng Fai WONGNational University of Singapore
LCTES 2014
2ASAC : Automatic Sensitivity Analysis for Approximate Computing
Why Approximate?
Why Approximate?
ASAC : Automatic Sensitivity Analysis for Approximate Computing 3
Quality of Service
QOS Band
Acceptable QoS
High QoSRelaxed accuracy
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)
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)
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
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
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?
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
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
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?
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
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’
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”
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
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!
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?
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)
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.
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)
21ASAC : Automatic Sensitivity Analysis for Approximate Computing
ASAC Correctness
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)
23ASAC : Automatic Sensitivity Analysis for Approximate Computing
ASAC : JPEG
Encode (Mild)
Encode (Aggressive) Decode (Aggressive)
Decode (Mild)Input
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
25ASAC : Automatic Sensitivity Analysis for Approximate Computing
ASAC Runtime
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
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
28ASAC : Automatic Sensitivity Analysis for Approximate Computing
Thank you