Automatic Performance Setting for Dynamic Voltage Scaling Krisztin












































- Slides: 44
Automatic Performance Setting for Dynamic Voltage Scaling Krisztián Flautner manowar@engin. umich. edu Steve Reinhardt Trevor Mudge Krisztián Flautner - manowar@engin. umich. edu Automatic Performance Setting for Dynamic Voltage Scaling 1
Overview • A mechanism for quantifying the user experience. – Metric: response time. – Automatic, no user program modifications required. – Run-time feedback to the kernel. • Guiding performance setting of DVS processors. – For interactive episodes: slow down processor to save energy when response times are fast enough. – For periodic events: track periodicity, utilization and intertask communication to establish necessary performance. • Simulated and experimental results. Krisztián Flautner - manowar@engin. umich. edu Automatic Performance Setting for Dynamic Voltage Scaling 2
Dynamic Voltage Scaling Execute only as fast as necessary to meet deadlines. Running fast and idling is not energy efficient. Power = Capacitance • voltage 2 • frequency • Voltage is proportional to the frequency. • Reduce f and v to match performance demands. • Reduced frequency implies longer execution time. Energy ~ voltage 2 Krisztián Flautner - manowar@engin. umich. edu Automatic Performance Setting for Dynamic Voltage Scaling 3
Why bother? 100 Pentium Pro (R) Pentium(R) MMX 10 486 1 1. 5 m ? Source: Intel Max Power (Watts) Pentium II (R) 386 1 m 0. 8 m 0. 6 m 0. 35 m 0. 25 m 0. 18 m 0. 13 m Higher performance = increased power consumption. Krisztián Flautner - manowar@engin. umich. edu Automatic Performance Setting for Dynamic Voltage Scaling 4
Power Density! Nuclear Reactor Rocket Nozzle Sun’s Surface ? Source: Intel Hot plate Krisztián Flautner - manowar@engin. umich. edu Automatic Performance Setting for Dynamic Voltage Scaling 5
Small performance reduction = big energy savings Graph based on Intel XScale data 20% performance reduction = 32% energy reduction 40% performance reduction = 55% energy reduction Krisztián Flautner - manowar@engin. umich. edu Automatic Performance Setting for Dynamic Voltage Scaling 6
Processors supporting DVS lp. ARM Intel SA-1100 Transmeta Crusoe 5600 Intel XScale Demo Min. 8 Mhz 1. 1 V 1. 8 m. W 59 Mhz 0. 79 V 106 m. W 500 Mhz 1. 2 V ~1 W 150 Mhz 0. 75 V 40 m. W Max. 100 Mhz 3. 3 V 220 m. W 251 Mhz 1. 65 V 964 m. W 700 Mhz 1. 6 V ~2 W 800 Mhz 1. 5 V 900 m. W 1000 Mhz 1. 75 V 1. 45 W Process 0. 6 0. 35 0. 18 Max/min energy 9 4. 4 1. 8 4 5. 4 Krisztián Flautner - manowar@engin. umich. edu Automatic Performance Setting for Dynamic Voltage Scaling 7
Some recent desktop processors Intel Pentium IV Intel Pentium III AMD Athlon Model 4 MPC 7450 Core 1. 4 Ghz @ 1. 7 V 500 Mhz @ 1. 35 V 733 Mhz @ 1. 65 V 650 Mhz @ 1. 75 V 1. 2 Ghz @ 1. 75 V 533 Mhz @ 1. 8 V 667 Mhz @ 1. 8 V I/O 400 Mhz 100 Mhz, 133 Mhz 3. 3 V 200 Mhz, 266 Mhz 1. 6 V 133 Mhz 1. 8 V-2. 5 V Process 0. 18 Max. Power 66. 3 W 12 W 19. 1 W 38 W 66 W 17 W 19. 1 W Krisztián Flautner - manowar@engin. umich. edu Automatic Performance Setting for Dynamic Voltage Scaling 8
Performance setting algorithms • Programmer specified – Works well but requires explicit specification of deadlines. • Interval based algorithms – Use the ratio of idle to busy time to guide DVS. – Only work well if processor utilization is regular. – No service quality guarantees. • Ours: episode classification based – – – Find important execution episodes – predict their performance. Works with existing user programs. Works well with irregular workloads. Uses information in kernel to derive deadlines automatically. Impact on response time is automatically quantified. • Performance can be adapted to the user’s preference. Krisztián Flautner - manowar@engin. umich. edu Automatic Performance Setting for Dynamic Voltage Scaling 9
Episode classification • Interactive episodes – When the user is waiting for the computer to respond. • Periodic episodes – Producer (e. g. MP 3 player). – Consumer (e. g. sound daemon). Krisztián Flautner - manowar@engin. umich. edu Automatic Performance Setting for Dynamic Voltage Scaling 10
A utilization trace Each horizontal quantum is a millisecond, height corresponds to the utilization in that quantum. Krisztián Flautner - manowar@engin. umich. edu Automatic Performance Setting for Dynamic Voltage Scaling 11
Episode classification Interactive (Acrobat Reader), Producer (MP 3 playback), and Consumer (esd sound daemon) episodes. Krisztián Flautner - manowar@engin. umich. edu Automatic Performance Setting for Dynamic Voltage Scaling 12
Mouse movement X server updates screen every ~10 ms. Update takes ~0. 25 ms. Krisztián Flautner - manowar@engin. umich. edu Automatic Performance Setting for Dynamic Voltage Scaling 13
Interactive episodes Krisztián Flautner - manowar@engin. umich. edu Automatic Performance Setting for Dynamic Voltage Scaling 14
Interactive episodes can include idle time Waiting for data from the network during a run of Netscape. Page rendering starts after 250 ms. Krisztián Flautner - manowar@engin. umich. edu Automatic Performance Setting for Dynamic Voltage Scaling 15
Finding interactive episodes • One way: mouse click indicates start, idle time indicates end. – Inaccurate, latency in finding the end of the episode. • Our approach: track inter-task communication. – Start of an interactive episode: • X server sends a message to another task. – During interactive episode: • Keep track of communicating tasks (episode’s task set). • Compute desired metrics. – Conditions for ending the episode (applied to tasks in task set): • • No tasks are executing. Data written by the tasks have been consumed. No task was preempted the last time it ran. No tasks are blocked on I/O. Krisztián Flautner - manowar@engin. umich. edu Automatic Performance Setting for Dynamic Voltage Scaling 16
Characteristics of Interactive Episodes • Faster is not necessarily better. – Human perception has finite resolution. – Perception threshold is ~50 ms. – The goal is to run fast enough to meet the perception threshold, no point to running any faster. • Many interactive episodes are already fast enough. • More will be imperceptible in the near future. – 200 ms perception threshold today estimates work done during 50 ms 3 years from now. Slow down the processor! Krisztián Flautner - manowar@engin. umich. edu Automatic Performance Setting for Dynamic Voltage Scaling 17
Time above the perception threshold is given as a percentage of time spent in all interactive episodes. Krisztián Flautner - manowar@engin. umich. edu Automatic Performance Setting for Dynamic Voltage Scaling 18
The key: performance-setting algorithm • Use episode detection and classification. – Interactive episodes. – Periodic episodes (producer and consumer). • Performance-setting on a per episode basis. • Stretch episodes to their deadlines. – Interactive episode: perception threshold. – Stretch producer to consumer. No modification of existing programs needed. Works with irregular processor utilization and multiprogramming. Krisztián Flautner - manowar@engin. umich. edu Automatic Performance Setting for Dynamic Voltage Scaling 19
Cumulative interactive episode length distribution Max. performance Frame. Maker Minimum performance level sufficient Cumulative number Cumulative time Episode length (sec) Krisztián Flautner - manowar@engin. umich. edu Automatic Performance Setting for Dynamic Voltage Scaling 20
Performance-setting strategy for interactive episodes • Predict the performance factor that would be correct most of the time (not for most events). – Based on past optimal performance factors. • Limit worst case impact on response time. – Run at full performance after Panic. Threshold is reached. Krisztián Flautner - manowar@engin. umich. edu Automatic Performance Setting for Dynamic Voltage Scaling 21
Performance-setting for interactive episodes At the beginning of the episode • • Wait 5 ms before transition to ignore short episodes Switch to predicted performance level. During the episode • If episode duration reaches Panic. Threshold, switch to maximum performance. At the end of the episode • • • Estimate full performance episode duration. Compute optimum performance level for past episode. Compute new prediction based on optimum settings. Panic. Threshold = Perception. Threshold(1 + Performance. Factor) Predicted Performance. Factor is the average of past optimum settings, weighted by the corresponding episode lengths. Krisztián Flautner - manowar@engin. umich. edu Automatic Performance Setting for Dynamic Voltage Scaling 22
Performance-setting algorithm Periodic activity detected • • Enter period-sampling mode. Switch to maximum performance. Establish base performance level. Exit period-sampling mode. Start of interactive episode • If not in period-sampling mode, apply interactive episode performance-setting policy. End of interactive episode • • Update interactive episode statistics. Switch to base performance level, if there is periodic activity on the machine. Krisztián Flautner - manowar@engin. umich. edu Automatic Performance Setting for Dynamic Voltage Scaling 23
Performance factor Performance-setting during the Acrobat Reader benchmark (200 ms p. t. ) Transitions to maximum performance level are due to reaching the Panic. Threshold Time (sec) Krisztián Flautner - manowar@engin. umich. edu Automatic Performance Setting for Dynamic Voltage Scaling 24
Performance-setting during the Acrobat Reader + MP 3 benchmark (200 ms p. t. ) Full performance for periodic activity. Performance factor Transitions due to Panic. Threshold Time (sec) Krisztián Flautner - manowar@engin. umich. edu Automatic Performance Setting for Dynamic Voltage Scaling 25
Hardware assumptions Minimum performance 150 Mhz @ 0. 75 V Maximum performance 1000 Mhz @ 1. 75 V PLL resynch time (stalls execution) 0. 02 ms Voltage transition time 1 ms Assumptions based on Intel Xscale. We assume that processor switches to sleep mode when it is not executing an episode. Krisztián Flautner - manowar@engin. umich. edu Automatic Performance Setting for Dynamic Voltage Scaling 26
Energy factors (no MP 3) Krisztián Flautner - manowar@engin. umich. edu Automatic Performance Setting for Dynamic Voltage Scaling 27
Energy factors with MP 3 playback Krisztián Flautner - manowar@engin. umich. edu Automatic Performance Setting for Dynamic Voltage Scaling 28
Before performance scaling After performance scaling Cumulative percentage of time Changes in cumulative episode lengths as the result of performance scaling (Xemacs 50 ms p. t. ) Episode length (sec) Krisztián Flautner - manowar@engin. umich. edu Automatic Performance Setting for Dynamic Voltage Scaling 29
Vertigo • A DVS implementation for Linux 2. 4 kernel. • Currently runs on Transmeta Crusoe. – Test machine: Sony Picture. Book (PCG-C 1 VN) using TM 5600 processor (300 Mhz-600 Mhz). Goals: • Robust implementation. • Evaluate our algorithms on computers with DVS. • Contrast with conventional DVS algorithm (Long. Run). Krisztián Flautner - manowar@engin. umich. edu Automatic Performance Setting for Dynamic Voltage Scaling 30
Vertigo vs. Long. Run • Long. Run: implemented as part of the processor. – Interval based algorithm (guided by busy vs. idle time). – Min. and max. range is controllable in software. • Vertigo: implemented in OS kernel. – Classification based algorithm. – Distinguishes important from unimportant parts of execution. – Takes the quality of the user experience into account. • Qualitative comparison on following graphs. – The two runs of the benchmarks are close but not identical. • Human repeated the runs of the benchmark. – Transitions to sleep are not shown. – Same perceived interactive performance. Krisztián Flautner - manowar@engin. umich. edu Automatic Performance Setting for Dynamic Voltage Scaling 33
Performance level No user activity Long. Run Performance level 100% = 600 Mhz @ 1. 6 V Time (s) Frequency range of the TM 5600 processor. Max. energy savings that should be expected on this processor is ~34%. 50% = 300 Mhz @ 1. 3 V Vertigo Time (s) Krisztián Flautner - manowar@engin. umich. edu Automatic Performance Setting for Dynamic Voltage Scaling 34
Performance level Emacs Long. Run Performance level Time (s) Vertigo Time (s) Krisztián Flautner - manowar@engin. umich. edu Automatic Performance Setting for Dynamic Voltage Scaling 35
Performance level Acrobat Reader Long. Run Performance level Time (s) Vertigo Time (s) Krisztián Flautner - manowar@engin. umich. edu Automatic Performance Setting for Dynamic Voltage Scaling 36
Performance level Acrobat Reader with sleep transitions Long. Run Performance level Frequent transitions to/from sleep mode. Time (s) Longer durations without sleeping. Vertigo Time (s) Krisztián Flautner - manowar@engin. umich. edu Automatic Performance Setting for Dynamic Voltage Scaling 37
Desired improvements • Processor parameters are good enough. – Faster voltage transitions would help a little. – As peak performance gets higher, lower minimum performance is desirable. • More sophisticated prediction algorithms. – Distinguish between episode instances, not just episode types. • Larger performance range for DVS processor. – Puts more pressure on performance-setting algorithm. – More opportunity for energy savings. Krisztián Flautner - manowar@engin. umich. edu Automatic Performance Setting for Dynamic Voltage Scaling 38
Conclusions • Many interactive episodes are already fast enough. – More will be fast enough in the near future. – Use Dynamic Voltage Scaling to save energy. • Episode classification based on inter-task communication. – Fast, accurate, no user program modifications required. • Performance-setting based on episode classification. – Works well with multiprogramming, irregular processor utilization. – Ensures high quality interactive performance. – Significant energy savings (10%-80%). Krisztián Flautner - manowar@engin. umich. edu Automatic Performance Setting for Dynamic Voltage Scaling 39
Future work • Evaluate our algorithms on real hardware. – Processors are slowly becoming available. – Impact on interactive performance. • An API to specify episodes. – Light-weight: specify hints, not complete information. – Works in concert with existing detection mechanism. • Apply episode detection to other problems. – Scheduler: can real-time deadlines be detected automatically? Krisztián Flautner - manowar@engin. umich. edu Automatic Performance Setting for Dynamic Voltage Scaling 40
fin. Krisztián Flautner - manowar@engin. umich. edu Automatic Performance Setting for Dynamic Voltage Scaling 41
Response time The time it takes for the computer to respond to user initiated events. • Faster is not always better. – Fundamental limit to what is perceptible to humans. • • Movies: 20 -30 frames per second. Perceptual causality: 50 ms-100 ms. Dragging objects on screen: 200 ms. Non-continuous operation: 1 -2 sec. The goal is to run fast enough to meet the perception threshold, no point to running any faster. Krisztián Flautner - manowar@engin. umich. edu Automatic Performance Setting for Dynamic Voltage Scaling 42
The performance gap Krisztián Flautner - manowar@engin. umich. edu Automatic Performance Setting for Dynamic Voltage Scaling 43
Cumulative interactive episode length distribution Max. performance Xemacs Minimum performance level sufficient Cumulative number Cumulative time Episode length (sec) Krisztián Flautner - manowar@engin. umich. edu Automatic Performance Setting for Dynamic Voltage Scaling 44
Communication between tasks Krisztián Flautner - manowar@engin. umich. edu Automatic Performance Setting for Dynamic Voltage Scaling 45
Producer and consumer episodes • Example: MP 3 playback through esd sound daemon. • Monitor communications to/from sound daemon. • Distance between producer and consumer episodes determines necessary performance level. Krisztián Flautner - manowar@engin. umich. edu Automatic Performance Setting for Dynamic Voltage Scaling 46












































