Presentation is loading. Please wait.

Presentation is loading. Please wait.

Competitive Algorithms from Competitive Equilibria

Similar presentations


Presentation on theme: "Competitive Algorithms from Competitive Equilibria"— Presentation transcript:

1 Competitive Algorithms from Competitive Equilibria
Kamesh Munagala Duke University Sungjin Im UC Merced Janardhan Kulkarni MSR Redmond

2 Single Machine Scheduling
Processes at most one job at a time Processes jobs at unit rate Jobs can be preempted and rescheduled Characteristics of job j Processing length pj Arrives at time rj

3 Scheduling Policy Job j is alive at time t if Scheduling policy:
t ≥ rj and Less than pj units of processing have been assigned to j Scheduling policy: Which alive job to process at current time instant? Many possible optimization objectives

4 Constraints on Policy Online: Non-clairvoyant:
Only becomes aware of job j at time rj Job arrival process is adversarial Non-clairvoyant: Not aware of processing length pj till job finishes

5 Total Delay Objectives
Cj = Completion time of job j First time at which it receives pj units of processing Fj = Flow time (or delay) of job j Fj = Cj – rj Objectives we consider are sum over jobs: Total (or average) completion time Total (or average) flow time Everything we present generalizes to weighted sums

6 Competitive Analysis For every input instance No assumptions on OPT
Offline OPT knows the entire input in advance It knows the processing requirements Clairvoyant

7 Many O(1)-competitive policies
Shortest Remaining Processing Time First (SRPT) Round Robin (RR) Shortest Elapsed Time First (SETF) Shortest Job First (SJF) and so on… Our goal is to go beyond single machine scheduling

8 Packing Scheduling Problem (PSP)

9 LP Formulation Any feasible policy for single machine scheduling is captured by a set of linear constraints Variables: yjt = Amount of processing assigned to job j at time t Machine processes jobs at unit rate \begin{array}{rcll} \sum_{j | t \ge r_j} y_{jt} & \le & 1 & \forall t \\ \\ \sum_{t \ge r_j} y_{jt} & \ge & p_j & \forall j \end{array} Each job is completely processed

10 At any time t, rates assigned to the jobs must sum to at most 1
Packing Constraint At any time t, rates assigned to the jobs must sum to at most 1

11 Packing Scheduling Problem (PSP)
Packing polytope At any time t, rates assigned to the jobs must lie within P

12 PSP Formulation Jobs arrive over time in online fashion

13 PSP Formulation Jobs arrive over time in online fashion
Job j has processing length pj that is not known to scheduler Job j finishes processing if total rate assigned is at least pj

14 PSP Formulation Jobs arrive over time in online fashion
Job j has processing length pj that is not known to scheduler Job j finishes processing if total rate assigned is at least pj Packing polytope P on feasible rate assignments at any step

15 PSP Formulation Jobs arrive over time in online fashion
Job j has processing length pj that is not known to scheduler Job j finishes processing if total rate assigned is at least pj Packing polytope P on feasible rate assignments at any step Goal: Scheduling policy that minimizes sum of completion (or flow) times

16 In LP terms… Scheduling policy is a solution to this program, where:
Job j’s characteristics not known before time rj pj is not known until job completes \begin{array}{rcll} \mbox{Minimize} && \sum_j C_j &\\ \\ \vec{y_t} & \in & \mathcal{P} & \forall t \\ \sum_{t = r_j}^{C_j} y_{jt} & \ge & p_j & \forall j \end{array}

17 Applications

18 Unrelated Machine Scheduling [Chadda, Garg, Kumar, Muralidhara ’09]
Jobs Machines i Assignment = xij Rate of processing = sij j

19 More Details Jobs can be preempted and can migrate across machines
Different machines process job at different rates Rates of processing known to scheduler The job cannot be processed on multiple machines simultaneously At each step, assignment of jobs to machines defines a (fractional) matching

20 Packing constraints at time t
Each machine assigned at most one job Each job assigned at most one machine \begin{array}{rcll} \sum_j x_{ij} & \le & 1 & \forall \mbox{ machines } i \\ \\ y_j & = & \sum_i s_{ij} x_{ij} & \forall \mbox{ jobs } j \end{array} yj = Rate at which job is processed at current step

