Mementos System Support for Long-Running Computations on RFID-Scale - - PowerPoint PPT Presentation

mementos
SMART_READER_LITE
LIVE PREVIEW

Mementos System Support for Long-Running Computations on RFID-Scale - - PowerPoint PPT Presentation

Mementos System Support for Long-Running Computations on RFID-Scale Devices pmn R Benjamin Ransford*, UMass Amherst ~o ~o Jacob Sorber, Dartmouth College Kevin Fu, UMass Amherst http://spqr.cs.umass.edu/mementos ASPLOS XVI


slide-1
SLIDE 1

ASPLOS XVI — March 8, 2011

Mementos

System Support for Long-Running Computations on RFID-Scale Devices Benjamin Ransford*, UMass Amherst Jacob Sorber, Dartmouth College Kevin Fu, UMass Amherst http://spqr.cs.umass.edu/mementos

CNS-0627529, CNS-0845874, CNS-0923313, Grad Res. Fel. Any opinions, findings, and conclusions expressed in this material are those

  • f the authors and do not necessarily reflect the views of the NSF.

pmnR

ä~Äo ê~ío êó

slide-2
SLIDE 2

Mementos — Ransford — ASPLOS XVI 2

PARC

“... the most powerful things are those that are effectively invisible in use.”

— Mark Weiser (PARC, 1988)

Ubiquitous Computing

Problem: Batteryless invisible computer ⇒ constant reboots

slide-3
SLIDE 3

Mementos — Ransford — ASPLOS XVI 3

Baby Steps Toward Ubicomp

  • 1. Take Emerging Platform
slide-4
SLIDE 4

Mementos — Ransford — ASPLOS XVI 3

Baby Steps Toward Ubicomp

  • 1. Take Emerging Platform
  • 2. Add Robustness Mechanism
slide-5
SLIDE 5

Mementos — Ransford — ASPLOS XVI 3

Baby Steps Toward Ubicomp

  • 1. Take Emerging Platform
  • 2. Add Robustness Mechanism
  • 3. Provide Simulation Tools
slide-6
SLIDE 6

Mementos — Ransford — ASPLOS XVI

RFID-Scale Devices

4

1 . E m e r g i n g P l a t f

  • r

m

Radio (RF) harvester Energy buffer (capacitor) Reprogrammable microcontroller (~1 MHz) w/ on-chip flash

Moo WISP: Hong Zhang

m a g n i f i e d 1 x

slide-7
SLIDE 7

Mementos — Ransford — ASPLOS XVI

RFID-Scale Devices

4

1 . E m e r g i n g P l a t f

  • r

m

Radio (RF) harvester Energy buffer (capacitor) Reprogrammable microcontroller (~1 MHz) w/ on-chip flash

Moo WISP: Hong Zhang

m a g n i f i e d 1 x

slide-8
SLIDE 8

Mementos — Ransford — ASPLOS XVI

RFID-Scale Devices

4

1 . E m e r g i n g P l a t f

  • r

m

Radio (RF) harvester Energy buffer (capacitor) Reprogrammable microcontroller (~1 MHz) w/ on-chip flash Fills quickly, low capacity

Moo WISP: Hong Zhang

m a g n i f i e d 1 x

slide-9
SLIDE 9

Mementos — Ransford — ASPLOS XVI

RFID-Scale Devices

4

1 . E m e r g i n g P l a t f

  • r

m

Radio (RF) harvester Energy buffer (capacitor) Reprogrammable microcontroller (~1 MHz) w/ on-chip flash Fills quickly, low capacity Frequent reboots

Moo WISP: Hong Zhang

m a g n i f i e d 1 x

slide-10
SLIDE 10

Mementos — Ransford — ASPLOS XVI 5

ball: clipart.pierceinternet.com

slide-11
SLIDE 11

Mementos — Ransford — ASPLOS XVI 5

REBOOT REBOOT REBOOT REBOOT REBOOT REBOOTREBOOT REBOOT REBOOT REBOOT REBOOT REBOOT REBOOT REBOOT REBOOT REBOOT REBOOT REBOOT REBOOT REBOOT REBOOT REBOOT REBOOT REBOOT REBOOT REBOOT REBOOT REBOOT REBOOT REBOOT REBOOT REBOOT

