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

Slides:



Advertisements
Similar presentations
Network II.5 simulator ..
Advertisements

Eduardo Cuervo - Duke Aruna Balasubramanian - U Mass Amherst Dae-ki Cho - UCLA Alec Wolman, Stefan Saroiu, Ranveer Chandra, Paramvir Bahl – Microsoft Research.
A new Network Concept for transporting and storing digital video…………
CS Spring 2012 CS 414 – Multimedia Systems Design Lecture 14 – Introduction to Multimedia Resource Management Klara Nahrstedt Spring 2012.
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.
File Management Systems
OS Fall ’ 02 Introduction Operating Systems Fall 2002.
Chapter 13 Embedded Systems
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.
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.
9/14/2015B.Ramamurthy1 Operating Systems : Overview Bina Ramamurthy CSE421/521.
CHAPTER 2 OPERATING SYSTEM OVERVIEW 1. Operating System Operating System Definition A program that controls the execution of application programs and.
Monitoring Latency Sensitive Enterprise Applications on the Cloud Shankar Narayanan Ashiwan Sivakumar.
Integrating Fine-Grained Application Adaptation with Global Adaptation for Saving Energy Vibhore Vardhan, Daniel G. Sachs, Wanghong Yuan, Albert F. Harris,
1 Overview 1.Motivation (Kevin) 1.5 hrs 2.Thermal issues (Kevin) 3.Power modeling (David) Thermal management (David) hrs 5.Optimal DTM (Lev).5 hrs.
Energy-Efficient Soft Real-Time CPU Scheduling for Mobile Multimedia Systems Wanghong Yuan, Klara Nahrstedt Department of Computer Science University of.
Composition and Evolution of Operating Systems Introduction to Operating Systems: Module 2.
1 Mobile Software Development Framework: Mobile-Cloud Service 10/18/2012 Y. Richard Yang.
Sogang University Advanced Computing System Chap 1. Computer Architecture Hyuk-Jun Lee, PhD Dept. of Computer Science and Engineering Sogang University.
A Framework for Elastic Execution of Existing MPI Programs Aarthi Raveendran Tekin Bicer Gagan Agrawal 1.
Research Overview TalkOdyssey - 1 Odyssey Agile, Application-Aware Adaptation for Mobility Kip Walker some slides “borrowed” from Satya.
A Framework for Elastic Execution of Existing MPI Programs Aarthi Raveendran Graduate Student Department Of CSE 1.
CHAPTER TEN AUTHORING.
Mobile Middleware for Energy-Awareness Wei Li
Hardware Image Signal Processing and Integration into Architectural Simulator for SoC Platform Hao Wang University of Wisconsin, Madison.
1 Mobile Software Development Framework: Adaptive Mobile Applications 10/23/2012 Y. Richard Yang.
Application Heartbeats Henry Hoffmann, Jonathan Eastep, Marco Santambrogio, Jason Miller, Anant Agarwal CSAIL Massachusetts Institute of Technology Cambridge,
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,
Lev Finkelstein ISCA/Thermal Workshop 6/ Overview 1.Motivation (Kevin) 2.Thermal issues (Kevin) 3.Power modeling (David) 4.Thermal management (David)
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.
Processor Memory Processor-memory bus I/O Device Bus Adapter I/O Device I/O Device Bus Adapter I/O Device I/O Device Expansion bus I/O Bus.
09/13/04 CDA 6506 Network Architecture and Client/Server Computing Peer-to-Peer Computing and Content Distribution Networks by Zornitza Genova Prodanoff.
Embedded Real-Time Systems Processing interrupts Lecturer Department University.
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:
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.
Prof. Jong-Moon Chung’s Lecture Notes at Yonsei University
Overview Motivation (Kevin) Thermal issues (Kevin)
REAL-TIME OPERATING SYSTEMS
Adaptive Mobile Applications
SEDA: An Architecture for Scalable, Well-Conditioned Internet Services
Operating Systems : Overview
Credits: 3 CIE: 50 Marks SEE:100 Marks Lab: Embedded and IOT Lab
The Improvement of PaaS Platform ZENG Shu-Qing, Xu Jie-Bin 2010 First International Conference on Networking and Distributed Computing SQUARE.
Introduction to Cloud Computing
Collaborative Offloading for Distributed Mobile-Cloud Apps
Operating Systems : Overview
Operating Systems : Overview
Operating Systems : Overview
Operating Systems : Overview
Operating Systems : Overview
Technical Capabilities
Chapter 2: Operating-System Structures
Chapter 2: Operating-System Structures
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 r Adaptive mobile applications