21 Overall Problem \begin{array}{rcll} \mbox{Minimize } && \sum_j C_j \\
\sum_j x_{ijt} & \le & 1 & \forall \mbox{ machines } i, t \\ \sum_i x_{ijt} & \le & 1 & \forall \mbox{ jobs } j, t y_{jt} & = & \sum_i s_{ij} x_{ijt} & \forall \mbox{ jobs } j, t \\ \sum_{t = r_j}^{C_j} y_{jt} & \ge & p_j & \forall j \end{array}

22 Multidimensional Scheduling [Bonald, Massoulie, Walton; Ghodsi et al.]
Jobs Resources CPU j d Quantity = Rd RAM Allocation = xdj DISK Assignment of limited resources to jobs every time step

23 Practical Motivation Scheduling jobs in data centers
Resources = {CPU, Memory, Disk, Bandwidth, …} Jobs composed of many parallel tasks Rate at which tasks complete depends on resource allocation to the job Utility function captures how rate depends on resources allocated

24 Packing constraints at time t
Resource d is not over-allocated \begin{array}{rcll} \sum_j x_{dj} & \le & R_d & \forall \mbox{ Resources } d \\ \\ y_j & = & u_j\left(\vec{x_j} \right) & \forall \mbox{ jobs } j \end{array} uj is some d-dimensional concave “utility function”

25 Overall Problem \begin{array}{rcll} \mbox{Minimize } && \sum_j C_j \\
\sum_d x_{djt} & \le & R_d & \forall \mbox{ Resources } d, t y_{jt} & = & u_j(\vec{x_{jt}}) & \forall \mbox{ jobs } j, t \\ \sum_{t = r_j}^{C_j} y_{jt} & \ge & p_j & \forall j \end{array}

26 Common Utility Functions
Leontief: Rate of processing depends on bottleneck resource Constant Elasticity of Scale (CES):

27 And many other problems
Multicommodity flow routing Broadcast scheduling Video-on-demand Speedup curve model Pretty much any “reasonable” scheduling problem can be written as an instance of PSP Needs preemption Convex space of fractional/randomized assignments Each problem has an extensive pedigree Too rich a literature to cite exhaustively!

28 Our Results

29 There is a constant competitive, online, non-clairvoyant algorithm for minimizing total completion time for the PSP problem. Extends to weighted case Other generalizations

30 There is a constant competitive, online, non-clairvoyant algorithm for minimizing total flow time for natural subclasses of the PSP problem. Lower bound for general PSP instances: No constant competitive non-clairvoyant algorithm for total flow time!

31 Some Intuition Any policy has to favor short jobs
But the policy does not know what they are! So we need to use a “fair” algorithm In 1-D, the fix is “round robin” … and this is constant competitive Not so simple for PSP! Lets start with a simple greedy solution. Which is maximize the total rate at which jobs are executing. To minimize completon time we want to finish jobs as quickly as possible, so it indeed, it does not seem to be a bad idea.

32 Multi-dimensional Example
1 2 3 4 D All jobs available at time 0 Jobs Resources with supply 1

33 Max-Min Fairness (MMF)
1 2 3 4 D All jobs of unit length Perform round robin in each dimension

34 MMF (or DRF) Allocation
1 2 3 4 D All jobs finish at roughly time √D

35 Optimal Allocation t = 1 D jobs t = 2,3….
4 D t = 1 D jobs t = 2,3…. OPT schedules “light jobs” in parallel in one step, Then the “heavy jobs” sequentially

36 Proportional Fairness (PF)
Maximize product of job rates every time step \max \sum_j \log y_{jt}, \ \ \vec{y_t} \in \mathcal{P} [Nash ’50; Mazumdar et al. ’91; Kelly, Maulloo. Tan ’97]

37 PF as Market Clearing Each job has $1 money
If resource d is priced at pd then job j solves for: Find prices for resources to clear the market \begin{array}{rcll} \mbox{Maximize } & & \sum_j \log y_j \\ \\ \sum_j x_{dj} & \le & R_d & \forall \mbox{ Resources } d \\ y_j & = & u_j\left(\vec{x_j} \right) & \forall \mbox{ jobs } j \\ \end{array}