ball: clipart.pierceinternet.com

slide-12
SLIDE 12

Mementos — Ransford — ASPLOS XVI 5

REBOOT REBOOT REBOOT REBOOT REBOOT REBOOTREBOOT REBOOT REBOOT REBOOT REBOOT REBOOT REBOOT REBOOT REBOOT REBOOT REBOOT REBOOT REBOOT REBOOT REBOOT REBOOT REBOOT REBOOT REBOOT REBOOT REBOOT REBOOT REBOOT REBOOT REBOOT REBOOT

ball: clipart.pierceinternet.com

slide-13
SLIDE 13

Mementos — Ransford — ASPLOS XVI 5

REBOOT REBOOT REBOOT REBOOT REBOOT REBOOTREBOOT REBOOT REBOOT REBOOT REBOOT REBOOT REBOOT REBOOT REBOOT REBOOT REBOOT REBOOT REBOOT REBOOT REBOOT REBOOT REBOOT REBOOT REBOOT REBOOT REBOOT REBOOT REBOOT REBOOT REBOOT REBOOT

ball: clipart.pierceinternet.com

slide-14
SLIDE 14

Mementos — Ransford — ASPLOS XVI 5

REBOOT REBOOT REBOOT REBOOT REBOOT REBOOTREBOOT REBOOT REBOOT REBOOT REBOOT REBOOT REBOOT REBOOT REBOOT REBOOT REBOOT REBOOT REBOOT REBOOT REBOOT REBOOT REBOOT REBOOT REBOOT REBOOT REBOOT REBOOT REBOOT REBOOT REBOOT REBOOT

ball: clipart.pierceinternet.com

slide-15
SLIDE 15

Mementos — Ransford — ASPLOS XVI

Robustness Under RF Harvesting

6

  • Typical approach: constrain

the problem

  • Mementos: relax constraints

to make general-purpose computation feasible 300 ms

slide-16
SLIDE 16

Mementos — Ransford — ASPLOS XVI

Unpredictable Energy Morass

7

Infinite energy; constant voltage

Voltage Time

slide-17
SLIDE 17

Mementos — Ransford — ASPLOS XVI

Unpredictable Energy Morass

7

Infinite energy; constant voltage

Voltage Time

vs.

Voltage Time (40 seconds)

slide-18
SLIDE 18

Mementos — Ransford — ASPLOS XVI

Mementos Approach

  • Checkpoint when failure appears imminent
  • Spread computation across reboots

8

2 . R

  • b

u s t n e s s M e c h a n i s m

3220 3155 3170 3180 3190 3200 3210

3.6 0.5 1 1.5 2 2.5 3

Time (ms) Voltage (V)

Movie poster: publispain.com

slide-19
SLIDE 19

Mementos — Ransford — ASPLOS XVI

Mementos Approach

  • Checkpoint when failure appears imminent
  • Spread computation across reboots

8

2 . R

  • b

u s t n e s s M e c h a n i s m

3220 3155 3170 3180 3190 3200 3210

3.6 0.5 1 1.5 2 2.5 3

Time (ms) Voltage (V)

Checkpoint region

Movie poster: publispain.com

slide-20
SLIDE 20

Mementos — Ransford — ASPLOS XVI

Mementos Approach

  • Checkpoint when failure appears imminent
  • Spread computation across reboots

8

2 . R

  • b

u s t n e s s M e c h a n i s m

3220 3155 3170 3180 3190 3200 3210

3.6 0.5 1 1.5 2 2.5 3

Time (ms) Voltage (V)

Checkpoint region

Movie poster: publispain.com

C Checkpoint

slide-21
SLIDE 21

Mementos — Ransford — ASPLOS XVI

Mementos Approach

  • Checkpoint when failure appears imminent
  • Spread computation across reboots

8

2 . R

  • b

u s t n e s s M e c h a n i s m

3220 3155 3170 3180 3190 3200 3210

3.6 0.5 1 1.5 2 2.5 3

Time (ms) Voltage (V)

Checkpoint region

Movie poster: publispain.com

...

C Checkpoint

slide-22
SLIDE 22

