MAUI Making Smartphones Last Longer With Code Offload

  • Slides: 29
Download presentation
MAUI: Making Smartphones Last Longer With Code Offload Eduardo Cuervo - Duke Aruna Balasubramanian

MAUI: Making Smartphones Last Longer With Code Offload Eduardo Cuervo - Duke Aruna Balasubramanian - U Mass Amherst Dae-ki Cho - UCLA Alec Wolman, Stefan Saroiu, Ranveer Chandra, Paramvir Bahl – Microsoft Research

Battery is a scarce resource Li-Ion Energy Density 250 Wh/Kg 200 150 100 Just

Battery is a scarce resource Li-Ion Energy Density 250 Wh/Kg 200 150 100 Just 2 X in 15 years 50 0 91 92 93 94 95 96 97 98 Year 99 00 01 02 03 04 05 �CPU performance during same period: 246 X �A solution to the battery problem seems unlikely

Mobile apps can’t reach their full potential Slow, Limited or Inaccurate Not on par

Mobile apps can’t reach their full potential Slow, Limited or Inaccurate Not on par with desktop counterparts Interactive Games Speech Recognition and. Power Synthesis Intensive Too CPU intensive Augmented Reality Limited

One Solution: Remote Execution � Remote execution can reduce energy consumption � Challenges: What

One Solution: Remote Execution � Remote execution can reduce energy consumption � Challenges: What should be offloaded? How to dynamically decide when to offload? How to minimize the required programmer effort?

MAUI: Mobile Assistance Using Infrastructure MAUI Contributions: �Combine extensive profiling with an ILP solver

MAUI: Mobile Assistance Using Infrastructure MAUI Contributions: �Combine extensive profiling with an ILP solver Makes dynamic offload decisions Optimize for energy reduction Profile: device, network, application �Leverage modern language runtime (. NET CLR) To simplify program partitioning Reflection, serialization, strong typing

Roadmap �Motivation �MAUI system design MAUI proxy MAUI profiler MAUI solver �Evaluation �Conclusion

Roadmap �Motivation �MAUI system design MAUI proxy MAUI profiler MAUI solver �Evaluation �Conclusion

MAUI Architecture Maui Runtime Client Proxy Maui Runtime RPC Server Proxy Application Profiler Solver

MAUI Architecture Maui Runtime Client Proxy Maui Runtime RPC Server Proxy Application Profiler Solver Profiler RPC Solver Maui Controller Smartphone Maui server

How Does a Programmer Use MAUI? �Goal: make it dead-simple to MAUI-ify apps Build

How Does a Programmer Use MAUI? �Goal: make it dead-simple to MAUI-ify apps Build app as a standalone phone app Add. NET attributes to indicate “remoteable” Follow a simple set of rules

Language Run-Time Support For Partitioning �Portability: Mobile (ARM) vs Server (x 86) . NET

Language Run-Time Support For Partitioning �Portability: Mobile (ARM) vs Server (x 86) . NET Framework Common Intermediate Language �Type-Safety and Serialization: Automate state extraction �Reflection: Identifies methods with [Remoteable] tag Automates generation of RPC stubs

MAUI Proxy Maui Runtime Handles Errors Maui Runtime Provides runtime information RPC Client Proxy

MAUI Proxy Maui Runtime Handles Errors Maui Runtime Provides runtime information RPC Client Proxy Application Intercepts Application Calls Profiler Synchronizes State RPC Solver local or remote Chooses Server Proxy Application Profiler Solver Maui Controller Smartphone Maui server

MAUI Profiler State size CPU Cycles Execution Time Callgraph Network Latency Profiler Annotated Callgraph

MAUI Profiler State size CPU Cycles Execution Time Callgraph Network Latency Profiler Annotated Callgraph Computational Power Cost Computational Delay Device Profile Network Bandwidth Network Power Cost Network Delay Computational Delay

MAUI Solver 10000 m. J A sample callgraph A Energy C 5000 m. J

MAUI Solver 10000 m. J A sample callgraph A Energy C 5000 m. J 3000 ms B and delay for state 900 transfer m. J 15 ms Computation energy and delay for execution 1000 m. J 25000 m. J D 15000 m. J 12000 ms

Is Global Program Analysis Needed? 10000 m. J Yes! – This simple example from

Is Global Program Analysis Needed? 10000 m. J Yes! – This simple example from Face Recognition app shows why local analysis fails. User Interface 1000 m. J Initialize. Face Recognizer 5000 m. J Find. Match 900 m. J 25000 Cheaper to do local m. J Detect. And. Extract Faces 15000 m. J

Is Global Program Analysis Needed? 10000 m. J Yes! – This simple example from

Is Global Program Analysis Needed? 10000 m. J Yes! – This simple example from Face Recognition app shows why local analysis fails. User Interface 1000 m. J Initialize. Face Recognizer 5000 m. J Cheaper to do local Find. Match 900 m. J 25000 m. J Detect. And. Extract Faces 15000 m. J Cheaper to do local

Is Global Program Analysis Needed? Initialize. Face Recognizer User Interface 1000 m. J Find.

Is Global Program Analysis Needed? Initialize. Face Recognizer User Interface 1000 m. J Find. Match Cheaper to offload 25900 m. J Detect. And. Extract Faces

