Programming Abstractions for Approximate Computing Michael Carbin with Sasa Misailovic, Hank Hoffmann, Deokhwan Kim, Stelios Sidiroglou, Martin Rinard.

Slides:



Advertisements
Similar presentations
Chapter 24 Numerics Bjarne Stroustrup
Advertisements

Copyright W. Howden1 Programming by Contract CSE 111 6/4/2014.
Abstraction and Modular Reasoning for the Verification of Software Corina Pasareanu NASA Ames Research Center.
Constraint Semantics for Abstract Read Permissions 28 th July 2014, FTfJP, Uppsala John Tang Boyland (UW-Milwaukee/ETH Zurich) Peter Müller, Malte Schwerhoff,
11111 Functional Program Verification CS 4311 A. M. Stavely, Toward Zero Defect Programming, Addison-Wesley, Y. Cheon and M. Vela, A Tutorial on.
A Randomized Dynamic Program Analysis for Detecting Real Deadlocks Koushik Sen CS 265.
Swarat Chaudhuri Rice University Biplab Deka Rakesh Kumar UIUC Principled Approximations in Probabilistic Programming.
Accuracy-Aware Program Transformations Sasa Misailovic MIT CSAIL.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 20 Slide 1 Critical systems development.
Randomized Accuracy Aware Program Transformations for Efficient Approximate Computations Sasa Misailovic Joint work with Zeyuan Allen ZhuJonathan KelnerMartin.
All Hands Meeting, 2006 Title: Grid Workflow Scheduling in WOSE (Workflow Optimisation Services for e- Science Applications) Authors: Yash Patel, Andrew.
Progress Guarantee for Parallel Programs via Bounded Lock-Freedom Erez Petrank – Technion Madanlal Musuvathi- Microsoft Bjarne Steensgaard - Microsoft.
1 These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 5/e and are provided with permission by.
Software Testing and Quality Assurance
CS 330 Programming Languages 09 / 18 / 2007 Instructor: Michael Eckmann.
Dynamically Discovering Likely Program Invariants to Support Program Evolution Michael Ernst, Jake Cockrell, William Griswold, David Notkin Presented by.
CS590 Z Software Defect Analysis Xiangyu Zhang. CS590F Software Reliability What is Software Defect Analysis  Given a software program, with or without.
Design of Fault Tolerant Data Flow in Ptolemy II Mark McKelvin EE290 N, Fall 2004 Final Project.
OOP #10: Correctness Fritz Henglein. Wrap-up: Types A type is a collection of objects with common behavior (operations and properties). (Abstract) types.
Copyright © 2006 The McGraw-Hill Companies, Inc. Programming Languages 2nd edition Tucker and Noonan Chapter 18 Program Correctness To treat programming.
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by.
Describing Syntax and Semantics
School of Computer ScienceG53FSP Formal Specification1 Dr. Rong Qu Introduction to Formal Specification
Formal verification Marco A. Peña Universitat Politècnica de Catalunya.
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.
Thread-modular Abstraction Refinement Thomas A. Henzinger, et al. CAV 2003 Seonggun Kim KAIST CS750b.
TASK ADAPTATION IN REAL-TIME & EMBEDDED SYSTEMS FOR ENERGY & RELIABILITY TRADEOFFS Sathish Gopalakrishnan Department of Electrical & Computer Engineering.
CS527: (Advanced) Topics in Software Engineering Overview of Software Quality Assurance Tao Xie ©D. Marinov, T. Xie.
Towards a Logic for Wide- Area Internet Routing Nick Feamster Hari Balakrishnan.
1 Debugging and Testing Overview Defensive Programming The goal is to prevent failures Debugging The goal is to find cause of failures and fix it Testing.
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.
Bug Localization with Machine Learning Techniques Wujie Zheng
Delivering Integrated, Sustainable, Water Resources Solutions Monte Carlo Simulation Robert C. Patev North Atlantic Division – Regional Technical Specialist.
Synchronization Transformations for Parallel Computing Pedro Diniz and Martin Rinard Department of Computer Science University of California, Santa Barbara.
Aritra Sengupta, Swarnendu Biswas, Minjia Zhang, Michael D. Bond and Milind Kulkarni ASPLOS 2015, ISTANBUL, TURKEY Hybrid Static-Dynamic Analysis for Statically.
Software Testing and Quality Assurance Software Quality Assurance 1.
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 programs March CSE 403, Winter 2011, Brun.
Reasoning about Relaxed Programs Michael Carbin Deokhwan Kim, Sasa Misailovic, and Martin Rinard.
COP4020 Programming Languages Introduction to Axiomatic Semantics Prof. Robert van Engelen.
An Axiomatic Basis for Computer Programming Robert Stewart.
1 These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 5/e and are provided with permission by.
Motivation  Parallel programming is difficult  Culprit: Non-determinism Interleaving of parallel threads But required to harness parallelism  Sequential.
CSCI1600: Embedded and Real Time Software Lecture 28: Verification I Steven Reiss, Fall 2015.
Automated Debugging with Error Invariants TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: AAA A A A AA A A Chanseok Oh.
Student: Shaobo He, Advisor: Zvonimir Rakamarić TOWARDS AUTOMATED DIFFERENTIAL PROGRAM VERIFICATION FOR APPROXIMATE COMPUTING.
Introduction to Hardware Verification ECE 598 SV Prof. Shobha Vasudevan.
A Calculus of Atomic Actions Tayfun Elmas, Shaz Qadeer and Serdar Tasiran POPL ‘ – Seminar in Distributed Algorithms Cynthia Disenfeld 27/05/2013.
C++ for Engineers and Scientists, Second Edition 1 Problem Solution and Software Development Software development procedure: method for solving problems.
Rely: Verifying Quantitative Reliability for Programs that Execute on Unreliable Hardware Michael Carbin, Sasa Misailovic, and Martin Rinard MIT CSAIL.
CSC 395 – Software Engineering Lecture 27: White-Box Testing.
This project and the research leading to these results has received funding from the European Community’s Seventh Framework Programme [FP7 / ]
CS 5150 Software Engineering Lecture 21 Reliability 2.
Jeremy Nimmer, page 1 Automatic Generation of Program Specifications Jeremy Nimmer MIT Lab for Computer Science Joint work with.
A Review of Software Testing - P. David Coward
Types for Programs and Proofs
Matching Logic An Alternative to Hoare/Floyd Logic
Combining Logical and Probabilistic Reasoning in Program Analysis
Chapter 10 Verification and Validation of Simulation Models
Safely Supporting Probabilistic Data: PL Techniques as Part of the Story Dan Grossman University of Washington.
Model Checking for an Executable Subset of UML
Programming Languages 2nd edition Tucker and Noonan
Avidan Efody, Mentor Graphics Corp.
CSE 1020:Software Development
Programming Languages 2nd edition Tucker and Noonan
COP4020 Programming Languages
Verification and Validation of Simulation Models
Sculptor: Flexible Approximation with
Presentation transcript:

Programming Abstractions for Approximate Computing Michael Carbin with Sasa Misailovic, Hank Hoffmann, Deokhwan Kim, Stelios Sidiroglou, Martin Rinard MIT

Challenges for Programming Expression (specifying approximations) Reasoning (verifying resulting program) Debugging (reproducing failures) Deployment (changes in assumptions)

Challenges for Programming Expression (specifying approximations) Reasoning (verifying resulting program) Debugging (reproducing failures) Deployment (changes in assumptions)

Fundamental Questions Scope What do we approximate and how? Specifications of “Correctness” What is correctness? Reasoning How do we reason about correctness?

What do we approximate? Domains have inherent uncertainty Execution time dominated by a fraction of code [Misailovic, Carbin, Achour, Qi, Rinard MIT-TR 14]

Approximation Transformations Approximate Hardware PCMOS, Palem et al. 2005; Narayanan et al., DATE ’10; Liu et al. ASPLOS ’11; Sampson et al, PLDI ’11; Esmaeilzadeh et al., ASPLOS ’12, MICRO’ 12 Function Substitution Hoffman et al., APLOS ’11; Ansel et al., CGO ’11; Zhu et al., POPL ‘12 Approximate Memoization Alvarez et al., IEEE TOC ’05; Chaudhuri et al., FSE ’12; Samadi et al., ASPLOS ’14 Relaxed Synchronization (Lock Elision) Renganarayana et al., RACES ’12; Rinard, HotPar ‘13; Misailovic, et al., RACES ’12 Code Perforation Rinard, ICS ‘06; Baek et al., PLDI 10; Misailovic et al., ICSE ’10; Sidiroglou et al., FSE ‘11; Misailovic et al., SAS ‘11; Zhu et al., POPL ‘12; Carbin et al. PEPM ’13;

float sum = 0; for (int i = 0; i < n; i += 1) { sum = sum + a[i]; } float avg = sum / n; float sum = 0; for (int i = 0; i < n; i += 1) { sum = sum + a[i]; } float avg = sum / n; Example: Loop Perforation

float sum = 0; for (int i = 0; i < n; i += 1) { sum = sum + a[i]; } float avg = sum / n; float avg = (sum * 2) / n; float sum = 0; for (int i = 0; i < n; i += 1) { sum = sum + a[i]; } float avg = sum / n; float avg = (sum * 2) / n; Example: Loop Perforation i += 2 Skip iterations (or truncate or random subset) Potentially add extrapolations to reduce bias

Traditional Transformation ≡.c What is correctness?

Approximate Transformation.c What is correctness?