Mementos — Ransford — ASPLOS XVI

Mementos Approach

  • Checkpoint when failure appears imminent
  • Spread computation across reboots

8

2 . R

  • b

u s t n e s s M e c h a n i s m

3220 3155 3170 3180 3190 3200 3210

3.6 0.5 1 1.5 2 2.5 3

Time (ms) Voltage (V)

Checkpoint region

Movie poster: publispain.com

...

C Checkpoint Restore

slide-23
SLIDE 23

Mementos — Ransford — ASPLOS XVI

Running Example: CRC

9

  • Compute CRC16-CCITT checksum over 2 KB data
  • Tight nested loops
  • 575,000 CPU cycles ~ 575 ms
slide-24
SLIDE 24

Mementos — Ransford — ASPLOS XVI

Running Example: CRC

9

  • Compute CRC16-CCITT checksum over 2 KB data
  • Tight nested loops
  • 575,000 CPU cycles ~ 575 ms

Reboots every O(100) ms!

slide-25
SLIDE 25

Mementos — Ransford — ASPLOS XVI

How to Use Mementos

10

Write C code

Programmer Mementos (our contributions)

Choose params

slide-26
SLIDE 26

Mementos — Ransford — ASPLOS XVI

How to Use Mementos

10

Write C code

Programmer Mementos (our contributions)

Choose params Instrument w/ energy checks (via LLVM passes) Simulate program

slide-27
SLIDE 27

Mementos — Ransford — ASPLOS XVI

How to Use Mementos

10

Write C code

Programmer Mementos (our contributions)

Choose params

Suggest params

Instrument w/ energy checks (via LLVM passes) Simulate program

slide-28
SLIDE 28

Mementos — Ransford — ASPLOS XVI

How to Use Mementos

10

Write C code

Programmer Mementos (our contributions)

Choose params

Suggest params

Instrument w/ energy checks (via LLVM passes) Simulate program

slide-29
SLIDE 29

Mementos — Ransford — ASPLOS XVI

Choosing Parameters (1/2)

11

Write C code

Programmer

Choose params

1) Instrumentation strategy

slide-30
SLIDE 30

Mementos — Ransford — ASPLOS XVI

Choosing Parameters (1/2)

11

Write C code

Programmer

Choose params

1) Instrumentation strategy

slide-31
SLIDE 31

Mementos — Ransford — ASPLOS XVI

Choosing Parameters (1/2)

11

Write C code

Programmer

Choose params

1) Instrumentation strategy Checkpoint?

slide-32
SLIDE 32

Mementos — Ransford — ASPLOS XVI

Choosing Parameters (1/2)

11

Write C code

Programmer

Choose params

1) Instrumentation strategy Checkpoint? Checkpoint?

slide-33
SLIDE 33

Mementos — Ransford — ASPLOS XVI

Choosing Parameters (2/2)

12

Write C code

Programmer

Choose params

2) Checkpoint threshold Vthresh

slide-34
SLIDE 34

Mementos — Ransford — ASPLOS XVI

Choosing Parameters (2/2)

12

Write C code

Programmer

Choose params

2) Checkpoint threshold Vthresh

3220 3155 3170 3180 3190 3200 3210

3.6 0.5 1 1.5 2 2.5 3

Time (ms) Voltage (V)

DEATH

slide-35
SLIDE 35

Mementos — Ransford — ASPLOS XVI

Choosing Parameters (2/2)

12

Write C code

Programmer

Choose params

2) Checkpoint threshold Vthresh

3220 3155 3170 3180 3190 3200 3210

3.6 0.5 1 1.5 2 2.5 3

Time (ms) Voltage (V)

DEATH

CKPT

slide-36
SLIDE 36

Mementos — Ransford — ASPLOS XVI

Choosing Parameters (2/2)

12

Write C code

Programmer

Choose params

2) Checkpoint threshold Vthresh

3220 3155 3170 3180 3190 3200 3210

3.6 0.5 1 1.5 2 2.5 3

Time (ms) Voltage (V)

DEATH

CKPT

{

Wasted!

slide-37
SLIDE 37

Mementos — Ransford — ASPLOS XVI

Choosing Parameters (2/2)

12

Write C code

Programmer

Choose params

2) Checkpoint threshold Vthresh

