Single Core Processor (SCP) DVFS

Math Model and Algorithm Design

Continuous Speed Model in 1995

Start from 1995 with a single processor.

  1. SCP-AM-1995-PARC_Yao-DVS-Continuous : First to give a polynomial-time algorithm to compute an optimal schedule in O(n3)O(n^3); Main benchmark for evaluating other scheduling algorithms.

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.

Model

See Section 2 for details

Power Consumption Function

P(s)=sp,p2P(s) = s^{p} , p \geq 2

E(S)=tP(s(t))dtE(S)=\int_t P(s(t)) dt

- 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.
Power-Convex

Average Rate or Density

RjR_j is job's required number of CPU cycles. Each job j average-rate is

dj=Rjbjajd_j = \frac{R_j} {b_j-a_j}

Start time a_j, deadline b_j.

Critical Interval

Given a job set J

Earliest Deadline First

At any time t, among jobs jkj_k that are available for execution, that is,

It is the job with minimum deadline bkb_k that will be executed during [t, t + ε].

In EDF, we assume the jobs in J = {j1, . . . , jn} are indexed by their deadlines.

Offline Algorithm: Divide and Conquer

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 J=n|J| = n. Complexity: O(n2)O(n^2) or O(nlog2n)O(n log^2 n) using segment tree.

1995-Algo-1

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.)
1995-Algo-1(1)

Online Algorithm

Heuristics

[Average Rate Heuristics]After each arrival time t, recompute an optimal schedule for the problem instance,

[Optimal Available Heuristic]

s(t)=jdjs(t)=\sum_j d_j

Competitive Ratio

The competitive ratio of an online algorithm for an optimization problem is

Example

1995-Algo-2 1995-Algo-3

We also conjecture that

We prove For the power function P(s)=s2P ( s ) = s^2, the Average Rate Heuristic has competitive ratio r where 4<r<8.

Details: Section 5, Analysis of AVR

Discrete Speed Model via Translation from the above continuous model

  1. SCP-AM-2005-Samsung_Kwon-DVS: O(n3)O(n^3), same as the continuous algorithm.

Ref: Kwon, W. & Kim, T. (2005) ACM Trans. Embedded Computing Systems 4, 211–230.

Improvements in 2005

Discrete Speed Model ( Time Complexity ⬇ )

SCP-AM-2005-Tsinghua_Li-Energy-DVS-Discrete: Discrete model, O(dnlogn)O(d n logn) [Optimal], where d := # speed levels.

Li, M. & Yao, F. F. (2005) SIAM J. Computing 35, 658–671.

Model

d := discrete voltage levels The clock speeds s1 > s2 > ··· > sd.

Assumption:

Goal

s-schedule

For any constant s, the s-schedule for J is

Algorithm Design

Stage1-1Stage1-2

Stage2

Hence this two-stage algorithm yields an optimal discrete voltage schedule for J in total time O(dn log n).

1995-Algo-2005-1.png

Algorithm Details

(s-)Execution Interval

a maximal subinterval of [0,1] when executing the same job jk (regarding S).

Ik(S)I_k(S) the collection of all execution intervals for jk with respect to S. Here, IksI_k^s all s-execution intervals for job jk.

EDF ordering

By def of EDF,

Ii(S)[ai,bi]k=1i1Ik(S)I_i(S) ⊆ [ai,bi]− \bigcup_{k=1}^{i-1} I_k(S)

1995-Algo-4-EDF.png

Comparison between two EDF

Two EDF schedules with different speeds s1(t) > s2(t), for all t whenever S1 is not idle.

Refer to Lemma 3.3 \rightarrow Refer to Lemma 4.3

Algorithm Stage 1-1: s-schedule computed in O(n logn)

Refer to Lemma 3.4

overall-algorithm-design

Algorithm Stage 1-2: Partition of jobs into 2 disjoint sets

Model

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

1995-Algo-5.png

s-partition by time,

A tight job deadline bi is that job jij_i

Gap

1995-Algo-6.png

Gaps in an s-schedule can exist only in T<sT^{<s}; furthermore, a gap must exist in T<sT^{<s}.

Refer to Lemma 4.6. (Prove by contradiction)

Find the left and right boundary

Property (2-right) Tight deadlines in an s-schedule can exist only in TsT^{≥s}. The rightmost point of each connected component of TsT^{≥s} 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 TsT^{≥s}.

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 TsT^{≥s}. The leftmost point of each connected component of TsT^{≥s} must be a tight arrival time.

1995-Algo-rev.png

Gap

A gap always exists in an s-schedule if T<sT^{<s}= ∅.

The expansion [b,a] of a gap [x,y] defines the connected component in T<sT^{<s} containing [x,y]

1995-Algo-gap.png

Algorithm Stage 1-2

1995-Algo-Bipartition.png

overall-algorithm-design

Algorithm Stage 2: Two-level Schedule

1995-Algo-Two-level.png

overall-algorithm-design

Continuous Speed Model ( Time Complexity ⬇ )

SCP-AM-2005-Tsinghua_Li-Energy-DVS-Continuous-Discrete: Continuous model, O(n2logn)O(n^2 logn).

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.

Algorithm

T supporting parameter

Complexity

Continuous Speed Model / Offline in 2014 (Time Complexity ⬇ )

SCP-AM-2014-Tsinghua_Li-DVS-Continuous: Continuous model, O(n2)O(n^2).

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.

Data Structure

1995-Algo-2014-DS.png

ei meaning

s-Schedule Algorithm in Linear Time

1995-Algo-2014-1.png

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])

Union-find