1 Mobile Software Development Framework: Adaptive Mobile Applications 10/23/2012 Y. Richard Yang.

Slides:



Advertisements
Similar presentations
Eduardo Cuervo - Duke Aruna Balasubramanian - U Mass Amherst Dae-ki Cho - UCLA Alec Wolman, Stefan Saroiu, Ranveer Chandra, Paramvir Bahl – Microsoft Research.
Advertisements

System Integration and Performance
Categories of I/O Devices
Operating Systems Lecture 10 Issues in Paging and Virtual Memory Adapted from Operating Systems Lecture Notes, Copyright 1997 Martin C. Rinard. Zhiqing.
Cloud Computing Resource provisioning Keke Chen. Outline  For Web applications statistical Learning and automatic control for datacenters  For data.
Pervasive Web Content Delivery with Efficient Data Reuse Chi-Hung Chi and Cao Yang School of Computing National University of Singapore
Distributed Multimedia Systems
Web Caching Schemes1 A Survey of Web Caching Schemes for the Internet Jia Wang.
1: Operating Systems Overview
Alec Wolman, Stefan Saroiu, Ranveer Chandra, Victor Bahl – Microsoft Research Eduardo Cuervo – Duke Aruna Balasubramanian – U Mass Amherst Dae-ki Cho -
Chapter 13 Embedded Systems
Optimization Of Power Consumption For An ARM7- BASED Multimedia Handheld Device Hoseok Chang; Wonchul Lee; Wonyong Sung Circuits and Systems, ISCAS.
Computer Organization and Architecture
CHAPTER 9: Input / Output
16: Distributed Systems1 DISTRIBUTED SYSTEM STRUCTURES NETWORK OPERATING SYSTEMS The users are aware of the physical structure of the network. Each site.
Processor Frequency Setting for Energy Minimization of Streaming Multimedia Application by A. Acquaviva, L. Benini, and B. Riccò, in Proc. 9th Internation.
Client-Server Computing in Mobile Environments
ThinkAir: Dynamic Resource Allocation and Parallel Execution in Cloud for Mobile Code Offloading Sokol Kosta, Pan Hui Deutsche Telekom Labs, Berlin, Germany.
Replay Debugging for Distributed Systems Dennis Geels, Gautam Altekar, Ion Stoica, Scott Shenker.
Adaptive Video Coding to Reduce Energy on General Purpose Processors Daniel Grobe Sachs, Sarita Adve, Douglas L. Jones University of Illinois at Urbana-Champaign.
CS 423 – Operating Systems Design Lecture 22 – Power Management Klara Nahrstedt and Raoul Rivas Spring 2013 CS Spring 2013.
1 Mobile Software Development Framework: Mobile-Cloud Services (Push/Track) 10/18/2012 Y. Richard Yang.
 Energy Results: Memory Assistant Arcade Game  Performance Results:  Response Time ▪ Memory assistant: 17.3 sec -> 1.5 sec ▪ Arcade game: 6 FPS -> 13.
