Presentation is loading. Please wait.

Presentation is loading. Please wait.

Adaptive Mobile Applications

Similar presentations


Presentation on theme: "Adaptive Mobile Applications"— Presentation transcript:

1 Adaptive Mobile Applications
4/21/2009 Richard Yang

2 Admin. Project

3 Challenges in Developing Mobile, Wireless Applications
Need to adapt to heterogeneous, dynamic device/network status Need to optimize resource usage given that resources are often limited

4 Motivation for Service Adaptation
Service delivered should depend on device status (e.g., display capability, input method, memory size, remaining battery level) network status in-building campus-area packet radio metro-area regional-area

5 Adaptation: Who and How?
request client service result Adaptation need support of the client, the server, and/or a third party (proxy or gateway) Server and third party adaptation is also called content adaptation

6 Adaptation: Client Responsibility
Client informs server its device capability and connection status Client makes best use of available resources and available result data

7 Content Adaptation Server/third party adapts service/content according to client capability

8 Client Adaptation

9 Client Capability Negotiation and Monitoring
Rudimentary capability already exists, but far from complete

10 Two Examples of Client Makes Best Use of Resources/Results
Adaptive CPU scheduling Adaptive playout

11 Example 1: Adaptive CPU Power Management

12 Big Picture: Power Management

13 Power Model

14 Some Techniques of Power Management

15 Dynamic Voltage Scaling
Dynamic Voltage Scaling (DVS) allows voltage to be dynamically adjusted DVS-enabled processors, e.g., StrongARM SA-2 (500mW at 600MHz; 40mW at 150MHz) AMD (PowerNow!) Intel (SpeedStep, XScale) Texas Instrument Transmata

16 CPU Power Consumption When the supply voltage V is lower, charging/discharging time is longer; thus frequency should be lower

17 CPU Power Consumption Model
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 -> P ~ O(V3)

18 Voltage Scaling throughput Discussion: what voltage to operate on?

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

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

21 Demand Prediction Online profiling and estimation: count number of cycles used by each job 1 CDF F(x) = P [X  x] cumulative probability Cmin=b0 b1 b2 br-1 br=Cmax

22 Demand distribution is stable or changes slowly
Observations Demand distribution is stable or changes slowly

23 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 ]   b1 b2 b0 br 1 br-1 cumulative probability F(x) C

24 How Fast to Run the CPU? Assume the strategy is to run job i at a fix (also called uniform) speed Si Assume it needs Ci cycles during a time duration of Pi 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.

25 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

26 Stochastic DVS For each job such that
find speed Sx for each allocated cycle x time is 1/Sx and energy is (1 - F(x))S3x such that

27 Observation: speed up the processor with increasing clock cycles
Example Speed Schedule cycle: speed: 100 MHz 200 MHz 400 MHz Job 1 2.5x106 cycles speed (MHz) 100 400 200 Job 2 1.2x106 cycles Observation: speed up the processor with increasing clock cycles

28 DVS A1 B1 A1 A1 A2 context switch Store speed for switched-out
New speed for switched-in speed up within job switch back A1 B1 A1 speed A1 A2 execution

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

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

31 Example 2: Deal with Variable Delay

32 Example: Deal with Variable Delay
Consider multimedia applications Packets arrive with variable delay (why?) Variable delay does not work well for multimedia application

33 Client Playout Buffer Basic idea: delay playing out packets to accommodate delay jitter Question: how to determine the playout delay? packets number time packets generated p p' delay 1 r received

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

35 Client System Model

36 Content Adaptation

37 Objective: automating adaptation
Content Adaptation: Examples Objective: automating adaptation

38 Example: Adapting Audio Content
2 3 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)

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

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

41 Discrete Cosine Transform
4C(u)C(v) n-1 n-1 (2j+1)up (2k+1)vp å å f(j,k) cos F[u,v] = cos n2 2n 2n j=0 k=0 where 1 for w=0 Ö 2 C(w) = for w=1,2,…,n-1 1 DCT is better at reducing redundancy than Discrete Fourier Transform but it is more computationally expensive

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] more detail

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

44 Examples Uncompressed (262 KB) Compressed (22 KB, 12:1)


Download ppt "Adaptive Mobile Applications"

Similar presentations


Ads by Google