Rely: Verifying Quantitative Reliability for Programs that Execute on Unreliable Hardware Michael Carbin, Sasa Misailovic, and Martin Rinard MIT CSAIL.

Slides:



Advertisements
Similar presentations
Automated Theorem Proving Lecture 1. Program verification is undecidable! Given program P and specification S, does P satisfy S?
Advertisements

Copyright W. Howden1 Programming by Contract CSE 111 6/4/2014.
Semantics Static semantics Dynamic semantics attribute grammars
Mining Specifications Glenn Ammons, Dept. Computer Science University of Wisconsin Rastislav Bodik, Computer Science Division University of California,
ICE1341 Programming Languages Spring 2005 Lecture #6 Lecture #6 In-Young Ko iko.AT. icu.ac.kr iko.AT. icu.ac.kr Information and Communications University.
Compilation 2011 Static Analysis Johnni Winther Michael I. Schwartzbach Aarhus University.
Abstraction and Modular Reasoning for the Verification of Software Corina Pasareanu NASA Ames Research Center.
Automated Software Verification with a Permission-Based Logic 20 th June 2014, Zürich Malte Schwerhoff, ETH Zürich.
“FENDER” AUTOMATIC MEMORY FENCE INFERENCE Presented by Michael Kuperstein, Technion Joint work with Martin Vechev and Eran Yahav, IBM Research 1.
Reasoning About Code; Hoare Logic, continued
Inferring Disjunctive Postconditions Corneliu Popeea and Wei-Ngan Chin School of Computing National University of Singapore - ASIAN
Programming Abstractions for Approximate Computing Michael Carbin with Sasa Misailovic, Hank Hoffmann, Deokhwan Kim, Stelios Sidiroglou, Martin Rinard.
Accuracy-Aware Program Transformations Sasa Misailovic MIT CSAIL.
Randomized Accuracy Aware Program Transformations for Efficient Approximate Computations Sasa Misailovic Joint work with Zeyuan Allen ZhuJonathan KelnerMartin.
Copyright © 2006 Addison-Wesley. All rights reserved.1-1 ICS 410: Programming Languages Chapter 3 : Describing Syntax and Semantics Axiomatic Semantics.
ISBN Chapter 3 Describing Syntax and Semantics.
Copyright © 2006 Addison-Wesley. All rights reserved. 3.5 Dynamic Semantics Meanings of expressions, statements, and program units Static semantics – type.
CS 330 Programming Languages 09 / 19 / 2006 Instructor: Michael Eckmann.
CS 355 – Programming Languages
Building Reliable Software Requirements and Methods.
1 8. Safe Query Languages Safe program – its semantics can be at least partially computed on any valid database input. Safety is tied to program verification,
Axiomatic Semantics Dr. M Al-Mulhem ICS
CS 330 Programming Languages 09 / 18 / 2007 Instructor: Michael Eckmann.
White Box Testing and Symbolic Execution Written by Michael Beder.
CS590 Z Software Defect Analysis Xiangyu Zhang. CS590F Software Reliability What is Software Defect Analysis  Given a software program, with or without.
Software Reliability Methods Sorin Lerner. Software reliability methods: issues What are the issues?
OOP #10: Correctness Fritz Henglein. Wrap-up: Types A type is a collection of objects with common behavior (operations and properties). (Abstract) types.
Michael Ernst, page 1 Improving Test Suites via Operational Abstraction Michael Ernst MIT Lab for Computer Science Joint.
Functional Coverage Driven Test Generation for Validation of Pipelined Processors P. Mishra and N. Dutt Proceedings of the Design, Automation and Test.
Dr. Muhammed Al-Mulhem 1ICS ICS 535 Design and Implementation of Programming Languages Part 1 Fundamentals (Chapter 4) Axiomatic Semantics ICS 535.
Page 1 Building Reliable Component-based Systems Chapter 14 - Testing Reusable Software Components in Safety- Critical Real-Time Systems Chapter 14 Testing.
Describing Syntax and Semantics
CS 267: Automated Verification Lecture 13: Bounded Model Checking Instructor: Tevfik Bultan.
ASAC : Automatic Sensitivity Analysis for Approximate Computing Pooja ROY, Rajarshi RAY, Chundong WANG, Weng Fai WONG National University of Singapore.
Dancing With Uncertainty Saša Misailović Stelios Sidiroglou Martin Rinard MIT CSAIL.
By D. Beyer et. al. Simon Fraser University (Spring 09) Presentation By: Pashootan Vaezipoor.
Maria-Cristina Marinescu Martin Rinard Laboratory for Computer Science Massachusetts Institute of Technology A Synthesis Algorithm for Modular Design of.
Maria-Cristina Marinescu Martin Rinard Laboratory for Computer Science Massachusetts Institute of Technology High-level Specification and Efficient Implementation.
TASK ADAPTATION IN REAL-TIME & EMBEDDED SYSTEMS FOR ENERGY & RELIABILITY TRADEOFFS Sathish Gopalakrishnan Department of Electrical & Computer Engineering.
©Ian Sommerville 2000Software Engineering, 6th edition. Chapter 19Slide 1 Verification and Validation l Assuring that a software system meets a user's.
Distributed Constraint Optimization Michal Jakob Agent Technology Center, Dept. of Computer Science and Engineering, FEE, Czech Technical University A4M33MAS.
Software Engineering Prof. Dr. Bertrand Meyer March 2007 – June 2007 Chair of Software Engineering Static program checking and verification Slides: Based.
CSC2535: Computation in Neural Networks Lecture 11: Conditional Random Fields Geoffrey Hinton.
F LEX J AVA : Language Support for Safe and Modular Approximate Programming Jongse Park, Hadi Esmaeilzadeh, Xin Zhang, Mayur Naik, William Harris Alternative.
Using Loop Perforation to Dynamically Adapt Application Behavior to Meet Real-Time Deadlines Henry Hoffmann, Sasa Misailovic, Stelios Sidiroglou, Anant.
1 Inference Rules and Proofs (Z); Program Specification and Verification Inference Rules and Proofs (Z); Program Specification and Verification.
ISBN Chapter 3 Describing Semantics -Attribute Grammars -Dynamic Semantics.
Rahul Sharma, Aditya V. Nori, Alex Aiken Stanford MSR India Stanford.
CS 363 Comparative Programming Languages Semantics.
Program Efficiency & Complexity Analysis. Algorithm Review An algorithm is a definite procedure for solving a problem in finite number of steps Algorithm.
Requirements Specification. Welcome to Software Engineering: “Requirements Specification” “Requirements Specification”  Verb?  Noun?  “Specification”
Proving Programs Robust Swarat Chaudhuri 1,3 Sumit Gulwani 2 Roberto Lublinerman 1 Sara Navidpour 1 1 Pennsylvania State University 2 Microsoft Research.
Reasoning about Relaxed Programs Michael Carbin Deokhwan Kim, Sasa Misailovic, and Martin Rinard.
ISBN Chapter 3 Describing Semantics.
Semantics In Text: Chapter 3.
COP4020 Programming Languages Introduction to Axiomatic Semantics Prof. Robert van Engelen.
Student: Shaobo He, Advisor: Zvonimir Rakamarić TOWARDS AUTOMATED DIFFERENTIAL PROGRAM VERIFICATION FOR APPROXIMATE COMPUTING.
/ PSWLAB Evidence-Based Analysis and Inferring Preconditions for Bug Detection By D. Brand, M. Buss, V. C. Sreedhar published in ICSM 2007.
CSC3315 (Spring 2009)1 CSC 3315 Languages & Compilers Hamid Harroud School of Science and Engineering, Akhawayn University
Testing Overview Software Reliability Techniques Testing Concepts CEN 4010 Class 24 – 11/17.
Chapter 15 Running Time Analysis. Topics Orders of Magnitude and Big-Oh Notation Running Time Analysis of Algorithms –Counting Statements –Evaluating.
A Review of Software Testing - P. David Coward
Hardware & Software Reliability
IIT Kharagpur & Kingston Uni
Safely Supporting Probabilistic Data: PL Techniques as Part of the Story Dan Grossman University of Washington.
Chapter 28 Formal Modeling and Verification
Semantics In Text: Chapter 3.
Program Verification with Hoare Logic
CSE 1020:Software Development
Sculptor: Flexible Approximation with
Presentation transcript:

Rely: Verifying Quantitative Reliability for Programs that Execute on Unreliable Hardware Michael Carbin, Sasa Misailovic, and Martin Rinard MIT CSAIL

Image Scaling

Image Scaling Kernel: Bilinear Interpolation =

Bilinear Interpolation int bilinear_interpolation(int i, int j, int src[][], int dest[][]) { int i_src = map_y(i, src, dest), j_src = map_x(j, src, dest); int up = i_src - 1, down = i_src + 1, left = j_src – 1, right = j_src + 1; int val = src[up][left] + src[up][right] + src[down][right] + src[down][left]; return 0.25 * val; } int bilinear_interpolation(int i, int j, int src[][], int dest[][]) { int i_src = map_y(i, src, dest), j_src = map_x(j, src, dest); int up = i_src - 1, down = i_src + 1, left = j_src – 1, right = j_src + 1; int val = src[up][left] + src[up][right] + src[down][right] + src[down][left]; return 0.25 * val; }

Bilinear Interpolation int bilinear_interpolation(int i, int j, int src[][], int dest[][]) { int i_src = map_y(i, src, dest), j_src = map_x(j, src, dest); int up = i_src - 1, down = i_src + 1, left = j_src – 1, right = j_src + 1; int val = src[up][left] + src[up][right] + src[down][right] + src[down][left]; return 0.25 * val; }

