24
Speed Scaling to Manage Energy and Temperature Nikhil Bansal (IBM Research) Tracy Kimbrel (IBM) and Kirk Pruhs (Univ. of Pittsburgh

Speed Scaling to Manage Energy and Temperature Nikhil Bansal (IBM Research) Tracy Kimbrel (IBM) and Kirk Pruhs (Univ. of Pittsburgh)

Embed Size (px)

Citation preview

Page 1: Speed Scaling to Manage Energy and Temperature Nikhil Bansal (IBM Research) Tracy Kimbrel (IBM) and Kirk Pruhs (Univ. of Pittsburgh)

Speed Scaling to Manage Energy

and Temperature

Nikhil Bansal (IBM Research)

Tracy Kimbrel (IBM) and Kirk Pruhs (Univ. of Pittsburgh)

Page 2: Speed Scaling to Manage Energy and Temperature Nikhil Bansal (IBM Research) Tracy Kimbrel (IBM) and Kirk Pruhs (Univ. of Pittsburgh)

2

Page 3: Speed Scaling to Manage Energy and Temperature Nikhil Bansal (IBM Research) Tracy Kimbrel (IBM) and Kirk Pruhs (Univ. of Pittsburgh)

3

Reasons for Power Management1) Optimize Energy: Power(t) ¼ c ¢ speed(t)3

Energy = t power(t)

Power (Pentium 4): 50 W @ 2.60 GHz, 1.8V 7 W @ 1.40 GHz, 1.0V

2) Control Temperature

Page 4: Speed Scaling to Manage Energy and Temperature Nikhil Bansal (IBM Research) Tracy Kimbrel (IBM) and Kirk Pruhs (Univ. of Pittsburgh)

4

Energy Problem [ Yao, Demers, Shenker 96] Jobs arrive over time:

Job i: arrives at ri, work wi to do by deadline di

At time t: Speed s(t) requires power s(t)p, p>1

Goal: Minimize total energy = t s(t)p ,

subject to: Finish each job by its deadline.

0 1 2Area = Work of a job

Work = 2

Work = 2

0 1 2Cost = 2p + 2p

speed 2

Page 5: Speed Scaling to Manage Energy and Temperature Nikhil Bansal (IBM Research) Tracy Kimbrel (IBM) and Kirk Pruhs (Univ. of Pittsburgh)

5

Energy Problem [ Yao, Demers, Shenker 96] Jobs arrive over time:

Job i: arrives at ri, work wi to do by deadline di

At time t: Speed s(t) requires power s(t)p, p>1

Goal: Minimize total energy = t s(t)p ,

subject to: Finish each job by its deadline.

0 1 2Area = Work of a job

Work = 2

Work = 2

Cost = 1p + 3p 0 1 2

speed 1

speed 3

Page 6: Speed Scaling to Manage Energy and Temperature Nikhil Bansal (IBM Research) Tracy Kimbrel (IBM) and Kirk Pruhs (Univ. of Pittsburgh)

6

Energy Problem [ Yao, Demers, Shenker 96] Jobs arrive over time:

Job i: arrives at ri, work wi to do by deadline di

At time t: Speed s(t) requires power s(t)p, p>1

Goal: Minimize total energy = t s(t)p ,

subject to: Finish each job by its deadline.

Note:

1) Speed allowed to be arbitrarily fast.

2) Which job: Earliest Deadline First (EDF)

[Main issue: How fast to work?]

Page 7: Speed Scaling to Manage Energy and Temperature Nikhil Bansal (IBM Research) Tracy Kimbrel (IBM) and Kirk Pruhs (Univ. of Pittsburgh)

7

Energy Problem (Lower Bound)No 2o(p) competitive algorithm possible

0 1 2Work = 2

Online Cost = 2p Offline Cost = 1p + 1p

Ratio ¼ (2)p/2 = O(2p)

Page 8: Speed Scaling to Manage Energy and Temperature Nikhil Bansal (IBM Research) Tracy Kimbrel (IBM) and Kirk Pruhs (Univ. of Pittsburgh)

8

Energy Problem (Lower Bound)No 2o(p) competitive algorithm possible

0 1 2Work = 2

0 1 20 1 2

Online Cost = 1p + 3p Offline Cost = 2p + 2p

