atch Scheduling for Identical Multi-Tasks Jobs on Heterogeneous Platforms Jean-Marc Nicod (Jean-Marc.Nicod@lifc.univ-fcomte.fr) Sékou iakité, Laurent Philippe - 16/05/2008 Laboratoire d Informatique de l Université de Franche-omté - esançon 2nd Scheduling in ussois workshop
Presentation Outline Problem definition lgorithms evaluation Presentation Experiences Synthesis Steady state for small batches Means of action Reduce period size Experiences onclusion and futur works 2nd Scheduling in ussois workshop - 19/05/2008 2 / 45
Outline Problem definition lgorithms evaluation Presentation Experiences Synthesis Steady state for small batches Means of action Reduce period size Experiences onclusion and futur works 2nd Scheduling in ussois workshop - 19/05/2008 3 / 45
Scheduling Problem efinitions Execution Platform: non oriented graph, G = (P, L) : P: processors p i, i [1, m] L: communication links l j, j [1, c] Jobs: Gs without fork (intrees), J = (T, ): T : tasks t k, k [1, n] : tasks dependencies d l, l [1, d] N instances of the same job. 2nd Scheduling in ussois workshop - 19/05/2008 4 / 45
Scheduling Problem haracteristics: Each task of a job must be performed by a specific function, F is the set of the functions needed to process a job, Each execution resource provides a subset of F, The execution resources are unrelated. Problem: Schedule a batch of N jobs J Objective function: max R m intrees, batch of identical jobs max 2nd Scheduling in ussois workshop - 19/05/2008 5 / 45
Scheduling Problem Problem illustration N instances of the same job: 1 platform for execution: Figure: Job Type p 1 p 2 p 3 p 4 20 15 10 10 10 10 10 10 Table: Execution times 2nd Scheduling in ussois workshop - 19/05/2008 6 / 45
Scheduling Problem Use ases Grid: Image processing: filters, 2 or 3 reconstructions, Servers provides an application set. Micro-Factories: omposed of cells: assembly, treatments,... Less geographical constraints, Products are micro-metric easily buffered 2nd Scheduling in ussois workshop - 19/05/2008 7 / 45
Outline Problem definition lgorithms evaluation Presentation Experiences Synthesis Steady state for small batches Means of action Reduce period size Experiences onclusion and futur works 2nd Scheduling in ussois workshop - 19/05/2008 8 / 45
Possible solutions lassical (Off-line): schedule a G on an heterogeneous platform, max optimization NP-Hard, batch of jobs: no use of identical jobs. Steady state technics (Off-line): flow optimization: maximize the throughput optimal solution on heterogeneous platforms, use the identical job characteristic, does not take starting/ending into account. On-line: batch waiting queue, schedule ready tasks, no use of identical job characteristic, 2nd Scheduling in ussois workshop - 19/05/2008 9 / 45
Used algorithms On-line scheduling: simple, assign tasks on the fly, respect dependencies, used as reference. Genetic Meta-heuristic GTS[aoud05]: improves list scheduling, good results on G schedule, needs to be adapted to batches: period, performances of a standard heuristic on batches of jobs? Steady State[eaumont04]: optimal for batches of infinite size, performances on finite size batches? 2nd Scheduling in ussois workshop - 19/05/2008 10 / 45
Steady State Overview efinition and resolution of a linear program: define the constraints of the problem, flow: solutions are time ratios per resources. ompute a cyclic schedule: construct allocations with respect of the ratios, 1 port model: communication intervals. Execution: starting, cyclic schedule, ending. 2nd Scheduling in ussois workshop - 19/05/2008 11 / 45
Steady State linear system MXIMIZE ρ = p i=1 cons(p i, t f ), UNER THE ONSTRINTS (1)p i, t k T, α(p i, t k ) = cons(p i, t k ) c i,k (2)p i, t k T, 0 α(p i, t k ) 1 (3)p i, t k T α(p i, t k ) 1 2nd Scheduling in ussois workshop - 19/05/2008 12 / 45
Steady State Solution t 0 t 1 t 2 t 3 Type p 1 p 2 p 3 p 4 20 20 10 10 10 10 10 10 Figure: Job Table: ost: c p 1 p 2 p 3 p 4 t0 7/200 - - 9/200 t1 3/100 1/20 - - t2-1/20 3/100 - t3 - - 7/100 1/100 Table: omsumption: cons, objective ρ = 2/25 2nd Scheduling in ussois workshop - 19/05/2008 13 / 45
Steady State Solution P1:0 0:1 1:1 4:1 Tbegin:0:0 8 :1:1 4 P2:1 1:1 2:1 3:1 8 8 :2:1 8 2 :3:1 P3:2 1:1 2:1 3:1 8 Tend:4:0 Figure: Platform Figure: Job 2nd Scheduling in ussois workshop - 19/05/2008 14 / 45
Outline Problem definition lgorithms evaluation Presentation Experiences Synthesis Steady state for small batches Means of action Reduce period size Experiences onclusion and futur works 2nd Scheduling in ussois workshop - 19/05/2008 15 / 45
Experiences Metric efficiency = makespan o /makespan r efficiency = N/(ρ makespan r ) makespan o : lower bound makespan o : N/ρ, reference time makespan r : makespan resulting from experience, Simulation results (SimGrid), ommunications neglected. 2nd Scheduling in ussois workshop - 19/05/2008 16 / 45
Figure: Job j 0 Type p 1 p 2 p 3 p 4 p 5 p 6 10 100 1000 10 10 10 10 10 10 Table: Grid G 0 Efficiency 1 0.8 0.6 0.4 0.2 Steady state GTS On line 0 10 50 100 150 200 250 300 400 500 600 700 800 900 1000 atch size Figure: Execution of batches j 0 on G 0 Global results: Steady state tends toward optimal, GTS good for small batches, then collapses, on-line is constant. 2nd Scheduling in ussois workshop - 19/05/2008 17 / 45
Type p 1 p 2 p 3 p 4 p 5 p 6 10 100 1000 10 10 10 10 10 10 Figure: Job j 1 Table: Grid G 0 Efficiency 1 0.8 0.6 0.4 0.2 Steady state GTS On line 0 10 50 100 150 200 250 300 400 500 600 700 800 900 1000 atch size Sames tasks as j 0, GTS collapses earlier (250 instances vs. 300). Figure: Execution of batches j 1 on G 0 2nd Scheduling in ussois workshop - 19/05/2008 18 / 45
Figure: Job j 2 Type p 1 p 2 p 3 p 4 p 5 p 6 10 100 1000 10 10 10 10 10 10 Table: Grid G 0 Efficiency 1 0.9 0.8 0.7 0.6 0.5 0.4 Steady state GTS On line 10 50 100 150 200 250 300 400 500 600 700 800 900 1000 atch size Steady state uses p 6 (: 1000), Figure: Execution of batches j 2 on G 0 2nd Scheduling in ussois workshop - 19/05/2008 19 / 45
Type p 1 p 2 p 3 10 50 40 100 Figure: Job j 2 Table: Grid G 1 Efficiency 0.98 1 0.96 0.94 0.92 0.9 0.88 0.86 0.84 0.82 0.8 Steady state GTS On line 10 50 100 150 200 250 300 400 500 600 700 800 900 1000 atch size The efficiency of GTS decreases starting at 200 instances. Figure: Execution of batches j 2 on G 1 2nd Scheduling in ussois workshop - 19/05/2008 20 / 45
Outline Problem definition lgorithms evaluation Presentation Experiences Synthesis Steady state for small batches Means of action Reduce period size Experiences onclusion and futur works 2nd Scheduling in ussois workshop - 19/05/2008 21 / 45
Experiences Synthesis Small batches: 50 Medium batches: 100 Large batches: 500 On-line Steady GTS On-line Steady GTS On-line Steady GTS 0.93 0.93 0.99 0.94 0.94 0.99 0.94 0.97 0.61 Table: Mean efficiency Synthesis: GTS: up to 200, Steady state: from 500. Time consumption for 1000 instances: steady state: 0.08s, on-line: 35.04s, GTS: 1799.68s, 2nd Scheduling in ussois workshop - 19/05/2008 22 / 45
Outline Problem definition lgorithms evaluation Presentation Experiences Synthesis Steady state for small batches Means of action Reduce period size Experiences onclusion and futur works 2nd Scheduling in ussois workshop - 19/05/2008 23 / 45
Steady state for small batches Means of action im: improve (decrease) the global makespan for small batches, The steady state phase is optimal. Schedule starting/ending phases on the heterogeneous platform: NP-Hard find a good schedule, reduce the work in initialization/ending phases. What can be done on starting/ending phases? Keeping steady state optimal: re-organise affectations to reduce the period size, resolve dependencies inside the period. eterioration of steady state: reduce the number of instances per periods 2nd Scheduling in ussois workshop - 19/05/2008 24 / 45
Steady state schedule Type p 1 p 2 p 3 p 4 10 10 10 10 10 10 10 10 Figure: Job j 3 Table: Grid G 2 Period 1 Period 2 Period N... 2nd Scheduling in ussois workshop - 19/05/2008 25 / 45
Outline Problem definition lgorithms evaluation Presentation Experiences Synthesis Steady state for small batches Means of action Reduce period size Experiences onclusion and futur works 2nd Scheduling in ussois workshop - 19/05/2008 26 / 45
Steady state for small batches Example t 0 t 1 t 2 t 3 Type p 1 p 2 p 3 p 4 20 20 10 10 10 10 10 10 Figure: Job Table: ost p 1 p 2 p 3 p 4 t0 7/200 - - 9/200 t1 3/100 1/20 - - t2-1/20 3/100 - t3 - - 7/100 1/100 Period = 200. Table: onsumption 2nd Scheduling in ussois workshop - 19/05/2008 27 / 45
Steady state for small batches lgorithm p 1 p 2 p 3 p 4 t0 7/200 - - 9/200 t1 3/100 1/20 - - t2-1/20 3/100 - t3 - - 7/100 1/100 Table: onsumptions: cons p 1 p 2 p 3 p 4 t0 7 - - 9 t1 6 10 - - t2-10 6 - t3 - - 14 2 Table: Integer consuptions: consint 2nd Scheduling in ussois workshop - 19/05/2008 28 / 45
Steady state for small batches Initial steady state schedule S P: period, P : LM of the matrix denominators, ρ: throughput, ρ = a/b, reduced fraction. Let P min be the minimum possible period P 0 = b, P min = α P 0, α [1, P/b] Find P min, that respect the constraints: For lines L j : P i L i cons(i, j) = ρ, For columns i : P j j cons(i, j) w ij < 1 2nd Scheduling in ussois workshop - 19/05/2008 29 / 45
Steady state for small batches Example t 0 t 1 t 2 t 3 Type p 1 p 2 p 3 p 4 20 20 10 10 10 10 10 10 Figure: Job Table: ost p 1 p 2 p 3 p 4 t0 7/200 - - 9/200 t1 3/100 1/20 - - t2-1/20 3/100 - t3 - - 7/100 1/100 p 1 p 2 p 3 p 4 t0 1/25 - - 1/25 t1 1/50 3/50 - - t2-1/25 1/25 - t3 - - 3/50 1/50 Table: onsumption Table: Modified consumption 2nd Scheduling in ussois workshop - 19/05/2008 30 / 45
Steady state for small batches lgorithm im: maximize of the onsint matrix that respect the constraints, Optimisation problem with integers. onstraints programming with finite domains (swi-prolog) Exponential complexity but the problem is small lgorithm 1: reduceperiod(cons: Matrix, cost: Matrix ) : Matrix cd periodlength/throughputenominator; while cd > 1 do newons : Matrix; if newons reorganize(cons, cost, cd) then return newons; else cd cd 1; end end return cons; 2nd Scheduling in ussois workshop - 19/05/2008 31 / 45
Outline Problem definition lgorithms evaluation Presentation Experiences Synthesis Steady state for small batches Means of action Reduce period size Experiences onclusion and futur works 2nd Scheduling in ussois workshop - 19/05/2008 32 / 45
Steady state for small batches Metric efficiency = makespan o /makespan r efficiency = atch size/(rate makespan r ) Steady state rate is optimal time reference: N/ρ, lower bound for optimal makespan (makespan o ), makespan r : makespan of the algorithm. 2nd Scheduling in ussois workshop - 19/05/2008 33 / 45
Figure: Job j 3 Type p 1 p 2 p 3 p 4 20 20 10 10 10 10 10 10 Table: Grid G 3 Efficiency 1 0.95 0.9 0.85 0.8 0.75 0.7 0.65 0.6 Normal period Reduced period 10 20 30 40 50 60 70 80 90 100 110 120 130 140 150 atch size Period: 16/200 4/50 (/4), Figure: Execution of batches j 3 on G 2 2nd Scheduling in ussois workshop - 19/05/2008 34 / 45
Figure: Job j 3 Type p 1 p 2 p 3 p 4 20 20 20 10 10 10 10 10 10 10 10 10 Table: Grid G 4 Efficiency 1 0.95 0.9 0.85 0.8 0.75 0.7 Normal period Reduced periode 0.65 0.6 10 20 30 40 50 60 70 80 90 100 110 120 130 140 150 atch size 96/1200 4/50 (/24), Figure: Execution of batches j 3 on G 3 2nd Scheduling in ussois workshop - 19/05/2008 35 / 45
Type p 1 p 2 p 3 p 4 20 20 10 10 10 10 10 10 Figure: Job j 4 Table: Grid G 3 Efficiency 0.98 1 0.96 0.94 0.92 0.9 0.88 0.86 0.84 0.82 Normal period Reduced period 10 20 30 40 50 60 70 80 90 100 110 120 130 140 150 atch size 48/1320 4/110 (/12), starting: 194 instances, never in steady state. Figure: Execution of batches j 4 on G 2 2nd Scheduling in ussois workshop - 19/05/2008 36 / 45
Type p 1 p 2 p 3 p 4 20 20 20 10 10 10 10 10 10 10 10 10 Figure: Job j 4 Table: Grid G 4 Efficiency 0.98 1 0.96 0.94 0.92 0.9 0.88 0.86 0.84 0.82 Normal period Reduced period 10 20 30 40 50 60 70 80 90 100 110 120 130 140 150 atch size 12/330 4/110 (/3), starting: 38 instances, 2 full periods for a batch of 150 jobs, 10 Figure: Execution of batches j 4 on G 3 Max efficiency difference: 1%. 2nd Scheduling in ussois workshop - 19/05/2008 37 / 45
Outline Problem definition lgorithms evaluation Presentation Experiences Synthesis Steady state for small batches Means of action Reduce period size Experiences onclusion and futur works 2nd Scheduling in ussois workshop - 19/05/2008 38 / 45
onclusion and futur works onclusion: omparison of algorithms performances, Minimal period while keeping steady state, Large gain for small batches, Not always possible. Futur works: Keeping an optimal steady state: omparison of dependencies resolutions. eterioration of steady state: Reduce the number of instances per periods. 2nd Scheduling in ussois workshop - 19/05/2008 39 / 45
The end Thanks for your attention. [diakite,nicod,philippe]@lifc.univ-fcomte.fr
Steady state for small batches Reminder Initialization prepares all the dependencies needed before entering in steady state: For each task or communication in the period: execute all the preceding tasks/communications in the graph Ending: finish all the remaining tasks/communications, ommon work with Loris Marchal (LIP) Reduce the number of tasks computed in the starting and ending phases. 2nd Scheduling in ussois workshop - 19/05/2008 41 / 45
ependencies resolution Period 1 Period 2 Period N Figure: Job j 3 Type p 1 p 2 p 3 p 4 10 10 10 10 10 10 10 10... Table: Grid G 5 Figure: Execution of batches j 3 on G 5 2nd Scheduling in ussois workshop - 19/05/2008 42 / 45
ependencies resolution Initial Schedule: Period 1 Period 2 Period N... Schedule with less dependencies: Period 1 Period 2 Period N... 2nd Scheduling in ussois workshop - 19/05/2008 43 / 45
ependencies resolution P1:0 0:1 1:1 4:1 Tbegin:0:0 8 :1:1 4 P2:1 1:1 2:1 3:1 8 8 :2:1 8 2 :3:1 P3:2 1:1 2:1 3:1 8 Tend:4:0 Figure: Platform Figure: Job 2nd Scheduling in ussois workshop - 19/05/2008 44 / 45
ependencies resolution 8 1 suppressed dependency = 1 subgraph less, alance starting and ending, How to optimize dependencies resolution? How to mesure the gain? The more... the less re there better dependencies? Max number of dependencies: two-partition Reoganize the periodic schedule: heuristics Find a good scheduling algorithm for starting and ending phases. Link number of jobs <=> period size 2nd Scheduling in ussois workshop - 19/05/2008 45 / 45