Computation Offloading
1 Mobile Software Development Framework: Adaptive Mobile Applications 10/23/2012 Y. Richard Yang.
LOGO OPERATING SYSTEM Dalia AL-Dabbagh
M i SMob i S Mob i Store - Mobile i nternet File Storage Platform Chetna Kaur.
Integrating Fine-Grained Application Adaptation with Global Adaptation for Saving Energy Vibhore Vardhan, Daniel G. Sachs, Wanghong Yuan, Albert F. Harris,
CHAPTER 9: Input / Output
Energy-Efficient Soft Real-Time CPU Scheduling for Mobile Multimedia Systems Wanghong Yuan, Klara Nahrstedt Department of Computer Science University of.
1 Mobile Software Development Framework: Mobile-Cloud Service 10/18/2012 Y. Richard Yang.
A Framework for Elastic Execution of Existing MPI Programs Aarthi Raveendran Tekin Bicer Gagan Agrawal 1.
A Framework for Elastic Execution of Existing MPI Programs Aarthi Raveendran Graduate Student Department Of CSE 1.
Mobile Middleware for Energy-Awareness Wei Li
Timecard: Controlling User-Perceived Delays in Server-Based Mobile Applications Lenin Ravindranath, Jitu Padhye, Ratul Mahajan, Hari Balakrishnan.
Hardware Image Signal Processing and Integration into Architectural Simulator for SoC Platform Hao Wang University of Wisconsin, Madison.
Application Heartbeats Henry Hoffmann, Jonathan Eastep, Marco Santambrogio, Jason Miller, Anant Agarwal CSAIL Massachusetts Institute of Technology Cambridge,
A Low-bandwidth Network File System Athicha Muthitacharoen et al. Presented by Matt Miller September 12, 2002.
Dynamic Voltage Frequency Scaling for Multi-tasking Systems Using Online Learning Gaurav DhimanTajana Simunic Rosing Department of Computer Science and.
Intel Research & Development ETA: Experience with an IA processor as a Packet Processing Engine HP Labs Computer Systems Colloquium August 2003 Greg Regnier.
Eduardo Cuervo – Duke University Aruna Balasubramanian - University of Massachusetts Amherst Dae-ki Cho - UCLA Alec Wolman, Stefan Saroiu, Ranveer Chandra,
A Low-bandwidth Network File System Presentation by Joseph Thompson.
Aneka Cloud ApplicationPlatform. Introduction Aneka consists of a scalable cloud middleware that can be deployed on top of heterogeneous computing resources.
Multimedia Computing and Networking Jan Reduced Energy Decoding of MPEG Streams Malena Mesarina, HP Labs/UCLA CS Dept Yoshio Turner, HP Labs.
Determining Optimal Processor Speeds for Periodic Real-Time Tasks with Different Power Characteristics H. Aydın, R. Melhem, D. Mossé, P.M. Alvarez University.
Embedded Real-Time Systems Processing interrupts Lecturer Department University.
Computer System Optimization. Introduction PC with Software NVR The main components of PC and the factors when choosing a PC Dual streaming Standalone.
1 Chapter 2: Operating-System Structures Services Interface provided to users & programmers –System calls (programmer access) –User level access to system.
Amazon Web Services. Amazon Web Services (AWS) - robust, scalable and affordable infrastructure for cloud computing. This session is about:
1.3 Operating system services An operating system provide services to programs and to the users of the program. It provides an environment for the execution.
Fault – Tolerant Distributed Multimedia Streaming Web Application By Nirvan Sagar – Srishti Ganjoo – Syed Shahbaaz Safir
Dynamic Mobile Cloud Computing: Ad Hoc and Opportunistic Job Sharing.
Implementing Remote Procedure Call
Adaptive Mobile Applications
SEDA: An Architecture for Scalable, Well-Conditioned Internet Services
Operating Systems : Overview
Lecture 14 Virtual Memory and the Alpha Memory Hierarchy
Chapter 7 Multimedia 7.1 Introduction to multimedia
Chapter 7 Multimedia 7.1 Introduction to multimedia
Remote Procedure Call Landon Cox February 7, 2018.
Chapter 7 Multimedia 7.1 Introduction to multimedia
Operating Systems : Overview
Where Intelligence Lives & Intelligence Management
Operating Systems : Overview
Technical Capabilities
Chapter 7 Multimedia 7.1 Introduction to multimedia
Co-designed Virtual Machines for Reliable Computer Systems
Chapter 7 Multimedia 7.1 Introduction to multimedia
Presentation transcript:

1 Mobile Software Development Framework: Adaptive Mobile Applications 10/23/2012 Y. Richard Yang

2 Outline r Admin r Mobile cloud services m Push notification service m Track service m Storage service

3 Admin. r HW3 r Project ideas

Recap: Example Mobile Cloud Services r Push notification service r Location based service, e.g., m Track service (supporting location based services) r Storage services, e.g., m iCloud, Google Drive, Dropbox r Proxy service, e.g., m Kindle Split Browser m Recognition/synthesis services 4

Recap: Push Notification Service r A single persistent connection between Push Notification Service (PNS) and Mobile Device r Authorization m App register with PNS m Device app registers with PNS and forwards registration to PNS m App can send only to registrations r Scalability, fault tolerance, generality m Send only notification, does not hold data 5

Recap: Track Service  TC JoinTrackCollections (TC tCs[], bool removeDuplicates)  TC SortTracks (TC tC, SortAttribute attr)  TC TakeTracks(TC tC, int count)  TC GetSimilarTracks (TC tC, Track refTrack, float simThreshold)  TC GetPassByTracks (TC tC, Area[] areas)  TC GetCommonSegments(TC tC, float freqThreshold) Manipulation Creation  TC MakeCollection(GroupCriteria criteria, bool removeDuplicates) 6

API Usage: Ride-Sharing Application // get user’s most popular track in the morning TC myTC = MakeCollection(“name = Maya”, [ ], true); TC myPopTC = SortTracks(myTC, FREQ); Track track = GetTracks(myPopTC, 0, 1); // find tracks of all fellow employees TC msTC = MakeCollection(“name.Employer = MS”, [ ], true); // pick tracks from the community most similar to user’s popular track TC similarTC = GetSimilarTracks(msTC, track, 0.8); Track[] similarTracks = GetTracks(similarTC, 0, 20); // Verify if each track is frequently traveled by its respective owner User[] result = FindOwnersOfFrequentTracks(similarTracks);