Ratio ¼ (3/2)p

Work = 2

Page 9: Speed Scaling to Manage Energy and Temperature Nikhil Bansal (IBM Research) Tracy Kimbrel (IBM) and Kirk Pruhs (Univ. of Pittsburgh)

9

Previous Work [Yao Demers Shenker

96] Optimum Offline Algorithm

Average: Work on each job independently at rate wi/(di-ri)

Competitive ratio 2 [pp,(2p)p] [complicated spectral analysis]

Open: Is there an O(cp) competitive algorithm ?

Example: Wi =1 , ri=0 , di = i

Opt = 1 + 1 + … + 1 = nAverage ¼ k log (n/k)p

1

1/21/3

1/n

Page 10: Speed Scaling to Manage Energy and Temperature Nikhil Bansal (IBM Research) Tracy Kimbrel (IBM) and Kirk Pruhs (Univ. of Pittsburgh)

10

Previous Work

YDS propose another algorithm Opt Available (OA)

Work at minimum feasible speed

Speed(t) = maxx (Unfinished Work w/ deadline <= t+x) / x

Open: Competitive ratio of OA ( YDS show that >= pp)?

Example: Wi =1 , ri=0 , di = i

t=0

OA optimal on this example

1

1/21/3

1/n

Page 11: Speed Scaling to Manage Energy and Temperature Nikhil Bansal (IBM Research) Tracy Kimbrel (IBM) and Kirk Pruhs (Univ. of Pittsburgh)

11

Our results for Energy Problem1) Analyze OA, show (tight) competitive ratio of pp

[elementary potential function based proof]

2) Give a 8 ep competitive online algorithm.

3) Exponent e above is tight.

[If p>>1, c.r. determined by max speed,

any online algorithm for max speed has c.r. >= e]

4) Tight e competitive algorithm for max speed.

Page 12: Speed Scaling to Manage Energy and Temperature Nikhil Bansal (IBM Research) Tracy Kimbrel (IBM) and Kirk Pruhs (Univ. of Pittsburgh)

12

Our results for Energy Problem1) Analyze OA, show (tight) competitive ratio of pp

[elementary potential function based proof]

2) Give a 8 ep competitive online algorithm.

3) Exponent e above is tight.

[If p>>1, c.r. determined by max speed,

any online algorithm for max speed has c.r. >= e]

4) Tight e competitive algorithm for max speed.

Page 13: Speed Scaling to Manage Energy and Temperature Nikhil Bansal (IBM Research) Tracy Kimbrel (IBM) and Kirk Pruhs (Univ. of Pittsburgh)

13

Opt Available (OA)

OA: Work at minimum feasible speed

Suggests: Be a bit more aggressivePerhaps work twice the minimum feasible speed?

OptimumOA

t=0 t=n

speed = 1/n

t=1

Too fast towards the end. Not cp competitive

Page 14: Speed Scaling to Manage Energy and Temperature Nikhil Bansal (IBM Research) Tracy Kimbrel (IBM) and Kirk Pruhs (Univ. of Pittsburgh)

14

Main Algorithm

t t+xt- (e-1)x

w(t,x) : Work arrived by time t, and Totally contained in the interval (t – (e-1)x , t+x)

Algorithm: Speed(t) = e ¢ maxx w(t,x) / (ex) = maxx w(t,x)/x

Intuition: If W work totally contained in [a,b], then Opt rate ¸ W/(a-b) on average during [a,b]

Page 15: Speed Scaling to Manage Energy and Temperature Nikhil Bansal (IBM Research) Tracy Kimbrel (IBM) and Kirk Pruhs (Univ. of Pittsburgh)

15

Main Algorithm

t t+xt- (e-1)x

w(t,x) : Work arrived by time t, and Totally contained in the interval (t – (e-1)x , t+x)

Algorithm: Speed(t) = e ¢ maxx w(t,x) / (ex) = maxx w(t,x)/x

e competitive for max-speed2 (p/(p-1))p ep competitive for energy.Bad for small p. Choose best of OA and this: min (pp , 2(p/(p-1))p ep ) · 8 ep

Page 16: Speed Scaling to Manage Energy and Temperature Nikhil Bansal (IBM Research) Tracy Kimbrel (IBM) and Kirk Pruhs (Univ. of Pittsburgh)

