320 likes | 518 Views
Algorithmic problems in Scheduling jobs on Variable-speed processors . Frances Yao City University of Hong Kong. Background. Energy and heat Workstation and server draw energy and produce heat Portable electronic devices rely on battery. Analysis from Intel:
E N D
Algorithmic problems in Scheduling jobs on Variable-speed processors Frances Yao City University of Hong Kong
Background • Energy and heat • Workstation and server draw energy and produce heat • Portable electronic devices rely on battery • Analysis from Intel: • 25,000-square-foot server farm with approximately 8,000 servers consumes 2 megawatts • —— 25% of the total cost for such a facility
Background • Financial Times (2000): Information Technology (IT) consumes about 8% of energy in US exponential growth50% of the energy consumption • Some techniques: • Add several “inactive” states • Processor can be set at one of the states if idle • Extra energy is required to bring the processor back to the normal state
DVS Technique(dynamic voltage scaling) • Variable Voltage Processor • Processor with multiple speeds • Voltage is proportional to speed • Power function sp (p>1) • Current and future DVS technology • Intel’s SpeedStep — 2 speeds • AMD’s PowerNow — 9 speeds • Intel’s Foxton technology — 64 speeds • Operating systemscan save energy by scheduling jobs wisely -- executing as slowly as possible
speed Rk time ak bk DVS Scheduling Model ([Yao, Demers and Shenker (1995)]) area=required cycles • A set of n jobs ak: arrival time bk: deadline Rk: required CPU cycles • Preemptive execution • Schedule S specifies: • 0≤s(t)< • which job is executed at time t • Cost • What’s the optimal (Min-Energy) schedule • Good characterization efficient computation • Benchmark for heuristics s t jobk
The Basics • Each job will be executed at one uniform speed in optimal schedule • Convexity: • Optimal schedule needs at most n different speeds • the flatter the better • Strategy: Determine peak speed s* , apply iterative procedure to find 2nd peak speed etc.
Optimal Schedule • What’s the peak speed in the optimal schedule? • defines the speed lower bound over any I • s* defines peak speed and critical interval I* • s* over critical interval is feasible • Extract critical interval, update jobs and repeat speed I* time
Developments • 1995: Model and characterization of optimal schedule O(n3) • 2005: Optimal schedule in the discrete model O(n3) O(nlogn) • 2006: New scheduling algorithm for the continuous model O(n3) O(n2logn) • Yao F, Demers A and Shenker S. A Scheduling Model for Reduced CPU Energy. FOCS 1995, 374-382. • Minming Li, Frances F. Yao. An Efficient Algorithm for Computing Optimal Discrete Voltage Schedules. SIAM J. Comput. 2005, 35(3): 658-671. • Minming Li, Andrew C. Yao, Frances F. Yao. Discrete and Continuous Min-Energy Schedules for Variable Voltage Processors. Proceedings of the National Academy of Sciences of the USA, 2006(103): 3983-3987.
Scheduling Model (Discrete) • Discrete speed levels • Discrete Optimal [Kwon and Kim (2002)]: • Compute optimal schedule for the continuous model • Adjust each job’s optimal speed to adjacent levels si s si+1
Can we obtain discrete optimal without computing continuous optimal? • For example, what if only two speed levels are available? • Strategy: • Partition sufficient to do repeated Bi-partition • Two-Level scheduling Two-Level Scheduling
Bi-partition (relative to some speed s) • Let s>0 be given for job set J • Can we divide jobs into Jhigh and Jlow correctly? • Identify segments of Thigh and Tlow speed Thigh Thigh Sopt(t) s Tlow Tlow Tlow time
Bi-partition • Main tool: s-schedule • an EDF schedule with constant speed s • Gaps • Tight deadlines Tight arrival times • J(Tlow)=Jlow J(Thigh)=Jhigh Thigh Thigh Gap s 1 5 2 3 4 5 8 6 7 9 10 Tlow Tlow Tlow
Bi-partition (Algorithm Outline) • Gaps always exist (and only exist) in Tlow • Expand a gap suitably to identify a connected component of Tlow • Delete all jobs intersecting with this component • New gaps must exist
Tlow Tlow Tlow 9 4 8 2 7 3 1 10 11 5 6 Example: Bi-partition Algorithm gap 1 5 4 2 3 4 6 11 7 8 9 10
Optimal Discrete Schedule • Strategy • Partition J into J1,J2,…Jd with Bi-partition Find Two-Level schedule for Ji with si&si+1
Optimal Discrete Schedule • Strategy • Partition J into J1,J2,…Jd with Bi-partition • Find Two-Level schedule for Ji with si & si+1
s1 Two-Level Scheduling s2 • Given job set J and s1>s2 satisfying • Optimal speeds of jobs in J are between s1 & s2 • Compute an optimal (s1,s2)-schedule • Observation • Anyfeasible(s1,s2)-schedule isoptimal • How to obtain a feasible(s1,s2)-schedule?
Two-Level Scheduling (Algorithm Outline) • Compute s1-schedule and s2-schedule • Process jobs reversely by deadlines jn , jn-1 , … j1 • Use up all s2-execution time of each job • Take extra time (if needed) from its s1-execution time (all available) s1 1 … i i+1 … n s2 1 … i i+1 … n disjoint
Correctness and Complexity • Every iteration preserves the existence of feasible schedule for the remaining jobs • No idle time is left in the end • Total intervals of the final schedule: • Intersection of sorted lists of s1-schedule and s2-schedule blocks (can be pre-computed) • At most one extra interval is introduced when scheduling every job • O(n log n)
Optimal Discrete Schedule • Strategy • Partition J into J1,J2,…Jd with Bi-partition O(d nlogn) • Find Two-Level schedule for Ji with si and si+1 O(nlogn) Total time:O(d nlogn)
Lower Bound • Any deterministic algorithm for computing a min-energy Discrete Voltage Schedule with d>1 voltage levels will require • A linear reduction from Integer Element Uniqueness (IEU) to this problem
Interesting By-product: Continuous Model Discrete Model • Original Method for Continuous Optimal: • Compute iteratively peak speed via convex program • New Method: • Calculate successive approximations to the entire optimal speed curve • Complexity:
Optimal Continuous Schedule speed s=avr(J) time
Online Heuristics AVR(t) • Competitive ratio • AVR (Average Rate) • Lower bound 4 and upper bound 8 [Yao, Demers and Shenker (1995)] • Tight bound 4 for some special job sets [Li, Liu and Yao (2005)] • Can be adapted to the discrete model with competitive ratio 2(k+1)2/k, where k =max ratio of two adjacent speeds • OPA (Optimal Available) • Tight bound 4 [Bansal, Kimbrel and Pruhs (2004)] t
AVR for Discrete Model • Discrete Speed Levels: • k=max {si/si+1} • Adjustment: change speed s to its adjacent speed levels • AVRDoff: off-line adjustment of AVR • AVRDon: on-line adjustment of AVR (running at higher speed first)
AVR for Discrete Model s1 s1 AVRDonAVRDoff (knows the future) s s s2 s2 t t • It can be proved that • E(AVRDon)≤E(AVRDoff) • E(AVRDoff) ≤ 2(k+1)2/k ▪ E(AVR) • True for a class of online heuristics
Analysis of OPA [Bansal, Kimbrel and Pruhs (2004)] • Defining a potential function φ: • Let Δφ(t) denote the change in the potential due to a job arrival at time t. Then Δφ(t)≤0 • At any time t between arrivals, sαopa(t) - ααsαopt(t) + dφ(t)/dt ≤0 • φ(t0)=φ(t )= 0
Temperature Model • The rate of cooling follows Fourier’s law: • The rate of cooling is proportional to the difference in temperature between the object and the ambient environmental temperature • First order approximation • T’(t)=aP(t)-bT(t) • P(t): supplied power at time t
Throughput (under max speed constraint) • Throughput = total workload of those jobs finished by their deadlines • Max Throughput: NP-hard • Approx maximizing throughput while Approx minimizing energy • An online algorithm [Chan et al. (SODA 2007)] • 14-competitive in throughput • 68-competitive in energy • An offline algorithm [Li et al. 2007] • 3-approx in throughput & 4-approx in energy
Continuous Model Discrete Model Summary • Job scheduling for variable speed processor • Optimal discrete DVS schedule: O(n logn) • Multi-level partition • Two-level schedule • Optimal continuous DVS schedule: O(n2 logn) • Find successive approx to optimal speed curve • Online heuristics
Conclusion • Many open problems in DVS scheduling: throughput, job switches (online & offline) etc. • Algorithmic techniques needed to enable more efficient use of energy in various domains: • variable voltage processors • wireless ad hoc networks • Suitable modeling tocapture the essence Specific problems & solutions Unifying techniques for multiple models Algorithmic foundations for new paradigms