Outline r Admin and recap r Mobile Cloud Services m Push notification service m Location based service m Storage service 8

Storage/Sync Service r Store content in cloud to be accessible by multiple selected devices r Deployed services, e.g., m iCloud m Google Drive android-uihttps://developers.google.com/drive/integrate- android-ui m DropBox 9

Storage/Sync Service Example: iCloud r Backend m Hosted by Windows Azure and Amazon AWS m Uses HTTPS to send to servers r Client storage models m Key Value Store m UIDocument m Core data r More details: see iCloud sessions m =209 10

11 Problems Caused by Mobile Storage r Read miss m stalls progress (user has to wait for data) r Synchronization/consistency m user may see outdated data m user modification may generate conflicts

12 Approaches r Read miss m explicit user file selection m automatic hoarding/prediction, e.g., CODA, SEER r Synchronization/consistency m keep modification logs and develop merge tools, e.g., Bayou m efficient file comparisons and merging, e.g., rsync, LBFS

Amazon Silk Split-Browser r Dynamic split browsing m Intelligently partition work between local and Amazon cloud 13

Outline r Admin and recap r Adaptive mobile applications 14

15 Adaptive Mobile App: Bigger Picture device in-net proxy in-net service On-device app/sys adaptation Service partition Device-aware service delivery

Outline r Admin and recap r Adaptive mobile applications m Client adaptation 16

Example: iphone

18 CPU Power Consumption Model r The power consumption rate P of a CMOS processor satisfies where k is a constant, C the capacitance of the circuit, f the CPU frequency, and V the voltage r When the supply voltage V is lower, charging/discharging time is longer; thus frequency should be lower => P ~ O(V 3 )

19 CPU Power Model Discussion: what voltage to operate on? throughput

20 Dynamic Voltage Scaling r Basic idea: determining voltage according to program response time requirement r For normal applications, give reasonable response time r For multimedia applications, use the deadline to determine voltage

21 Architecture CPU monitoring scheduling speed scaling demand distribution scheduler speed adaptor profiler multimedia applications requirements time constraint

22 Demand Prediction  Online profiling and estimation: count number of cycles used by each job b 1 b 2 C min =b 0 b r =C max 1 b r-1 cumulative probability CDF F(x) = P [X  x]

23 Observations Demand distribution is stable or changes slowly

24 CPU Resource Allocation How many cycles to allocate to a multimedia job? Application should meet  percent of deadlines  each job meets deadline with probability   allocate C cycles, such that F (C ) =P [X  C ]   b 1 b 2 b 0 brbr 1 b r-1 cumulative probability F(x)F(x)  C

25 How Fast to Run the CPU?  Assume the strategy is to run job i at a fix (also called uniform) speed S i  Assume it needs C i cycles during a time duration of P i  Fact: since power is a convex function of frequency, if a job needs C cycles in a period P, then the optimal frequency is C/P, namely the lowest constant frequency.

26 Why Not Uniform Speed? Intuitively, uniform speed achieves - minimum energy if use the allocated exactly However, jobs use cycles statistically - often complete before using up the allocated - potential to save more energy  stochastic DVS

27 Stochastic DVS For each job 1.find speed S x for each allocated cycle x  time is 1/S x and energy is (1 - F(x))S 3 x such that

28 Example Speed Schedule 100 MHz200 MHz400 MHz cycle: speed: Job x10 6 cycles speed (MHz) Job x10 6 cycles Observation: speed up the processor with increasing clock cycles

29 DVS speed A1 B1 A1 execution speed up within job context switch 1.Store speed for switched-out 2.New speed for switched-in switch back A2

30 Implementation Hardware: HP N5470 laptop –Athlon CPU (300, 500, 600, 700, 800, 1000MHz)  round speed schedule to upper bound process control block standard Linux scheduler DVS modules PowerNow speed scaling Soft real-time scheduling system call Extension to Linux kernel lines of C code

31 Reduces power consumption However, limited due to few speed options Evaluation: Normalized Energy

32 Odyssey: An Example Client Architecture r Application indicates resource capabilities in its request to service r Operating system maintains/monitors available resources m no need to have each application re-implement the monitoring r An application registers a resource descriptor and an upcall event handler with the OS r OS notifies the application upon detecting resource changes r Application adjusts requests to the server