3 Admin. r HW3 r Project ideas

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

Example: Push Notification Service r A single persistent connection between Push Notification Service (PNS) and each mobile device r Authorization m App developer registers project with PNS m App on device registers with PNS and forwards registration to PNS m App server sends to registered apps on devices r Scalability, fault tolerance, generality m Send only notification, not data m For reliability, use soft state, not hard state 5

Example: 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 Track service m Storage service 8

Storage/Sync Service r Store content in cloud to be accessible by multiple selected devices r Multiple deployed services, e.g., m iCloud m Google Drive m DropBox 9

Storage/Sync Service Example: iCloud r Backend m Hosted by Windows Azure and Amazon AWS m Uses HTTPS connect to servers r More details: see iCloud sessions m =209 10

11 Key Design Points for Mobile Storage r Data models m what data structure to put on 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 r Good topic for investigation/design projects m See backup slides for some pointers

Outline r Admin and recap r Adaptive mobile applications 12

Adaptive Mobile Applications r An adaptive mobile application adjusts the amounts as well as the locations of resources that it consumes r The objective typically is to m Improve responsiveness m Reduce energy consumption at device 13

Amazon Silk Split-Browser r Dynamically split browsing work between local device and Amazon cloud 14

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

Adaptive Mobile Applications: Overview r This is a large topic r We will look at an example on each entity 16 device in-net proxy service server On-device app/sys adaptation Service partition Device-aware service partition, delivery

Outline r Admin and recap r Adaptive mobile applications m Device adaptation 17

Discussion r What resource parameters/aspects of a mobile device can be controlled? /09/iphone5-spec-showdown/

Example: iphone iPhone 5 controls the CPU frequency idle downloading

20 Iphone5 A6 Processor processor /

21 CPU Power 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 )

22 CPU Power Model Question: r Suppose P ~ V 3. Do we save energy by reducing freq/vol to 1/3, but finish the same job? r What if linear: P ~ V? throughput

23 Dynamic Voltage Scaling r For convex power consumption rate, to minimize power for finishing a job, one may lower the freq/vol to close to 0 r Constraint m bound response time (e.g., deadline of multimedia playback)

24 Example Architecture: GraceOS CPU monitoring scheduling speed scaling demand distribution scheduler speed adaptor profiler multimedia applications requirements time constraint

25 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]

26 Demand Stability Demand distribution is stable or changes slowly

27 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

28 How Fast to Run the CPU?  Goal: provides 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.

29 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

30 Stochastic DVS For each job 1.find speed S x for each unit allocated cycle x b 1 b 2 C min =b 0 b r =C max 1 b r-1 cumulative probability CDF F(x) = P [X  x]

31 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

32 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

33 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

34 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

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

36 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

Outline r Admin and recap r Adaptive mobile applications m Device adaptation m Server adaptation 37

38 Server Adaptation r It is a good practice to design your app so that m Client notifies the server about its capability m Server adapts according to client capability

39 Example: Content Distribution Server r Server has many dimensions to adapt image/video fidelity: m frame rate (for video) m image size m quality of image r Usage: e.g., data acceleration offered by many carriers

40 Frame Encoding: Block Transform Encoding DCT

41 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

42 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] Q: If you want to change encoding rate, what may you do? more detail

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

44 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)

45 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 46

Discussion r When may a proxy help? 47 device in-net proxy in-net server

Example: Round-Trip-Time Effects 48 device server

Example: Round-Trip-Time Effects 49 device server

Measured Benefit of Reduced Latency 50

Example System: MAUI 51 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? m Add.NET attributes to indicate “remoteable”

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 Results 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 10ms mJ 5ms D mJ ms mJ 5ms A Computation energy and delay for execution Energy and delay for state transfer A sample callgraph

B C D A

FindMatch 900 mJ InitializeFace Recognizer 5000 mJ 1000mJ mJ DetectAndExtract Faces mJ mJ User Interface

FindMatch 900 mJ InitializeFace Recognizer 5000 mJ 1000mJ mJ DetectAndExtract Faces mJ mJ User Interface Cheaper to do local Compare cost of state transfer and local comp. Pick lower cost

FindMatch 900 mJ InitializeFace Recognizer 5000 mJ 1000mJ mJ DetectAndExtract Faces mJ mJ User Interface Cheaper to do local Compare cost of state transfer and local comp. Pick lower cost

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

4x savings on 3G 8x improvement on Wi-Fi Face Recognizer

9x improvement on wifi; 5x on 3G Face Recognizer

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

Backup Slides

66 Mobile Storage 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

67  One approach is to keep modifications as logs  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)?

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

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

70 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

71

72