Unreliable Hardware Unreliable Units (ALUs and Memories) May produce incorrect results Faster, smaller, and lower power Registers Memory CU CPU ALU

Image Scaling with Approximate Bilinear Interpolation 20%40% 60%80% 99% 99.9% 90% Reliability

Unreliable Hardware Necessitates Hardware Specification: probability operations execute correctly Software Specification: required reliability of computations Analysis: verify software satisfies its specification on hardware Registers Memory CU CPU ALU

Rely: a Language for Quantitative Reliability 20%40% 60%80% 99% 99.9% 90% Reliability Hardware Specification (Architect) Hardware Specification (Architect) Software Specification (Developer) Software Specification (Developer) Static Analysis (Language) Static Analysis (Language)

Hardware Specification hardware { operator (+) = ^-7; operator (-) = ^-7; operator (*) = ^-7; operator (<) = ^-7; memory urel {rd = ^-7, wr = 1}; } hardware { operator (+) = ^-7; operator (-) = ^-7; operator (*) = ^-7; operator (<) = ^-7; memory urel {rd = ^-7, wr = 1}; }

Approximate Bilinear Interpolation in Rely int bilinear_interpolation(int i, int j, int src[][], int dest[][]) { int i_src = map_y(i, src, dest), j_src = map_x(j, src, dest); int up = i_src - 1, down = i_src + 1, left = j_src – 1, right = j_src + 1; int val = src[up][left] +. src[up][right] +. src[down][right] +. src[down][left]; return 0.25 *. val; } int bilinear_interpolation(int i, int j, int src[][], int dest[][]) { int i_src = map_y(i, src, dest), j_src = map_x(j, src, dest); int up = i_src - 1, down = i_src + 1, left = j_src – 1, right = j_src + 1; int val = src[up][left] +. src[up][right] +. src[down][right] +. src[down][left]; return 0.25 *. val; } Unreliable Operations: executed on unreliable ALUs

Approximate Bilinear Interpolation in Rely int bilinear_interpolation(int i, int j, int in urel src[][], int in urel dest[][]) { int i_src = map_y(i, src, dest), j_src = map_x(j, src, dest); int up = i_src - 1, down = i_src + 1, left = j_src – 1, right = j_src + 1; int in urel val = src[up][left] +. src[up][right] +. src[down][right] +. src[down][left]; return 0.25 *. val; } int bilinear_interpolation(int i, int j, int in urel src[][], int in urel dest[][]) { int i_src = map_y(i, src, dest), j_src = map_x(j, src, dest); int up = i_src - 1, down = i_src + 1, left = j_src – 1, right = j_src + 1; int in urel val = src[up][left] +. src[up][right] +. src[down][right] +. src[down][left]; return 0.25 *. val; } Unreliable Memories: stored in unreliable SRAM/DRAM

What is reliability?

Semantics of Reliability

Approximate Bilinear Interpolation Reliability Specification int bilinear_interpolation(int i, int j, int in urel src[][], int in urel dest[][]); int bilinear_interpolation(int i, int j, int in urel src[][], int in urel dest[][]);

Reliability of output is a function of reliability of inputs Approximate Bilinear Interpolation Reliability Specification int bilinear_interpolation(int i, int j, int in urel src[][], int in urel dest[][]); int bilinear_interpolation(int i, int j, int in urel src[][], int in urel dest[][]);

Reliability of output is a function of reliability of inputs The term R(i, j, src, dest) abstracts the joint reliability of the function’s inputs on entry Approximate Bilinear Interpolation Reliability Specification int bilinear_interpolation(int i, int j, int in urel src[][], int in urel dest[][]); int bilinear_interpolation(int i, int j, int in urel src[][], int in urel dest[][]);

Reliability of output is a function of reliability of inputs The term R(i, j, src, dest) abstracts the joint reliability of the function’s inputs on entry Coefficient.99 bounds reliability degradation Approximate Bilinear Interpolation Reliability Specification int bilinear_interpolation(int i, int j, int in urel src[][], int in urel dest[][]); int bilinear_interpolation(int i, int j, int in urel src[][], int in urel dest[][]);

How does Rely verify reliability?

Rely’s Analysis Framework Precondition generator for statements { Precondition } s { Postcondition } { Precondition } s { Postcondition } SpecificationComputation

Assignment Rule

Unmodified

Assignment Rule Standard Substitution

Assignment Rule