3220 3155 3170 3180 3190 3200 3210

3.6 0.5 1 1.5 2 2.5 3

Time (ms) Voltage (V)

DEATH

CKPT

slide-38
SLIDE 38

Mementos — Ransford — ASPLOS XVI

Choosing Parameters (2/2)

12

Write C code

Programmer

Choose params

2) Checkpoint threshold Vthresh

3220 3155 3170 3180 3190 3200 3210

3.6 0.5 1 1.5 2 2.5 3

Time (ms) Voltage (V)

DEATH

CKPT

slide-39
SLIDE 39

Mementos — Ransford — ASPLOS XVI

Choosing Parameters (2/2)

12

Write C code

Programmer

Choose params

2) Checkpoint threshold Vthresh

3220 3155 3170 3180 3190 3200 3210

3.6 0.5 1 1.5 2 2.5 3

Time (ms) Voltage (V)

DEATH

CKPT

slide-40
SLIDE 40

Mementos — Ransford — ASPLOS XVI

Choosing Parameters (2/2)

12

Write C code

Programmer

Choose params

2) Checkpoint threshold Vthresh

3220 3155 3170 3180 3190 3200 3210

3.6 0.5 1 1.5 2 2.5 3

Time (ms) Voltage (V)

DEATH

CKPT

Vthresh

slide-41
SLIDE 41

Mementos — Ransford — ASPLOS XVI

Assorted Challenges

Checkpointing isn’t trivial in this context

  • No FTL; manage flash ourselves
  • Can’t overwrite arbitrary bit patterns in flash

memory ➔ tricky checkpoint maintenance Working on these devices is painful

  • Fickle harvesting ➔ runs not reproducible
  • Limited visibility into running hardware

13

slide-42
SLIDE 42

Mementos — Ransford — ASPLOS XVI

Trace-Driven Simulator

  • Based on MSPsim — cycle-accurate, open-

source MSP430 simulator [EWSN ’07]

  • We augmented MSPsim with notions of

energy (harvester, capacitor, power loss)

14

3 . S i m u l a t

  • r
slide-43
SLIDE 43

Mementos — Ransford — ASPLOS XVI

Trace-Driven Simulator

  • Based on MSPsim — cycle-accurate, open-

source MSP430 simulator [EWSN ’07]

  • We augmented MSPsim with notions of

energy (harvester, capacitor, power loss)

14

3 . S i m u l a t

  • r

Simulated capacitor MSPsim

slide-44
SLIDE 44

Mementos — Ransford — ASPLOS XVI

Accurate Energy Simulation

  • Simulated capacitor obeys capacitor

equations to buffer incoming energy

  • Validated with microbenchmarks (all chip

modes, all instruction classes)

  • Measured MSP430 current down to µA
  • Details in paper

15

Moo WISP: Hong Zhang; Scalpel: H-G UK; EE 101: UC Santa Cruz

slide-45
SLIDE 45

Mementos — Ransford — ASPLOS XVI

Straightforward Simulation

  • Simulator input: <executable, voltage trace>
  • Output: <# reboots to completion, # CPU

cycles, total time, execution trace>

16

slide-46
SLIDE 46

Mementos — Ransford — ASPLOS XVI

Straightforward Simulation

  • Simulator input: <executable, voltage trace>
  • Output: <# reboots to completion, # CPU

cycles, total time, execution trace>

16 1000 2000 3000 4000 5000 6000 1 2 3 4 Time (ms) Voltage (V) Capacitor Harvester

slide-47
SLIDE 47

Mementos — Ransford — ASPLOS XVI

Simulation with an Oracle

  • Checkpoint oracle finds last practicable
  • pportunity by binary search on Vthresh
  • Uninstrumented code ➔ best-case estimate
  • Final report: lower bound for Vthresh

17

3220 3155 3170 3180 3190 3200 3210

3.6 0.5 1 1.5 2 2.5 3

Time (ms) Voltage (V)

DEATH

slide-48
SLIDE 48

Mementos — Ransford — ASPLOS XVI

