Math Model and Algorithm Design
Start from 1995 with a single processor.
F. Yao, A. Demers, S. Shenker, A scheduling model for reduced CPU energy, in: Proceedings of IEEE Annual Symposium on Foundations of Computer Science (FOCS), 1995, pp. 374–382.
See Section 2 for details
Only assumption added is
Power Consumption depends on processor's speed :
- A schedule is a pair S = (s,job) of functions defined over [t0,t1]
- 1. Non-negative s(t) is the processor speed at time t.
- 2. job(t) defines the job being executed or idle ( if s(t)=0 ) at time t.
is job's required number of CPU cycles. Each job j average-rate is
Start time a_j, deadline b_j.
Given a job set J
At any time t, among jobs that are available for execution, that is,
It is the job with minimum deadline that will be executed during [t, t + ε].
In EDF, we assume the jobs in J = {j1, . . . , jn} are indexed by their deadlines.
Repeat the following steps until J is empty:
1. Identify a critical interval I* = [ z ,z’] by computing s = max g(I),
2. Schedule the jobs of J_I* at speed s over interval I*
by the Earliest Deadline policy
(which is always feasible, see C. Liu and J. Layland. Scheduling algorithms for multiprogramming in a hard real-time environment. CACM 20 (l),46-61, 1973.).
3. Update the subproblem
J -= J_I*; // reflect the deletion of jobs J_I*
for all job j in J:
// reset other jobs' deadline to reflect deletion of interval I*
if bj ∈ [z,z’]:
b_j := z
else if b_j >= z':
b_j -= (z'-z)
similarly, reset the arrival times
Define . Complexity: or using segment tree.
Step-by-Step Walk-Through of the algorithm
s1=d1 max speed in J ----- Critical Interval I*=[a1,b1]
Schedule the jobs of J_1 by Earliest Deadline Policy.
Here only J1 is involved.
Reset J -= J_1, update J2, J5, J6 and J8 time interval.
s2=d2 max speed in J ----- Critical Interval I*=[a2,b2]
Schedule the jobs of J_1 by Earliest Deadline Policy.
Here only J1 is involved.
Reset J -= J_2, update J5 and J8 time interval.
s3=d3 max speed in J' ----- Critical Interval I*=[a3,b3]
Schedule the jobs of J_3 by Earliest Deadline Policy.
Here only J3 is involved.
Reset J -= J_3, update other jobs' time interval.
d6, d2, d4 ..
(sorted by the height di, reflecting the average rate needed for the job to be done within deadline.)
[Average Rate Heuristics]After each arrival time t, recompute an optimal schedule for the problem instance,
[Optimal Available Heuristic]
The competitive ratio of an online algorithm for an optimization problem is
We also conjecture that
We prove For the power function , the Average Rate Heuristic has competitive ratio r where 4<r<8.
Details: Section 5, Analysis of AVR
Ref: Kwon, W. & Kim, T. (2005) ACM Trans. Embedded Computing Systems 4, 211–230.
SCP-AM-2005-Tsinghua_Li-Energy-DVS-Discrete: Discrete model, [Optimal], where d := # speed levels.
Li, M. & Yao, F. F. (2005) SIAM J. Computing 35, 658–671.
d := discrete voltage levels The clock speeds s1 > s2 > ··· > sd.
Assumption:
Goal
For any constant s, the s-schedule for J is
Hence this two-stage algorithm yields an optimal discrete voltage schedule for J in total time O(dn log n).
a maximal subinterval of [0,1] when executing the same job jk (regarding S).
the collection of all execution intervals for jk with respect to S. Here, all s-execution intervals for job jk.
EDF ordering
By def of EDF,
Two EDF schedules with different speeds s1(t) > s2(t), for all t whenever S1 is not idle.
1' For any t and any job jk, the workload of jk executed by time t under S1 is always <= that under S2.
The rightmost point of each connected component of must be a tight deadline. --- Property (2)
2' for any i, 1 ≤ i ≤ n.
3' Any job of J that can be finished under S2 is always finished strictly earlier under S1.
yielding no tight deadlines in . --- Property (1)
4' If S2 is a feasible schedule for J, then so is S1.
Refer to Lemma 3.3 Refer to Lemma 4.3
Refer to Lemma 3.4
Given a job set J and any speed s, partition jobs by speeds which are ≥ s and < s in the (continuous) optimal schedule of J
s-partition of J
s-partition by time,
A tight job deadline bi is that job
Gap
Gaps in an s-schedule can exist only in ; furthermore, a gap must exist in .
Refer to Lemma 4.6. (Prove by contradiction)
Property (2-right) Tight deadlines in an s-schedule can exist only in . The rightmost point of each connected component of must be a tight deadline.
Given above in comparison-between-two-edf
Property (2) gives a necessary condition for identifying the right boundary of each connected component of .
The corresponding left boundary of such a component can also be identified through left-right symmetry of the scheduling problem with respect to time.
Property (2-left): Symmetric Analogue of Property (2)
Tight arrival times in an s-schedule can exist only in . The leftmost point of each connected component of must be a tight arrival time.
A gap always exists in an s-schedule if = ∅.
The expansion [b,a] of a gap [x,y] defines the connected component in containing [x,y]
SCP-AM-2005-Tsinghua_Li-Energy-DVS-Continuous-Discrete: Continuous model, .
M. Li, A.C. Yao, F.F. Yao, Discrete and continuous min-energy schedules for variable voltage processors, Proc. Natl. Acad. Sci. USA 103 (11) (2006) 3983–3987.
T supporting parameter
the union of all job intervals in J.
Define avr(J), the ‘‘average rate’’ of J to be
the total workload of J divided by |T| .
We will use avr(J) as the speed threshold to perform a bipartition on J. (Unless Opt is constant function).
SCP-AM-2014-Tsinghua_Li-DVS-Continuous: Continuous model, .
M. Li, F.F. Yao, H. Yuan, An O(n^2) algorithm for computing optimal continuous voltage schedules, in: Proceedings of Annual Conference on Theory and Applications of Models of Computation (TAMC), 2017, pp. 389–400.
ei meaning
The most critical part of the algorithm is Line 6, which can be implemented efficiently by the following folklore method using a special union-find algorithm developed by Gabow and Tarjan [12] (see also the discussion of the decremental marked ancestor problem [4])