int bilinear_interpolation(int i, int j, int in urel src[][], int in urel dest[][]) { int i_src = map_y(i, src, dest), j_src = map_x(j, src, dest); int up = i_src - 1, down = i_src + 1, left = j_src – 1, right = j_src + 1; int in urel val = src[up][left] +. src[up][right] +. src[down][right] +. src[down][left]; return 0.25 *. val; } int bilinear_interpolation(int i, int j, int in urel src[][], int in urel dest[][]) { int i_src = map_y(i, src, dest), j_src = map_x(j, src, dest); int up = i_src - 1, down = i_src + 1, left = j_src – 1, right = j_src + 1; int in urel val = src[up][left] +. src[up][right] +. src[down][right] +. src[down][left]; return 0.25 *. val; } Verifying the Reliability of Bilinear Interpolation

1.Generate postcondition from return statement 2.Work backwards to produce verification condition 3.Use hardware specification to replace reliabilities return 0.25 *. val; Reliability of return Reliability of sum of neighbors

Verifying the Reliability of Bilinear Interpolation 1.Generate postcondition from return statement 2.Work backwards to produce verification condition 3.Use hardware specification to replace reliabilities 4.Discharge Verification Condition return 0.25 *. val;

Verification Condition Checking Insight

Conjunct Checking A conjunct is implied by a pair of constraints Decidable, efficiently checkable, and input distribution agnostic

Verification Condition Checking for Approximate Bilinear Interpolation Hardware Specification Data Dependences

What about…programs? (conditionals, loops, and functions)

Conditionals if (y >. 0) x = x +. 1 x = 2 *. x +. 1

x 1 = x x 2 = 2 *. x Conditionals

x 1 = x x 2 = 2 *. x

Conditionals x 1 = x x 2 = 2 *. x Spec ≤ R(x)

Conditionals x 1 = x x 2 = 2 *. x Spec ≤ R(x)

Conditionals x 1 = x x 2 = 2 *. x Spec ≤ R(x)

Conditionals x 1 = x x 2 = 2 *. x Spec ≤ R(x)

Simplification x 1 = x x 2 = 2 *. x Spec ≤ R(x)

Simplification x 1 = x x 2 = 2 *. x Spec ≤ R(x)

Reliability of loop-carried, unreliably updated variables decreases monotonically Finitely Bounded Loops: bounded decrease Unbounded loops: conservative result is 0 int sum = 0; for (int i = 0; i < n; i = i + 1) { sum = sum +. a[i]; } int sum = 0; for (int i = 0; i < n; i = i + 1) { sum = sum +. a[i]; } Loops R( sum) depends on n unreliable adds

Functions Verification is modular (assume/guarantee) Recursion similar to loops: unreliably updated variables naturally have 0 reliability

Rely: a Language for Quantitative Reliability 20%40% 60%80% 99% 99.9% 90% Reliability Hardware Specification (Architect) Hardware Specification (Architect) Software Specification (Developer) Software Specification (Developer) Static Analysis (Language) Static Analysis (Language)

Evaluation Experiment #1: verify specifications How does the analysis behave?

Benchmarks newton: zero-finding using Newton’s method secant: zero-finding using Secant Method coord: Cartesian to polar coordinate converter search_ref: motion estimation mat_vec: matrix-vector multiply hadamard: frequency-domain pixel-block difference metric

Experiment #1: Results Observation: small number of conjuncts with simplification

Evaluation Experiment #2: application scenarios How to use reliabilities?

Checkable Computations

Approximate Computations High Quality Bilinear Interpolation Reliability (as Negative Log Failure Probability) Quality Target Reliability

Other Concerns for Unreliable Hardware Safety: does the program always produce a result? –no failures or ill-defined behaviors [Misailovic et al. ICSE ’10; Carbin et al. ISSTA ’10; Sidiroglou et al. FSE’11; Carbin et al., PLDI ’12; Carbin et al., PEPM ’13] Accuracy: is result accurate enough? –small expected error [Rinard ICS’06; Misailovic et al.,ICSE ’10; Hofffmann at al. ASPLOS ’11; Misailovic et al. SAS ’11; Sidiroglou et al. FSE’11; Zhu et al. POPL ’12; Misailovic et al. RACES ‘12]

Takeaway Separating approximate computation isn’t enough Acceptability of results depends on reliability Rely Architect provides hardware specification Develo per provides software specification Rely provides verified reliability guarantee

Backup Slides

Execution of e is a stochastic process Independent probability of failure for each operation Reliability is probability of fully reliable path Semantic Model

Semantic Formalization See paper for inference rules!

Identifying Reliably Update Variabes Reliably updated vs. unreliably updated variables Dependence graph gives classification Reliably updated variables have same reliability int sum = 0; for (int i = 0; i < n; i = i + 1) { sum = sum +. a[i]; } int sum = 0; for (int i = 0; i < n; i = i + 1) { sum = sum +. a[i]; } i suma n