33 Client System Model

Outline r Admin and recap r Adaptive mobile applications m Client adaptation m Server adaptation 34

35 Server/Content Adaptation: Examples Objective: automating adaptation

36 Example: Adapting Audio Content r Send a lower resolution stream as the redundant information, e.g. nominal stream at 64 kbps and redundant stream at 13 kbps (such as GSM) 2 3

37 Example: Adapting Fidelity of Video/Image Content? r Potentially many dimensions m frame rate (for video) m image size m quality of image r Usage: e.g., data acceleration offered by many carriers

38 Frame Encoding: Block Transform Encoding DCT Zig-zag Quantize Run-length Code Huffman Code

39 Discrete Cosine Transform F[u,v] = 4C(u)C(v) n2n2  n-1 j=0 k=0 f(j,k) cos (2j+1)u  2n (2k+1)v  2n cos where C(w) = 1  2 1 for w=0 for w=1,2,…,n-1 DCT is better at reducing redundancy than Discrete Fourier Transform but it is more computationally expensive

40 Basis Functions of DCT - An image is a superposition of basis functions - DCT computes the contribution of each basis function - F[u,v]: for the basis function at position [u, v] more detail

41 Example: MPEG Block Encoding original image DCT DC component AC components Quantize zigzag run-length and Huffman encoding of the stream coded bitstream < 10 bits (0.55 bits/pixel) Discussion: how to generate different encoding rates?

42 Examples Uncompressed (262 KB) Compressed (22 KB, 12:1) Compressed (6 KB, 43:1)

Outline r Admin and recap r Adaptive mobile applications m Client adaptation m Server adaptation m Proxy and job partition 43

Example Benefit of Cloud (RTT -> Server) 44

Example: MAUI 45 Maui server Smartphone Application Client Proxy Profiler Solver Maui Runtime Server Proxy Profiler Solver Maui Runtime Application RPC Maui Controller

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

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

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

B 900 mJ 15ms C 5000 mJ 3000 ms 1000mJ mJ D mJ ms mJ A Computation energy and delay for execution Energy and delay for state transfer A sample callgraph

FindMatch 900 mJ InitializeFace Recognizer 5000 mJ 1000mJ mJ DetectAndExtract Faces mJ mJ User Interface Cheaper to do local

FindMatch 900 mJ InitializeFace Recognizer 5000 mJ 1000mJ mJ DetectAndExtract Faces mJ mJ User Interface Cheaper to do local

FindMatch InitializeFace Recognizer 1000mJ DetectAndExtract Faces User Interface 20900mJ Cheaper to offload

MAUI Implementation r Platform m Windows Mobile 6.5 m.NET Framework 3.5 m HTC Fuze Smartphone m Monsoon power monitor r Applications m Chess m Face Recognition m Arcade Game m Voice-based translator

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

Big savings even on 3G An order of magnitude improvement on Wi-Fi Face Recognizer

Improvement of around an order of magnitude Face Recognizer

Up to 40% energy savings on Wi-Fi Solver would decide not to offload Arcade Game

CPU Intensive even on a Core 2 Duo PC Can be run on the phone with MAUI Translator

DoLevel HandleMissiles DoFrame HandleEnemies HandleBonuses 11KB + missiles missiles *Missiles take around 60 bytes each 11KB + missiles Required state is smaller Complexity increases with # of missiles

DoLevel HandleMissiles DoFrame HandleEnemies HandleBonuses *Missiles take around 60 bytes each  Zero Missiles  Low latency (RTT < 10ms) Computation cost is close to zero Offload starting at DoLevel

DoLevel HandleMissiles DoFrame HandleEnemies HandleBonuses *Missiles take around 60 bytes each  5 Missiles  Some latency (RTT = 50ms) Most of the computation cost Very expensive to offload everything Little state to offload Only offload Handle Missiles

62

 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

64

65  The CODA system assumes that modifications are kept as logs (CML)  a user sends the logs to the servers to update  If the storage of a client is limited, it may not be able to save logs  then upon reconnection, the cache manager needs to find the difference between the stored file and its local cached copy  same problem exists for the rsync tool !  Question: how to efficiently compare the differences of two remote files (when the network connection is slow)?

66  Break Files into chunks and transfer only modified chunks  Fixed chunk size does not work well  why?

67  Compute hash value of every 48 byte block  if the hash value equals to a magic value, it is a chunk boundary

68 Bayou: Managing Update Conflicts r Basic idea: application specific conflict detection and update r Two mechanisms for automatic conflict detection and resolution m dependency check m merge procedure df