38 What does PF do? 1 2 3 4 D

39 (Im, Kulkarni, M. STOC ‘14) Proportional fairness is a constant competitive, online, non-clairvoyant algorithm for minimizing the total completion time for the PSP problem. Extends to weighted case Other generalizations

40 (Im, Kulkarni, M. FOCS ’15) Proportional fairness is a constant competitive, online, non-clairvoyant algorithm for minimizing total flow time for natural subclasses of the PSP problem. Lower bound for general PSP instances: No constant competitive non-clairvoyant algorithm for total flow time!

41 Subclasses for Flow Time
Need the PF algorithm to be monotone When job arrives (leaves) system, rate assigned by PF to existing jobs does not increase (decrease) Not true for all PSP instances! 1 2 3 4 D Not monotone!

42 Subclasses for Flow Time
Need the PF algorithm to be monotone When job arrives (leaves) system, rate assigned by PF to existing jobs does not increase (decrease) Not true for all PSP instances! Connection to “Eisenberg-Gale markets” [Jain Vazirani ‘04] Multidimensional scheduling with Gross Substitutes utilities CES utilities and some generalizations Prices of resources increase when new jobs arrive

43 Subclasses for Flow Time
Need the PF algorithm to be monotone When job arrives (leaves) system, rate assigned by PF to existing jobs does not increase (decrease) Not true for all PSP instances! Connection to “Eisenberg-Gale markets” [Jain Vazirani ‘04] Multidimensional scheduling with Gross Substitutes utilities CES utilities and some generalizations Packing polytope on rates is a Polymatroid Related machine scheduling, Single-sink flow routing, Multicast tree scheduling

44 Analysis for Flow Time

45 Optimality Condition of PF
The average gain of any other rate allocation (particularly OPT) over PF is at most 1

46 Main Idea: Prefix Fairness
Suppose jobs arrive sequentially as 1,2,…,n Let yjk = j’s rate in PF assuming only first k jobs present On average, rates of existing jobs decrease by at most a constant factor due to arrival of new jobs

47 Proof Sketch Write a sequence of optimality conditions
PF run on first k+1 jobs versus some other rate vector on those jobs Yields sequence of linear constraints Worst case bound is solution to a convex program

48 Intuitively… On average across jobs at any time step:
Each job gets a “reasonable rate” compared to any other rate allocation mechanism (particularly OPT) Each job’s rate is not significantly affected by arrivals/departures of other jobs Converting this intuition into a proof is tricky Only works if the PF rate allocation is monotone

49 Analysis for Flow Time Step 1
Total flow time = Sum over time of number of alive jobs

50 Lag of PF w.r.t. Optimum Step 1
Total flow time = Sum over time of number of alive jobs Step 2: “Lag” of PF w.r.t. OPT at time t Lag(j,t) = max(0, p(j,t) – p*(j,t)) p(j,t) = Amount of processing left for job j in PF p*(j,t) = Amount of processing left for job j in OPT Measures how far behind PF is compared to OPT

51 Potential Function [Fox, Im, Moseley ‘12]
Step 3: Potential function Meaning of potential Lag captures how far behind PF is compared to OPT However, if PF gives large rate, this reduces potential Potential does not abruptly jump with job arrivals and departures Rate PF would assign to j if only jobs arriving before j are present in the system n_{PF}(t) + \Phi'_t \le O(1) \times n_{OPT}(t)

52 What does it mean? Need to show:
If PF has large number of jobs, it reduces potential faster than how much OPT can increase it. Integrating over time shows that flow time of PF is O(1) times flow time of OPT

53 Analysis Idea \Phi'(t) = \sum_j \frac{y^*_{jt}}{y_{\le j}(t)}

54 Optimality Condition of PF
Due to OPT’s Processing: Due to PF’s Processing: \Phi'(t) = \sum_j \frac{y^*_{jt}}{y_{\le j}(t)} At most number of jobs in PF

