Compiler Support for Efficient Software-only Checkpointing - PowerPoint PPT Presentation

About This Presentation
Title:

Compiler Support for Efficient Software-only Checkpointing

Description:

Title: Slide 1 Author: Karen Last modified by: Chuck Zhao Created Date: 3/24/2005 4:31:59 PM Document presentation format: On-screen Show (4:3) Company – PowerPoint PPT presentation

Number of Views:69
Avg rating:3.0/5.0
Slides: 47
Provided by: Kare349
Category:

less

Transcript and Presenter's Notes

Title: Compiler Support for Efficient Software-only Checkpointing


1
Compiler Support for Efficient Software-only
Checkpointing
  • Chuck (Chengyan) Zhao
  • Dept. of Computer Science
  • University of Toronto
  • Ph.D. Thesis Exam
  • Sept. 07, 2012

2
Execution Going Backward?
  • A time-travel machine
  • going back to the past
  • arbitrary distance
  • unlimited number of attempts
  • no special hardware support
  • efficient
  • Benefits
  • debugging
  • software backtracking

3
Checkpointing (CKPT) Can Help
  • Checkpointing
  • A process to take program snapshots
  • Recover execution when error happens
  • Enhance reliability and robustness
  • Existing Checkpointing Approaches
  • Hardware-based fine-grain solutions
  • Software-only coarse-grain solutions
  • Our Proposed Solution Fine-grain Software-only
    CKPT

4
Fine-grain Checkpointing
a b
main memory
1
5
/
/
a 5 b 7
Checkpoint region
2
7
/
/
failure recovery
(a, 1) (b, 2)
checkpoint buffer
5
Our Proposed Checkpointing Approach
  • An Efficient Software Checkpointing Framework
  • Software only
  • no need for hardware support
  • Cover arbitrarily large code region
  • dynamically allocate ckpt buffer
  • Leverage compiler optimizations
  • aggressive overhead reduction
  • Example Applications
  • Program debugging
  • Automatic software backtracking

6
Compiler Checkpointing (CKPT) Framework
C/C
Compiler IR
Optimize Checkpointing
Backend Process
Enable Checkpointing
Annotated source
Source code
7
  • Enabling Checkpointing

8
Transformations to Enable Checkpointing
start_ckpt() backup(a, sizeof(a)) a
handleMemcpy() memcpy(d, s,
len) foo_ckpt() foo() stop_ckpt(cond)
  • 3 Steps
  • Callsite analysis
  • Intra-procedural transformation
  • Inter-procedural transformation

foo() / body of foo() / foo_ckpt() /
body of foo_ckpt() /
9
  • Optimizations

10
Checkpointing Optimization Framework
1. CKPT Inlining
2. Pre Optimization
3. Redundancy Eliminations (3 REs)
4. Hoisting
Optimize Checkpointing
5. Aggregation
6. Non Rollback Exposed Store Elimination
7. DynMem (Heap) Optimization
8. Array Optimization
9. Post Optimization
11
Redundancy Elimination Optimization
start_ckpt() if (C) backup(a,
sizeof(a)) a backup(a,
sizeof(a)) a backup(a,
sizeof(a)) a stop_ckpt(cond)
  • Algorithm
  • establish dominating relationship
  • stop_ckpt() marker
  • promote leading backup call
  • re-establish dominating relationship
  • among backup calls
  • eliminate all non-leading backup call(s)

RE1 remove all non-leading backup call(s)
12
Rollback Exposed Store
int a, b start_ckpt() b a op
backup(a, sizeof(a)) a
stop_ckpt(cond)
Rollback Exposed Store a store to a location
with a possible previous load of that location
must backup 'a' because the prior load of 'a'
must access the "old" value on rollback i.e.,
'a' is "rollback exposed"
CANT optimize this case!
13
Non-Rollback Exposed Store Elimination (NRESE)
int a, b start_ckpt() backup(a,
sizeof(a)) a stop_ckpt(cond)
  • Algorithm ensure that
  • no use of the address (a) on any path
  • the backup address (a) isnt aliased to anything
  • empty points-to set

no prior use of 'a', hence it is
non-rollback-exposed
we can eliminate the backup required for any
rollback-exposed store
NRESE is a new, checkpoint-specific optimization
14
  • Applications

15
App1 CKPT enabled debugging
T safe point, earlier than P, the program can
reach through checkpoint recovery
  • Key benefits
  • execution rewinding
  • support for large region
  • unlimited of retries
  • avoids entire program re-execution

CKPT Region
P root cause of a bug
Q place where the bug manifests (a user or
programmer notices the bug at this point)
15
16
Simulated Annealing Placement in VPR
  • Key benefits
  • automate support for backtracking
  • backup actions
  • abort
  • commit
  • cover arbitrarily complex algorithm
  • cleaner code, simplify programming
  • programmer focus on algorithm

B
blocks
A

?
C
nets
D
  • Algorithm
  • 1) Start with random placement of blocks
  • 2) Randomly pick a pair of blocks to swap
  • 3) Keep new placement if an improvement