Safety: satisfies standard unary assertions (type safety, memory safety, partial functionality) Accuracy: program satisfies relational assertions that constrain difference in results

Relational Assertions Contribution: program logic and verification system that supports verifying relationships between implementations x : value of x in original implementation x : value of x in approximate implementation relate |x - x | / x <=.1; [Carbin, Kim, Misailovic, Rinard PLDI’12, PEPM ‘13]

float sum = 0; for (int i = 0; i < n; i += 1) { sum = sum + a[i]; } float avg = sum / n; float avg = (sum * 2) / n; float sum = 0; for (int i = 0; i < n; i += 1) { sum = sum + a[i]; } float avg = sum / n; float avg = (sum * 2) / n; Example: Loop Perforation i += 2

Worst-case error: float sum = 0; for (int i = 0; i < n; i += 1) { sum = sum + a[i]; } float avg = sum / n; float avg = (sum * 2) / n; float sum = 0; for (int i = 0; i < n; i += 1) { sum = sum + a[i]; } float avg = sum / n; float avg = (sum * 2) / n; Example: Loop Perforation i += 2

Novel Safety Verification Concept Assume validity of assertions in original program Use relations to prove that approximation does not change validity of assertions Lower verification complexity than verifying an assertion outright assert (safe(*p)) p == p safe(*p ) ∧

Specifications and Reasoning Worst-case (for all inputs) Non-interference [Sampson et al., PLDI ‘11] Assertions [Carbin et al., PLDI ‘12; PEPM ‘13] Accuracy [Carbin et al., PLDI ‘12] Statistical (with some probability) Assertions [Sampson et al., PLDI ‘14] Reliability [Carbin, Misailovic, and Rinard, OOPSLA ‘13] Expected Error [Zhu, Misailovic et al., POPL ‘13] Probabilistic Error Bounds [Misailovic et al., SAS ‘13]

Questions from Computer Science

Question #1: “Programmers will never do this.” - Unnamed Systems and PL Researchers

Challenge Reasoning Complexity Types Partial Specifications Full Functional Correctness Expressivity

Challenge Reasoning Complexity Types Partial Specifications Full Functional Correctness Expressivity Ordering of unary assertions still true (improved by relational verification)

Challenge Worst-case AccuracyReliability Probabilistic Accuracy BoundsProbabilistic Assertions Error DistributionsExpected Error Reasoning Complexity Expressivity Performance/Energy Benefit Assertions

float sum = 0; for (int i = 0; i < n; i += 1) { sum = sum + a[i]; } float avg = sum / n; float avg = (sum * 2) / n; float sum = 0; for (int i = 0; i < n; i += 1) { sum = sum + a[i]; } float avg = sum / n; float avg = (sum * 2) / n; Example: Loop Perforation (Misailovic et al., SAS ‘11) i += 2

Worst-case error: Probabilistic Error Bound (.95): float sum = 0; for (int i = 0; i < n; i += 1) { sum = sum + a[i]; } float avg = sum / n; float avg = (sum * 2) / n; float sum = 0; for (int i = 0; i < n; i += 1) { sum = sum + a[i]; } float avg = sum / n; float avg = (sum * 2) / n; Example: Loop Perforation (Misailovic et al., SAS ‘11) i += 2

Question #2: “There’s no hope for building approximate hardware.” - Unnamed Computer Architect

Challenge Approx. PL community must work with hardware community to collaborate on models (not the PL community’s expertise) Approx. hardware community faces major challenge in publishing deep architectural changes: simulation widely panned Moving forward may require large joint effort

Question #3: “I believe your techniques are fundamentally flawed.” - Unnamed Numerical Analyst

Challenge Numerical analysts have been wronged Programming systems have failed to provide support for making the statements they desire Approximate computing community risks repeating work done by numerical analysis Opportunity for collaboration New research opportunities It’s no longer just about floating-point

Broadly Accessible Motivations Programming with uncertainty (uncertain operations and data) Programming unrealizable computation (large scale numerical simulations) Useful computation from non-digital fabrics (analog, quantum, biological, and human) Opportunity to build reliable and resilient computing systems built upon anything

End

Conclusion Adoption hinges on tradeoff between expressivity, complexity and benefit Opportunity/necessity for tighter integration of PL and hardware communities

Open Challenges and Directions Problem: benefits (performance/energy) may vary between different types of guarantees Worst-case Accuracy Reliability Probabilistic Accuracy Bounds Probabilistic Assertions Error Distributions Expected Accuracy Reasoning Complexity Expressivity

Open Challenges and Directions Expressivity and Reasoning Complexity Type Checking Partial Specifications Full Functional Correctness

Experimental Results

Open Challenges Directions Traditional Tradeoff Reasoning Complexity Performance/Energy Type Checking Partial Specifications Dynamic Analysis Full Functional Correctness