16

Main Algorithm

t t+xt- (e-1)x

w(t,x) : Work arrived by time t, and Totally contained in the interval (t – (e-1)x , t+x)

Algorithm: Speed(t) = e ¢ maxx w(t,x) / (ex) = maxx w(t,x)/x

Need to show:1) Feasibility : All jobs finish by their deadlines2) Bound the energy

Page 17: Speed Scaling to Manage Energy and Temperature Nikhil Bansal (IBM Research) Tracy Kimbrel (IBM) and Kirk Pruhs (Univ. of Pittsburgh)

17

Bounding the energy

Intuition: If W work totally contained in [a,b]. During [a,b], Opt rate >= W/(a-b) on average

Problems: 1) Locally very different speeds for online and Opt.

2) How does maxx w(t,x)/x behave

Non-trivial inequalities due to Hardy and Littlewood(1920’s)Competitive ratio of 2 (p/(p-1))p ep

Page 18: Speed Scaling to Manage Energy and Temperature Nikhil Bansal (IBM Research) Tracy Kimbrel (IBM) and Kirk Pruhs (Univ. of Pittsburgh)

18

Temperature Problem

Fourier’s Law of Heat Conduction: dT(t)/dt = a P(t) – b (T(t) – Ta) (heating term) (cooling term)

T = Temperaturet = timeP = supplied powerTa = ambient temperature (assume stays constant) Rescale so that Ta = 0

Basic Equation: dT/dt = a P - b T

Problem: Finish all jobs while minimizing Tmax

Page 19: Speed Scaling to Manage Energy and Temperature Nikhil Bansal (IBM Research) Tracy Kimbrel (IBM) and Kirk Pruhs (Univ. of Pittsburgh)

19

Temperature

Exact offline algorithm: Convex Program

Wi,j : work done on job j in interval i.Ti, Ti+1: Temp. at beginning and end of Interval i.

Constraints:Each job j receives wj work in total Temperature always below Tmax

ti+1tiInterval i

Page 20: Speed Scaling to Manage Energy and Temperature Nikhil Bansal (IBM Research) Tracy Kimbrel (IBM) and Kirk Pruhs (Univ. of Pittsburgh)

20

MaxW SubproblemStart: time t0, temp T0

End: time t1, temp T1

What is maximum work you can do?

Constraint: Temperature remains ≤ Tmax?

Tmax

t0=0 t1time

T0

T1

?

?

?

Temp Calculus of Variations

Work = st speed(t) dt

= stPower(t)1/3 dt

= st (dT/dt + bT/a)1/3dt

Page 21: Speed Scaling to Manage Energy and Temperature Nikhil Bansal (IBM Research) Tracy Kimbrel (IBM) and Kirk Pruhs (Univ. of Pittsburgh)

21

MaxW w/ Boundary Constraint T ≤ Tmax

Tmax

t0 t1time

T0

T1

Euler Curve

Euler Curve

T = Tmax

α β T = c exp( -bt) + d exp( -3bt/2)

Show convexity and solve using Ellipsoid AlgorithmCan compute subgradient of MaxW(ti,ti+1,Ti,Ti+1)

Page 22: Speed Scaling to Manage Energy and Temperature Nikhil Bansal (IBM Research) Tracy Kimbrel (IBM) and Kirk Pruhs (Univ. of Pittsburgh)

22

Conclusions

Subsequent Work:

O(1) competitive algorithm for Tmax in the online setting.

Future Directions: Tight competitive ratio for Energy problem. Other bicriteria algorithms that trade off energy vs.

quality of schedule.

Page 23: Speed Scaling to Manage Energy and Temperature Nikhil Bansal (IBM Research) Tracy Kimbrel (IBM) and Kirk Pruhs (Univ. of Pittsburgh)

23

Thank You.

Page 24: Speed Scaling to Manage Energy and Temperature Nikhil Bansal (IBM Research) Tracy Kimbrel (IBM) and Kirk Pruhs (Univ. of Pittsburgh)

24

Feasibility

Suppose a deadline first missed at time d.

Online always working till time d.

EDF => all deadlines <= d

maxx w(t,x)) /x ¸ w(t,d-t)/(d-t)

Proof: Show that

total work that arrives during [0,d] with deadline · d.

t t+xt- (e-1)x