17
  • Evaluation

18
Platform and Benchmarks
  • Evaluation Platform
  • Core i7 920, 4GB DDR3, 200GB SATA
  • Debian6-i386, gcc/g-4.4.5
  • LLVM-2.9
  • Benchmarks
  • BugBench 1.2.0
  • 5 programs with buffer-overflow bugs
  • 3 CKPT regions per program Small . Medium .
    Large
  • VPR 5.0.2
  • FPGA CAD tool, 1 CKPT region
  • CKPT Comparison
  • libCKPT USENIX95 U. Tennessee
  • ICCSTM PLDI 06 STM based on Intel ICC
  • unfair comparison, but closest alternative

19
Compare with Coarse-gain Scheme libCKPT
1
HUGE gain over coarse-grain libCKPT
20
Compare with Fine-gain Scheme ICCSTM
better than fine-grain ICCSTM
21
RE1 Optimization buffer size reduction





21
RE1 is the most-effective optimization
22
Post RE1 Optimization buffer size reduction









22
Other optimizations also contribute
23
Conclusion
  • CKPT Optimization Framework
  • compiler-driven
  • automatic
  • software-only
  • compiler analysis and optimizations
  • 100-1000X less overhead over coarse-grain CKPT
  • 4-50X improvement over fine-grain ICCSTM
  • CKPT-supported Apps
  • debugger execution rewind in time
  • up to 98 of CKPT buffer size reduction
  • up to 95 of backup call reduction
  • VPR automatic software backtracking
  • only 15 CKPT overhead vs. manual checkpointing

24
Questions and Answers
  • ?

25
Algorithm Redundancy Elimination 1
  • Build dominating relationship (DOM) among backup
    calls
  • Identify leading backup call
  • Promote suitable leading backup call
  • Remove non-leading backup call(s)

26
Algorithm NRESE
  • Backup address is NOT aliased to anything
  • points-to set is empty
  • AND
  • On any path from begin of CKPT to the respective
    write, there is no use of the backup address
  • the value can be independently re-generated
    without the need of it self

27
1D array vs. Hash Tables Buffer Schemes
28
Compare with Coarse-gain Scheme libCKPT
100KX
10KX
1KX
100X
10X
HUGE gain over coarse-grain libCKPT
29
Compiler Checkpointing (CKPT) Framework
LLVM IR
C/C
Backend Process
Optimize Checkpointing
Enable Checkpointing
Annotated source
Source code
30
CKPT Enabled Debugging
  • Key benefits
  • execution rewinding
  • arbitrarily large region
  • unlimited of retries
  • no restart

31
Compare with Fine-gain Scheme ICCSTM
better than best-known fine-grain solution
32
Redundancy Elimination Optimization 1
start_ckpt() backup(a, sizeof(a)) a
backup(a, sizeof(a)) a
if (C) backup(a, sizeof(a)) a
stop_ckpt(c)
  • Algorithm
  • establish dominating relationship
  • among backup calls
  • promote leading backup call
  • eliminate all non-leading backup call(s)

RE1 keep only dominating backup call
33
CKPT Support for Automatic Backtracking (VPR)
CKPT automates the process, regardless of
backtracking complexity
34
?
?
35
  • Key benefits
  • automate support for backtracking
  • backup actions
  • abort
  • commit
  • cover arbitrarily complex algorithm
  • cleaner code, simplify programming
  • programmer focus on algorithm

36
App2 CKPT enabled backtracking
  • Key benefits
  • automate support for backtracking
  • backup actions
  • abort
  • commit
  • cover arbitrarily complex algorithm
  • cleaner code, simplify programming
  • programmer focus on algorithm

36
37
  • Key benefits
  • automate CKPT process
  • backup actions
  • abort
  • commit
  • cover arbitrarily complex algorithm
  • simplify programming
  • programmer focus on algorithm

38
(No Transcript)
39
How Can A Compiler Help Checkpointing?
  • Enable CKPT
  • compiler transformations
  • Optimize CKPT
  • do standard optimizations apply?
  • support CKPT-specific optimizations?
  • CKPT Uses
  • debugging
  • backtracking

40
Optimization buffer size reduction





up to 98 of CKPT buffer size reduction
41
(No Transcript)
42
CKPT Region
42
43
Agenda
  • Enable Checkpointing
  • Optimize Checkpointing
  • Checkpointing Enabled Applications
  • Test and Evaluation
  • Summary

44
The Lengthy Development-Cycle Problem
long cycle time
45
App2 CKPT enabled automatic backtracking (VPR)
T pick a pair of blocks to swap
  • Key benefits
  • automate support for backtracking
  • backup actions
  • abort
  • commit
  • cover arbitrarily complex algorithm
  • cleaner code, simplify programming
  • programmer focus on algorithm

CKPT Region
Proceed with VPRs random/simulated-annealing
based algorithm
Q keep swap if improvement, discard otherwise
45
46
(No Transcript)
Write a Comment
User Comments (0)
About PowerShow.com