Ratchet Intermittent Computation without Hardware Support or - - PowerPoint PPT Presentation

ratchet
SMART_READER_LITE
LIVE PREVIEW

Ratchet Intermittent Computation without Hardware Support or - - PowerPoint PPT Presentation

Ratchet Intermittent Computation without Hardware Support or Programmer Intervention University of Michigan Ma>hew Hicks Joel Van Der Woude MIT/LL Sandia 12/5/16 jvdw@umich.edu 1 12/5/16 jvdw@umich.edu 2 Batteries are bulky and


slide-1
SLIDE 1

Ratchet Intermittent Computation without Hardware Support or

Programmer Intervention

1 12/5/16 jvdw@umich.edu

Joel Van Der Woude Sandia Ma>hew Hicks MIT/LL University of Michigan

slide-2
SLIDE 2

2 12/5/16 jvdw@umich.edu

slide-3
SLIDE 3

Batteries are bulky and inconvenient

3 12/5/16 jvdw@umich.edu

slide-4
SLIDE 4

Energy harvesting

4 12/5/16 jvdw@umich.edu

slide-5
SLIDE 5

Hardware monitoring vs. 
 programmer insight

12/5/16 jvdw@umich.edu 5

  • r
slide-6
SLIDE 6

Goals of Ratchet

  • Burden the compiler not the programmer
  • Without hardware to measure voltage
  • Ensure forward progress under frequent

power failures (~100ms)

12/5/16 jvdw@umich.edu 6

slide-7
SLIDE 7

Checkpointing

12/5/16 7 jvdw@umich.edu

  • Save volatile state

to non-volatile memory

  • After a power fail

– restart – restore – continue

Time Progress

slide-8
SLIDE 8

Initial Correct At Fail Error a x y y 42 b y 42 42 42

Re-execution causes incorrectness

mem[a] = mem[b] mem[b] = 42 … return a

Write a(er Read (WAR)

8 12/5/16 jvdw@umich.edu

Initial Correct At Fail a x y y b y 42 42 Initial Correct a x y b y 42 Initial mem[a] x mem[b] y

slide-9
SLIDE 9

What is idempotence?

  • Re-execution generates semantically

correct result

  • A section of code that does not overwrite/

update inputs

12/5/16 9 jvdw@umich.edu

slide-10
SLIDE 10

Initial Correct At Fail Error a x y y y b y 42 42 42

Idempotence enabling re-execution

mem[a] = mem[b] mem[b] = 42 … return a

10 12/5/16 jvdw@umich.edu

Initial Correct At Fail a x y y b y 42 42 Initial Correct a x y b y 42 Initial a x b y

slide-11
SLIDE 11

Ratchet system overview

11 12/5/16 jvdw@umich.edu Ratchet Ratchet .o file .c file Frontend Instruction Selection & Register Allocation Finalize Idempotence Analysis Insert Checkpoints Fix-up Combine Redundant Checkpoints Emit Minimum Checkpoint IR IR ASM ASM Function Entry

slide-12
SLIDE 12

Idempotence analysis

12 12/5/16 jvdw@umich.edu Ratchet Ratchet .o file .c file Frontend Instruction Selection & Register Allocation Finalize Idempotence Analysis Insert Checkpoints Fix-up Combine Redundant Checkpoints Emit Minimum Checkpoint IR IR ASM ASM Function Entry

slide-13
SLIDE 13

mem[a] = mem[b] mem[b] = 42 … return a

Identifying WARs

13 12/5/16 jvdw@umich.edu

slide-14
SLIDE 14

Insert checkpoints

14 12/5/16 jvdw@umich.edu Ratchet Ratchet .o file .c file Frontend Instruction Selection & Register Allocation Finalize Idempotence Analysis Insert Checkpoints Fix-up Combine Redundant Checkpoints Emit Minimum Checkpoint IR IR ASM ASM Function Entry

slide-15
SLIDE 15

Seperating WARs with checkpoints

  • Weighted with

– Loop depth – # of WAR cut

15 mem[c] = 42 r0 = mem[a] r1 = mem[b] r3 = φ(r0,r2) mem[a] = r3+1 mem[c] = r1 mem[b] = r1+1 r2 = mem[c] r2 = mem[c] checkpoint() 12/5/16 jvdw@umich.edu checkpoint() mem[b] = r1+1

slide-16
SLIDE 16

Fix-up

16 12/5/16 jvdw@umich.edu Ratchet Ratchet .o file .c file Frontend Instruction Selection & Register Allocation Finalize Idempotence Analysis Insert Checkpoints Fix-up Combine Redundant Checkpoints Emit Minimum Checkpoint IR IR ASM ASM Function Entry

slide-17
SLIDE 17

The backend may create WARs

  • Stack Teardown
  • Register Spilling

17

… return addr r0-r3 locals

SP

new addr new regs

12/5/16 jvdw@umich.edu

slide-18
SLIDE 18

Redundant checkpoints

18 12/5/16 jvdw@umich.edu Ratchet Ratchet .o file .c file Frontend Instruction Selection & Register Allocation Finalize Idempotence Analysis Insert Checkpoints Fix-up Combine Redundant Checkpoints Emit Minimum Checkpoint IR IR ASM ASM Function Entry

slide-19
SLIDE 19

Relocating checkpoints to combine

  • Redundant checkpoints

caused by…

– Optimizations – Scheduling Decisions – Register Spills

12/5/16 19

r0 = mem[a] r1 = mem[b] r3 = r0+r1 r4 = r3+1 checkpoint() R5 = r3+r4 mem[a] = r3 checkpoint() mem[b] = r5 r0 = mem[a] r1 = mem[b] r3 = r0+r1 r4 = r3+1 checkpoint() r5 = r3+r4 mem[a] = r3 mem[b] = r5

jvdw@umich.edu

slide-20
SLIDE 20

Minimum checkpoint

20 12/5/16 jvdw@umich.edu Ratchet Ratchet .o file .c file Frontend Instruction Selection & Register Allocation Finalize Idempotence Analysis Insert Checkpoints Fix-up Combine Redundant Checkpoints Emit Minimum Checkpoint IR IR ASM ASM Function Entry

slide-21
SLIDE 21

Optimizing Ratchet

  • Ratchet

Unoptimized

  • RatchetFE

Function Entry

  • RatchetFE+RD

+Remove Duplicates

  • RatchetFE+RD+LR +Live Registers
  • Ideal

Single Checkpoint

12/5/16 jvdw@umich.edu 21

slide-22
SLIDE 22

How we evaluated Ratchet

  • Simulator

– Cycle accurate – Random power failures – Dynamically track idempotence

– https://github.com/impedimentToProgress/thumbulator

  • Benchmarks

– MIBench – newlib

– https://github.com/impedimentToProgress/MiBench2

22 12/5/16 jvdw@umich.edu

slide-23
SLIDE 23

23 12/5/16 jvdw@umich.edu

slide-24
SLIDE 24

12/5/16 24 jvdw@umich.edu

slide-25
SLIDE 25

25 12/5/16 jvdw@umich.edu

slide-26
SLIDE 26

12/5/16 26 jvdw@umich.edu

slide-27
SLIDE 27

Conclusion

12/5/16 jvdw@umich.edu 27

slide-28
SLIDE 28

Questions?

12/5/16 jvdw@umich.edu 28