Using Loop Invariants to Detect Transient Faults in

  • Slides: 17
Download presentation
Using Loop Invariants to Detect Transient Faults in the Data Caches Seung Woo Son,

Using Loop Invariants to Detect Transient Faults in the Data Caches Seung Woo Son, Sri Hari Krishna Narayanan and Mahmut T. Kandemir Microsystems Design Lab. The Pennsylvania State University 6/12/2004 MDL@PSU

LCTES 04 -Student Forum Related Work – H/W n Hardware fault detection usually involves

LCTES 04 -Student Forum Related Work – H/W n Hardware fault detection usually involves a combination of n n n Information redundancy (e. g. , ECC, parity, etc. ) Temporal redundancy (e. g. , executing the same instruction twice in the same functional unit, but at different times) Spatial redundancy (e. g. , executing same instruction in different functional units) 6/12/2004 MDL@PSU 2

LCTES 04 -Student Forum Related Work -S/W n Replication of the program execution and

LCTES 04 -Student Forum Related Work -S/W n Replication of the program execution and the check of the results n n n Recovery Blocks N-Version Programming Introduction of some control code into the program n n n ABFT Assertions Code Flow Checking 6/12/2004 MDL@PSU 3

LCTES 04 -Student Forum Our Approach n n Use loop invariants to detect transient-faults

LCTES 04 -Student Forum Our Approach n n Use loop invariants to detect transient-faults What is a loop invariant? n n Why target loops? n n It is data or a property that does not change during execution of a loop. Loops make up 90% of the execution time. Our usage of invariants n n If invariant value has changed, then soft error has occurred, modifying the data in cache. In that case, re-perform iterations. 6/12/2004 MDL@PSU 4

LCTES 04 -Student Forum Bubble Sort Algorithm Bubblesort(sequence): Input: sequence of integers sequence Post-condition:

LCTES 04 -Student Forum Bubble Sort Algorithm Bubblesort(sequence): Input: sequence of integers sequence Post-condition: sequence is sorted & contains the same integers as the original sequence length = length of sequence for i = 0 to length - 1 do for j = 0 to length - i -2 do if jth element of sequence >(j+1)th element of sequence then swap jth and (j+1)th element of sequence 6/12/2004 MDL@PSU 5

LCTES 04 -Student Forum Bubble Sort-Sample Invariants n Loop Invariant – Outer Loop: n

LCTES 04 -Student Forum Bubble Sort-Sample Invariants n Loop Invariant – Outer Loop: n n Last i elements of sequence are sorted and are all greater or equal to the other elements of the sequence. Loop Invariant – Inner Loop: n Same as outer loop and the jth element of sequence is greater or equal to the first j elements of sequence. 6/12/2004 MDL@PSU 6

LCTES 04 -Student Forum The Big Picture: How does the Project Work? n n

LCTES 04 -Student Forum The Big Picture: How does the Project Work? n n Use an Invariant Detector to detect invariants in code. Incorporate ‘checker code’ into the source code -> hardened version Run this code in a modified version of Simple. Scalar that injects errors into memory and cache. Calculate how our method performs 6/12/2004 MDL@PSU 7

LCTES 04 -Student Forum The Daikon Invariant Detector n n n Daikon - developed

LCTES 04 -Student Forum The Daikon Invariant Detector n n n Daikon - developed at the Program Analysis Group at MIT. Dynamically detects invariants about a program’s data structures Limitations n n n It only targets procedural invariants Does not target loops Does not consider local variables 6/12/2004 MDL@PSU 8

LCTES 04 -Student Forum Daikon Usage n n n Modify our Source Code such

LCTES 04 -Student Forum Daikon Usage n n n Modify our Source Code such that Daikon can detect loop invariants Instrument the Source Code Run Test Suites on Instrumented code to create Trace Files Detect invariants in Trace Files Incorporate Invariant Checker code in the Source Code 6/12/2004 MDL@PSU 9

LCTES 04 -Student Forum Fault Injection Mechanism n n Modified Simple. Scalar v 3.

LCTES 04 -Student Forum Fault Injection Mechanism n n Modified Simple. Scalar v 3. 0 d to inject faults Randomly generate faults on memory access operation n Memory corruption routines from Angshuman’s In our study, we randomly flip one bit of memory data during memory and cache read/write operations Generate statistics for faults injected 6/12/2004 MDL@PSU 10

LCTES 04 -Student Forum Detected loop invariant – bubble sort … a != null

LCTES 04 -Student Forum Detected loop invariant – bubble sort … a != null a[i] > i i >= 1 n == 100 a[i. . ] sorted by < a[0. . i] sorted by > i < size(a[])-1 i < a[i-1] … 6/12/2004 -> easy -> medium -> easy MDL@PSU 11

LCTES 04 -Student Forum Detected loop invariant – matrix multiplication … size(a[]) == size(b[])

LCTES 04 -Student Forum Detected loop invariant – matrix multiplication … size(a[]) == size(b[]) i >= 0 b[] contains no duplicates b[] elements != null b[] == a[] + 3120 … 6/12/2004 -> easy -> difficult -> medium -> useless MDL@PSU 12

LCTES 04 -Student Forum Experiment Setup n Bubble Sort n n Array size =

LCTES 04 -Student Forum Experiment Setup n Bubble Sort n n Array size = 100 # of iteration = 150 Total # of instruction simulated: 68, 019, 732 Matrix Multiplication n Array size = 100 x 100 # of iteration = 1 Total # of instruction simulated: 65, 547, 520 6/12/2004 MDL@PSU 13

LCTES 04 -Student Forum Detection Rate 6/12/2004 MDL@PSU 14

LCTES 04 -Student Forum Detection Rate 6/12/2004 MDL@PSU 14

LCTES 04 -Student Forum Detection overhead - code increase 6/12/2004 MDL@PSU 15

LCTES 04 -Student Forum Detection overhead - code increase 6/12/2004 MDL@PSU 15

LCTES 04 -Student Forum Conclusion n n Developed a soft error detection technique using

LCTES 04 -Student Forum Conclusion n n Developed a soft error detection technique using loop-invariants Detection rate varies according to the characteristics of the applications n n Different programs have different loop invariants Performance degradation due to faulthardened code 6/12/2004 MDL@PSU 16

LCTES 04 -Student Forum Future Work n n Better invariant generation mechanism that generated

LCTES 04 -Student Forum Future Work n n Better invariant generation mechanism that generated loop invariants directly Automatic Classification of Invariants Automatic Assertion generator in Source Code More accurate fault injection 6/12/2004 MDL@PSU 17