Can MAUI Adapt to Changing Conditions? �Adapt to: Network Bandwidth/Latency Changes Variability on method’s

Can MAUI Adapt to Changing Conditions? �Adapt to: Network Bandwidth/Latency Changes Variability on method’s computational requirements �Experiment: Modified off the shelf arcade game application Physics Modeling (homing missiles) Evaluated under different latency settings

Can MAUI Adapt to Changing Conditions? 11 KB miss + iles Handle. Enemies Do.

Can MAUI Adapt to Changing Conditions? 11 KB miss + iles Handle. Enemies Do. Frame Handle. Bonuses Do. Level s sile mis 11 KB + missiles Required state is smaller Handle. Missiles Complexity increases with # of missiles *Missiles take around 60 bytes each

Case 1 �Zero Missiles �Low latency (RTT < 10 ms) Do. Frame Do. Level

Case 1 �Zero Missiles �Low latency (RTT < 10 ms) Do. Frame Do. Level Handle. Enemies Handle. Bonuses Offload starting at Do. Level Handle. Missiles Computation cost is close to zero *Missiles take around 60 bytes each

Case 2 � 5 Missiles �Some latency (RTT = 50 ms) Do. Frame Handle.

Case 2 � 5 Missiles �Some latency (RTT = 50 ms) Do. Frame Handle. Enemies Handle. Bonuses Do. Level Very expensive to offload everything Little state to offload Only offload Handle Missiles Handle. Missiles Most of the computation cost *Missiles take around 60 bytes each

Roadmap �Motivation �MAUI system design MAUI proxy MAUI profiler MAUI solver �Evaluation �Conclusion

Roadmap �Motivation �MAUI system design MAUI proxy MAUI profiler MAUI solver �Evaluation �Conclusion

MAUI Implementation �Platform Windows Mobile 6. 5 . NET Framework 3. 5 HTC Fuze

MAUI Implementation �Platform Windows Mobile 6. 5 . NET Framework 3. 5 HTC Fuze Smartphone Monsoon power monitor �Applications Chess Face Recognition Arcade Game Voice-based translator

Questions � How much can MAUI reduce energy consumption? � How much can MAUI

Questions � How much can MAUI reduce energy consumption? � How much can MAUI improve performance? � Can MAUI Run Resource-Intensive Applications?

How much can MAUI reduce energy consumption? 35 Face Recognizer Smartphone only MAUI (Wi-Fi,

How much can MAUI reduce energy consumption? 35 Face Recognizer Smartphone only MAUI (Wi-Fi, 10 ms RTT) MAUI (Wi-Fi, 25 ms RTT) MAUI (Wi-Fi, 50 ms RTT) MAUI (Wi-Fi, 100 ms RTT) MAUI* (3 G, 220 ms RTT) 30 Energy (Joules) 25 20 15 10 5 0 An order of magnitude improvement on Wi-Fi Big savings even on 3 G

How much can MAUI improve performance? Face Recognizer 21, 000 Smartphone only MAUI (Wi-Fi,

How much can MAUI improve performance? Face Recognizer 21, 000 Smartphone only MAUI (Wi-Fi, 10 ms RTT) MAUI (Wi-Fi, 25 ms RTT) MAUI (Wi-Fi, 50 ms RTT) MAUI (Wi-Fi, 100 ms RTT) MAUI* (3 G, 220 ms RTT) Execution Duration (ms) 18, 000 15, 000 12, 000 9, 000 6, 000 3, 000 0 Improvement of around an order of magnitude

Latency to server impacts the opportunities for fine-grained offload Solver would decide not to

Latency to server impacts the opportunities for fine-grained offload Solver would decide not to offload Arcade Game 60 Smartphone only MAUI (Wi-Fi, 10 ms RTT) Energy (Joules) MAUI (Wi-Fi, 25 ms RTT) 40 MAUI (Wi-Fi, 50 ms RTT) MAUI (Wi. Fi, 100 ms RTT) MAUI* (3 G, 220 ms RTT) 20 0 Up to 40% energy savings on Wi-Fi

Can MAUI Run Resource-Intensive Applications? Translator 100 Can be run on the phone with

Can MAUI Run Resource-Intensive Applications? Translator 100 Can be run on the phone with MAUI CPU Consumption (%) 90 80 70 60 50 CPU 1 40 CPU 2 30 20 CPU Intensive even on a Core 2 Duo PC 10 0 00: 01 00: 44 01: 27 Time 02: 10 02: 53

Roadmap �Motivation �MAUI system design MAUI proxy MAUI profiler MAUI solver �Evaluation �Conclusion

Roadmap �Motivation �MAUI system design MAUI proxy MAUI profiler MAUI solver �Evaluation �Conclusion

Conclusions � MAUI enables developers to: Bypass the resource limitations of handheld devices Low

Conclusions � MAUI enables developers to: Bypass the resource limitations of handheld devices Low barrier entry: simple program annotations � For a resource-intensive application MAUI reduced energy consumed by an order of magnitude MAUI improved application performance similarly � MAUI adapts to: Changing network conditions Changing applications CPU demands

Questions? � http: //research. microsoft. com/en-us/projects/maui/ �ecuervo@cs. duke. edu

Questions? � http: //research. microsoft. com/en-us/projects/maui/ �ecuervo@cs. duke. edu