27
Effect of Compiler Optimizations on the Error Resilience of Soft Computing Applications Anna Thomas, Jacques Clapauch, Karthik Pattabiraman University of British Columbia (UBC)

Effect of Compiler Optimizations on the Error Resilience of Soft …blogs.ubc.ca/karthik/files/2013/06/AER13-anna.pdf · 2013. 6. 11. · Conclusion and Future Work 23 Compiler optimizations:

  • Upload
    others

  • View
    0

  • Download
    0

Embed Size (px)

Citation preview

  • Effect of Compiler Optimizations on the Error Resilience of Soft Computing Applications

    Anna Thomas, Jacques Clapauch, Karthik Pattabiraman

    University of British Columbia (UBC)

  • Soft Computing Applications

    2

     Applications in AI, multimedia processing  Expected to dominate future workloads [Dubey’07]  Tolerate many kinds of faults in data – Error Resilient

    Original image (left) versus faulty image from JPEG decoder

  • Egregious Data Corruptions (EDCs)

    3

     Large or unacceptable deviation in output  Based on fidelity metric (e.g., PSNR < 30)

    EDC image (PSNR of 11.37) of JPEG vs Non-EDC image (PSNR of 44.79)

  • Goal

    4

     Detect EDC causing faults

    Non-EDC

    EDC

    Detector

    Benign

    Pre-emptive

    Selective

    Application Execution

  • Preliminary Fault Injection Study

    5

    Execute Application

    Choose dynamic data instance at

    random

    Inject Random Single bit flip

    Compare faulty &

    fault-free outcome

    Crash Fidelity Metric

    Benign

    EDC

    Non- EDC

    No Change

    Exception Value Change

    Low Deviation

    High deviation

  • Why focus on EDC Causing Faults?

    6

    Blindly detecting all faults is wasteful !

      92% : tolerable outcomes

     Media-bench programs: Soft-computing applications

  • Background

    7

    Static analysis algorithm to identify detector locations for EDCs [DSN 2013 – Anna Thomas]

    Compiler EDC

    Ranking Algorithm

    Selection Algorithm

    IR

    Application Source Code

    Performance Overhead

    Data Variables or Locations to Protect

    Execution Profile

    Backward slice replication

  • Background: EDC Coverage of technique

    8

    Average EDC Coverage of 85% at 20% performance overhead

  • This Paper

    9

    Compiler Optimizations

    Improve Performance! Resilience

    End Goal: Identify optimizations that guarantee error resilience

    Performance - resilience trade off space

  • Outline

    10

      Background

      Problem and Approach

      Experimental Setup and Results

      Conclusion

  • Problem

    11

    Optimizations affect error resilience

    Affect Baseline

    Resilience (EDC Rate)

    Affect EDC Coverage of

    our technique

    How do optimizations affect the error resilience of soft computing applications, with our technique ?

  • Approach

    12

     Identified common compiler optimizations

     Performed fault injections on unoptimized and optimized versions of soft computing apps

     Studied the effect of optimizations:  Baseline resilience  EDC coverage of our technique

  • Compiler Optimizations

    13

     Identified four optimizations in LLVM compiler (of 15)   InstCombine   LICM   Loop Unroll   SCCP

  • Compiler Optimizations

    14

     Identified four optimizations in LLVM compiler (of 15)   InstCombine  LICM   Loop Unroll   SCCP

     Why these optimizations ?   Have conflicting effects on EDC rate

  • Compiler Optimizations

    15

    Combine Redundant Instructions: Inst-Combine

    Redundant Instructions

    Uninteresting Code

    Uninteresting Code

    Combined Instructions

    IC Opt

    High EDC Likelihood

    Lower Probability

    of fault strike

    But…

    Conflicting effect on EDC rate!

  • Compiler Optimizations

    16

    Loop Invariant Code Motion: LICM

    Invariant Code

    Loop Body

    Loop Header

    LICM

    Loop Body

    Loop Header

    Invariant Code

    High EDC Likelihood

    Lower Probability

    of fault strike

    But…

    Conflicting effect on EDC rate!

  • Outline

    17

      Background

      Problem and Approach

      Experimental Setup and Results

      Conclusion

  • Experimental Setup

    18

     Six Benchmarks from MediaBench and Parsec Suite   Fidelity Metric: PSNR, scaled distortion [Misailovic12]   EDC thresholds based on visual perception or 30% of SDCs

     Performed fault injections using LLFI [Thomas 13]   5000 fault injections per benchmark per optimization   Error Bars: (± 0.8% at 95% CI)

     Measured coverage under 20% performance overhead   Coverage = (No of EDCs detected / total no of EDCs)*100

  • Baseline Resilience: EDC Percentages

    19

    Bench-mark

    Inst- Combine LICM

    Loop- Unroll SCCP UnOpt

    Blackscholes 9.9 9.48 8.48 9.38 10

    X264 2.48 2.96 2.82 2.1 2.24

    Canneal 4.56 3.26 3.26 3.94 3.32

    Swaptions 2.5 3.12 2.44 2.98 2.36

    JPEG 3.68 3.56 4.16 4.08 3.76

    MPEG2 2 2.1 2.56 1.7 2.3

    Average 4.19 4.08 3.95 4.03 3.99

  • EDC Coverage: InstCombine

    20

    Safe Optimization: Within 5% lower than baseline

  • EDC Coverage: LICM

    21

  • Outline

    22

      Background

      Problem and Approach

      Experimental Setup and Results

      Conclusion

  • Conclusion and Future Work

    23

     Compiler optimizations: Characterize performance-resilience trade off in soft computing applications  Baseline resilience lowered in some benchmarks  Our technique preserves resilience in most cases

    Future Work   Include more optimizations – ongoing work   Classify optimizations into resilience packages   Decision tree for applying optimizations

    Contact: Anna Thomas

  • Backup Slides

    24

  • Compiler Optimizations

    25

    Loop Unrolling: Loop-Unroll

    Loop Termination Condition

    Loop Body

    Unroll

    Loop Termination Condition

    Unrolled Loop Body

    Low chance of fault strike

    Lower EDC rate on Loop-Unrolled Code?

  • Compiler Optimizations

    26

    Sparse Conditional Constant Propagation: SCCP

    Conditional branches & constants

    Uninteresting Code

    SCCP

    Conditionals removed

    (Optimized code)

    Uninteresting Code

    High EDC Likelihood

    Higher EDC rate on SCCP optimized Code?

  • LLVM Fault Injector LLFI

    27

    LLFI: Fault Injector at LLVM compiler’s intermediate code level [Thomas’13]

      easy source code mapping