55 Prefix Fairness Due to OPT’s Processing: Due to PF’s Processing:
\Phi'(t) = \sum_j \frac{y^*_{jt}}{y_{\le j}(t)} At most number of jobs in PF At least number of jobs in PF / e O(1) competitive algorithm with “constant speed”

56 Analysis for Completion Time

57 Why is the analysis hard?
No closed form for the rates PF assigns Allocation of PF can be non-monotone: When new job arrives, rates of existing jobs can go up Not an issue for most simpler scheduling settings

58 Dual Fitting [Anand, Garg, Kumar ‘12]
Assume we know the entire input Write a LP relaxation for completion time and take its dual

59 Dual Fitting [Anand, Garg, Kumar ‘12]
Assume we know the entire input Write a LP relaxation for completion time and take its dual Set dual variables using execution of PF Apply Weak Duality Theorem Competitive Ratio Any feasible dual Solution LP OPT Cost of PF

60 LP Relaxation for Completion Time
\begin{array}{rcll} \mbox{Minimize } && \sum_{j,t} y_{jt} \cdot \frac{t}{p_j} \\ \\ \sum_d a_{jd} \cdot y_{jt} & \le & 1 & \forall d, t \sum_{t \ge r_j} y_{jt} & \ge & p_j & \forall j \end{array}

61 The Dual \begin{array}{rcll}
\mbox{Maximize } && \sum_j \alpha_j - \sum_{d,t} \beta_{dt} &\\ \\ \alpha_j &\le & t + p_j \cdot \sum_d a_{jd} \beta_{dt} & \forall j, t \ge r_j \end{array} \mbox{Maximize}&& \sum_j \log y_{jt} &\\ \sum_d a_{jd} \cdot y_{jt} & \le & 1 & \forall d, t

62 Fitting using PF Prices
½ (Cost of PF) (Cost of PF) PF Scheduler at time t \begin{array}{rcll} \mbox{Maximize } && \sum_j \alpha_j - \sum_{d,t} \beta_{dt} &\\ \\ \alpha_j &\le & t + p_j \cdot \sum_d a_{jd} \beta_{dt} & \forall j, t \ge r_j \end{array} \mbox{Maximize}&& \sum_j \log y_{jt} &\\ \sum_d a_{jd} \cdot y_{jt} & \le & 1 & \forall d, t Dual price

63 Dual Fitting Idea In dual of Completion time LP relaxation
Set αj = Completion time of j in PF schedule Set βdt = Dual price from PF program

64 Dual Fitting Idea In dual of Completion time LP relaxation
Set αj = Completion time of j in PF schedule Set βdt = Dual price from PF program KKT conditions imply total price in PF = Total number of jobs that time step Implies PF is constant competitive by weak duality!

65 Dual Fitting Idea In dual of Completion time LP relaxation
Set αj = Completion time of j in PF schedule Set βdt = Dual price from PF program KKT conditions imply total price in PF = Total number of jobs that time step Implies PF is constant competitive by weak duality! Actual analysis is not so simple! Above setting does not satisfy dual constraints

66 New Technical Idea = Weighted average of future prices set by PF
Weight = Median of progress jobs make that time instant Use amortized accounting of delays in setting Jobs pay for the delay incurred by other jobs Yields a O(1) competitive analysis!

67 An Open Question O(D) competitive flow time algorithm for Leontief utilities Rate depends on min allocation across D dimensions Why study this? The most practical: Switch scheduling, Data centers, … Any PSP instance can be reduced to a Leontief instance Main technical hurdle: We don’t really understand non-monotone algorithms! Current techniques give exponential dependence on D If jobs have unit length O(D) competitive algorithm [Im, Kulkarni, M. ICALP ’16] Very different algorithm from PF

68 Other Directions Stages with precedence constraints
Encodes job shops, but what if utility functions are benign? Does clairvoyance help with obtaining better guarantees? Does so for unit length jobs In general, we don’t know Other objectives: Makespan, maximum flow time, fairness, …

69 Questions?


Download ppt "Competitive Algorithms from Competitive Equilibria"

Similar presentations


Ads by Google