improving adaptability of multi mode systems via program
play

Improving Adaptability of Multi-Mode Systems via Program Steering - PowerPoint PPT Presentation

Improving Adaptability of Multi-Mode Systems via Program Steering Lee Lin Michael D. Ernst MIT CSAIL 1 Multi-Mode Systems A multi-mode systems behavior depends on its environment and internal state Examples of multi-mode


  1. Improving Adaptability of Multi-Mode Systems via Program Steering Lee Lin Michael D. Ernst MIT CSAIL 1

  2. Multi-Mode Systems • A multi-mode system’s behavior depends on its environment and internal state • Examples of multi-mode systems: – Web server: polling / interrupt – Cell phone: AMPS / TDMA / CDMA – Router congestion control: normal / intentional drops – Graphics program: high detail / low detail 2

  3. Controllers • Controller chooses which mode to use • Examples of factors that determine modes: – Web server: heavy traffic vs. light traffic – Cell phone: rural area vs. urban area; interference – Router congestion control: preconfigured policy files – Graphics program: frame rate constraints 3

  4. Controller Example while (true) { if ( checkForCarpet() ) indoorNavigation(); else if ( checkForPavement() ) outdoorNavigation(); else cautiousNavigation(); } • Do the predicates handle all situations well? • Is any more information available? • Does the controller ever fail? 4

  5. Improving Built-in Controllers • Built-in controllers do well in expected situations • Goal: Create a controller that adapts well to unanticipated situations – Utilize redundant sensors during hardware failures – Sense environmental changes – Avoid default modes if other modes are more appropriate – Continue operation if controller fails 5

  6. Why Make Systems Adaptive? • Testing all situations is impossible • Programmers make mistakes – Bad intuition – Bugs • The real world is unpredictable – Hardware failures – External environmental changes • Human maintenance is costly – Reduce need for user intervention – Issue fewer software patches 6

  7. Overview • Program Steering Technique • Mode Selection Example • Program Steering Implementation • Experimental Results • Conclusions 7

  8. Program Steering Goals • Create more adaptive systems without creating new modes • Allow systems to extrapolate knowledge from successful training examples • Choose appropriate modes in unexpected situations 8

  9. Program Steering Overview 1. Select representative training runs 2. Create models describing each mode using dynamic program analysis 3. Create a mode selector using the models 4. Augment the original program to utilize the new mode selector 9

  10. Collect Training Data Original Program Original Controller 10

  11. Collect Dynamic Training Data Analysis Original Models Program Original Controller 11

  12. Collect Dynamic Training Data Analysis Original Models Program Create Mode Original Selector Controller Mode Selector 12

  13. Collect Dynamic Training Data Analysis Original Models Program Create Mode Original Selector Controller Mode Selector Create New Original Controller Program New New Controller Controller 13

  14. Overview • Program Steering Technique • Mode Selection Example • Program Steering Implementation • Experimental Results • Conclusions 14

  15. Laptop Display Controller • Three modes – Normal Mode – Power Saver Mode – Sleep Mode • Available Data: – Inputs: battery life and DC power availability – Outputs: brightness 15

  16. Properties Observed from Training Runs Power Standard Sleep Saver Mode Mode Mode Brightness >= 0 Brightness >= 0 Brightness == 0 Brightness <= 10 Brightness <= 4 Battery > 0.15 Battery > 0.00 Battery > 0.00 Battery <= 1.00 Battery <= 0.15 Battery <= 1.00 DCPower == false 16

  17. Mode Selection Problem What mode is most appropriate? Current Program Snapshot Brightness == 8 Battery == 0.10 DCPower == true 17

  18. Mode Selection Mode selection policy: Choose the mode with the highest percentage of matching properties. Current Program Snapshot Brightness == 8 Battery == 0.10 DCPower == true 18

  19. Mode Selection Mode selection policy: Choose the mode with the highest percentage of matching properties. Current Standard Program Mode Snapshot Brightness == 8 BRT >= 0 BRT <= 10 Battery == 0.10 BAT > 0.15 BAT <= 1.00 DCPower == true Score: 75% 19

  20. Mode Selection Mode selection policy: Choose the mode with the highest percentage of matching properties. Current Power Standard Program Saver Mode Snapshot Mode Brightness == 8 BRT >= 0 BRT >= 0 BRT <= 10 BRT <= 4 Battery == 0.10 BAT > 0.15 BAT > 0.00 BAT <= 1.00 BAT <= 0.15 DCPower == true DC == false Score: 75% Score: 60% 20

  21. Mode Selection Mode selection policy: Choose the mode with the highest percentage of matching properties. Current Power Standard Sleep Program Saver Mode Mode Snapshot Mode Brightness == 8 BRT >= 0 BRT >= 0 BRT == 0 BRT <= 10 BRT <= 4 Battery == 0.10 BAT > 0.15 BAT > 0.00 BAT > 0.00 BAT <= 1.00 BAT <= 0.15 BAT <= 1.00 DCPower == true DC == false Score: 75% Score: 66% Score: 60% 21

  22. Mode Selection Mode selection policy: Choose the mode with the highest percentage of matching properties. Current Power Standard Sleep Program Saver Mode Mode Snapshot Mode Brightness == 8 BRT >= 0 BRT >= 0 BRT == 0 BRT <= 10 BRT <= 4 Battery == 0.10 BAT > 0.15 BAT > 0.00 BAT > 0.00 BAT <= 1.00 BAT <= 0.15 BAT <= 1.00 DCPower == true DC == false Score: 75% Score: 66% Score: 60% 22

  23. Second Example Mode selection policy: Choose the mode with the highest percentage of matching properties. Current Program Snapshot Brightness == 8 Battery == 0.10 DCPower == false 23

  24. Second Example Mode selection policy: Choose the mode with the highest percentage of matching properties. Current Power Standard Sleep Program Saver Mode Mode Snapshot Mode Brightness == 8 BRT >= 0 BRT >= 0 BRT == 0 BRT <= 10 BRT <= 4 Battery == 0.10 BAT > 0.15 BAT > 0.00 BAT > 0.00 BAT <= 1.00 BAT <= 0.15 BAT <= 1.0 DCPower == false DC == false Score: 75% Score: 66% Score: 80% 24

  25. Overview • Program Steering Technique • Mode Selection Example • Program Steering Implementation • Experimental Results • Conclusions 25

  26. Collect Dynamic Training Data Analysis Original Models Program Create Mode Original Selector Controller Mode Selector Create New Original Controller Program New New Controller Controller 26

  27. Training • Train on successful runs – Passing test cases – High performing trials • Amount of training data: – Depends on modeling technique – Cover all modes 27

  28. Dynamic Analysis • Create one set of properties per mode • Daikon Tool – Supply program and execute training runs – Infers properties involving inputs and outputs – Properties were true for every training run • this.next.prev == this • currDestination is an element of visitQueue[] • n < mArray.length http://pag.csail.mit.edu/daikon/ 28

  29. Collect Dynamic Training Data Analysis Original Models Program Create Mode Original Selector Controller Mode Selector Create New Original Controller Program New New Controller Controller 29

  30. Mode Selection Policy Check which properties in the models are true in the current program state. For each mode, calculate a similarity score (percent of matching properties). Choose the mode with the highest score. Can also accept constraints, for example - Don’t select Travel Mode when destination null - Must switch to new mode after Exception 30

  31. Collect Dynamic Training Data Analysis Original Models Program Create Mode Original Selector Controller Mode Selector Create New Original Controller Program New New Controller Controller 31

  32. Controller Augmentation Call the new mode selector during: – Uncaught Exceptions – Timeouts – Default / passive mode – Randomly during mode transitions Otherwise, the controller is unchanged 32

  33. Why Consider Mode Outputs? • Mode selection considers all properties • Output properties measure whether mode is behaving as expected • Provides inertia, avoids rapid switching • Suppose brightness is stuck at 3 (damaged). – No output benefit for Standard Mode. – More reason to prefer Power Saver to Standard. 33

  34. Why Should Program Steering Improve Mode Selection? • Eliminates programmer assumptions about what is important • Extrapolates knowledge from successful runs • Considers all accessible information • Every program state is handled • The technique requires no domain-specific knowledge 34

  35. What Systems Can Benefit from Program Steering? • Discrete transitions between modes • Deployed in unpredictable environments • Multiple modes often applicable 35

  36. Overview • Program Steering Technique • Mode Selection Example • Program Steering Implementation • Experimental Results • Conclusions 36

  37. Droid Wars Experiments • Month-long programming competition • Teams of simulated robots are at war (27 teams total) • Robots are autonomous • Example modes found in contestant code: Attack, defend, transport, scout enemy, relay message, gather resources 37

Recommend


More recommend