Simulation with an Oracle

  • Checkpoint oracle finds last practicable
  • pportunity by binary search on Vthresh
  • Uninstrumented code ➔ best-case estimate
  • Final report: lower bound for Vthresh

17

3220 3155 3170 3180 3190 3200 3210

3.6 0.5 1 1.5 2 2.5 3

Time (ms) Voltage (V)

DEATH

CKPT CKPT CKPT CKPT CKPT CKPT CKPT

slide-49
SLIDE 49

Mementos — Ransford — ASPLOS XVI

Simulation with an Oracle

  • Checkpoint oracle finds last practicable
  • pportunity by binary search on Vthresh
  • Uninstrumented code ➔ best-case estimate
  • Final report: lower bound for Vthresh

17

3220 3155 3170 3180 3190 3200 3210

3.6 0.5 1 1.5 2 2.5 3

Time (ms) Voltage (V)

DEATH

CKPT CKPT CKPT CKPT CKPT CKPT CKPT

slide-50
SLIDE 50

Mementos — Ransford — ASPLOS XVI

Evaluation

  • High-level: Mementos splits execution in

simulation and on hardware

  • Focus on CRC example test case
  • Baselines:
  • Execution without Mementos
  • Execution against checkpoint oracle

18

slide-51
SLIDE 51

Mementos — Ransford — ASPLOS XVI

Constant Part of Overhead

  • Impact on code memory (NVRAM):
  • 2.4 KB for Mementos library
  • 1 KB reserved checkpoint storage
  • Impact on run time:
  • ~0.1 ms per energy check (mostly ADC read)
  • CRC (46 bytes): checkpoint 4 ms, restore 2 ms

19

slide-52
SLIDE 52

Mementos — Ransford — ASPLOS XVI

Constant Part of Overhead

  • Impact on code memory (NVRAM):
  • 2.4 KB for Mementos library
  • 1 KB reserved checkpoint storage
  • Impact on run time:
  • ~0.1 ms per energy check (mostly ADC read)
  • CRC (46 bytes): checkpoint 4 ms, restore 2 ms

19

2 ms boot vs. TinyOS ≥100 ms

slide-53
SLIDE 53

Mementos — Ransford — ASPLOS XVI

CRC Test Case

20

Uninstrumented, unlimited energy: 575,315 cycles 575 ms

slide-54
SLIDE 54

Mementos — Ransford — ASPLOS XVI

CRC Test Case

20

Uninstrumented, unlimited energy: 575,315 cycles 575 ms Oracle: 685,608 cycles ~4,000 ms 14 reboots Vthresh ≥ 2.35 V

25 seconds

1 2 3 4 5 Volts

Best execution: 761,983 cycles 6,145 ms 16 reboots Vthresh = 2.6 V

slide-55
SLIDE 55

Mementos — Ransford — ASPLOS XVI

CRC Test Case

20

Uninstrumented, unlimited energy: 575,315 cycles 575 ms Oracle: 685,608 cycles ~4,000 ms 14 reboots Vthresh ≥ 2.35 V

25 seconds

1 2 3 4 5 Volts

Best execution: 761,983 cycles 6,145 ms 16 reboots Vthresh = 2.6 V 10x blowup is better than never finishing at all!

slide-56
SLIDE 56

Mementos — Ransford — ASPLOS XVI

With and Without Mementos

21

1000 2000 3000 4000 5000 6000 1 2 3 4 Time (ms) Voltage (V) Capacitor Harvester

2000 4000 6000 8000 10000 12000 14000 1 2 3 4 Time (ms) Voltage (V) Capacitor Harvester

CRC w/o Mementos: never finishes CRC w/ Mementos: 16 reboots Oracle: 14 reboots

slide-57
SLIDE 57

Mementos — Ransford — ASPLOS XVI

Related Work

  • RFID-scale devices
  • Mementos workshop paper [HotPower ’08]
  • Dewdrop scheduler for RFID-scale devices [NSDI 2011]
  • WISP [IEEE TIM ’08] and friends
  • Checkpointing
  • Sensornet checkpointing [EWSN ’09]
  • Checkpointing for process migration (Condor [ICDCS

’88], Porch [IEEE Micro ’98])

22

slide-58
SLIDE 58

Mementos — Ransford — ASPLOS XVI

Extensions

  • Dynamic or randomized Vthresh adaptation
  • NVRAM technology (PCM? FeRAM?)
  • Smarter checkpointing (incremental, LVA...)
  • Integrate with asynchronous communications
  • n upcoming RFID-scale prototype (June ’11)

23

slide-59
SLIDE 59

Mementos — Ransford — ASPLOS XVI

Mementos Conclusion

  • Energy-aware checkpoints for computation on

batteryless RFID-scale devices

  • Tools available today; built on LLVM and MSPsim
  • Applications: implantable devices, insect-scale

tracking, infrastructure monitoring...

24

slide-60
SLIDE 60

Mementos — Ransford — ASPLOS XVI

Acknowledgements

25

slide-61
SLIDE 61

Mementos — Ransford — ASPLOS XVI

Your Homework

  • What should be moved off-chip to save energy?
  • Right combo of RAM & NVRAM? Tiny off-chip NVRAM?
  • HW/SW interface for detecting an impending failure?
  • Conditional branches predicated on available energy?
  • Task scheduling when failure is common case?
  • Should we write a SuperTinyOS that expects failure?
  • Compile-time optimizations for expected failure?
  • How to not repeat non-idempotent actions?

26

Get Mementos, simulator, hardware: http://spqr.cs.umass.edu/mementos

{ {

HW OS PL

slide-62
SLIDE 62

Mementos — Ransford — ASPLOS XVI

Contingency Slides

27

slide-63
SLIDE 63

Mementos — Ransford — ASPLOS XVI

Vthresh Subtleties

28

  • Size, duration of are

application dependent

  • Vthresh is a conservative estimate
  • More energy might arrive
  • Choose according to risk tolerance

CKPT

slide-64
SLIDE 64

Mementos — Ransford — ASPLOS XVI

Vthresh Subtleties

28

  • Size, duration of are

application dependent

  • Vthresh is a conservative estimate
  • More energy might arrive
  • Choose according to risk tolerance

CKPT Spoiler: We help the programmer choose Vthresh

slide-65
SLIDE 65

Mementos — Ransford — ASPLOS XVI

Low-Power Modes

  • MSP430 has a variety of low-power modes

(~1 µA in LPM3/LPM4) that retain RAM

  • Sleeping when energy is low is an
  • ptimistic strategy
  • We don’t know when or whether energy

will return — should Mementos guess?

29

slide-66
SLIDE 66

Mementos — Ransford — ASPLOS XVI

Applications

30

Daeyeon Kim; Gyouho Kim; (SolarWISP) Shane Clark; Medtronic

slide-67
SLIDE 67

Mementos — Ransford — ASPLOS XVI

Thanks for asking about TinyOS

31

  • Condor, Porch, libckpt — all depend on

OS-level or out-of-band facilities

  • Sensor OSes (e.g., ) designed to

boot infrequently and sip from batteries

  • TinyOS boot: ≥ 100 ms (too slow)
slide-68
SLIDE 68

Mementos — Ransford — ASPLOS XVI

Thanks for asking about TinyOS

31

  • Condor, Porch, libckpt — all depend on

OS-level or out-of-band facilities

  • Sensor OSes (e.g., ) designed to

boot infrequently and sip from batteries

  • TinyOS boot: ≥ 100 ms (too slow)

Existing lightweight OSes still too heavy

slide-69
SLIDE 69

Mementos — Ransford — ASPLOS XVI

CRC Example: Overhead

32

Instrumentation CPU Cycles Mementos Uninstrumented 575,315 0% Loop latches 619,450 6.9% Function returns 577,702 0.2% Timer + latches 598,171 3.4%

How much CPU overhead for checks? Consistently high voltage (V > Vthresh):

slide-70
SLIDE 70

Mementos — Ransford — ASPLOS XVI

Why Not Just Add...

33

  • Thin-film battery?
  • Deeper charge pump (higher voltage)?
  • Tiny dedicated NVRAM?
  • Hardware “low energy” interrupt support?
slide-71
SLIDE 71

Mementos — Ransford — ASPLOS XVI

Other Use Cases

Programmer can:

  • Disable instrumentation at a function level
  • Manually call Mementos routines

34