• Keine Ergebnisse gefunden

Overall algorithm to minimize peak temperature . 74

3.7 Real-time Analysis and Problem Formulations

3.7.3 Overall algorithm to minimize peak temperature . 74

With formulation (3.41), Algo. 5 provides the pseudo-code of our ap-proach. It’s worth noting thatbshould vary in a feasible region[bmin,bmax], where bmin = in=1(tswo f fi +tswoni +ci) since to f fi is lower bounded by tswo f fi , andbmax =max

b: max(0,∆−b) ≥αu(∆−D), ∀∆≥0 , which is obtained from [1].

3.8 Solving the sub-problem

This section presents two algorithms to solve the sub-problem (3.41).

Each algorithm can be called individually by Algo. 5 to minimize the peak temperature and find the optimal PTM schemes.

Lemma 3.19 For problem (3.41), Ri can be obtained safely by the following equation:

Ri =ciρ (3.42)

3.8. Solving the sub-problem Algorithm 5Peak Temperature Optimization

Input: TM, α, D, n, c,tswon,tswoff, search step η Output: Tmin? , ton, toff

1: calculate[bmin,bmax]

2: Tmin?∞, R0, toff0

3: foreachb =bmin tobmax with step η do

4: get correspondingρ from (3.38)

5: solve sub-problem (3.41) and get

6: T?, R, toff

7: ifT? < Tmin? then

8: Tmin?T?, RR,

9: tofftoff 10: end if

11: end for

12: calculatetonwith tion = (Rito f fi +tswoni )/(1−Ri)

Proof From the definition ofRi, one can derivetoni = (Rito f fi +tswoni )/(1− Ri). Then, we have dtdRoni

i >0, which means a larger Riresults in a higher partition of toni , that is, a higher peak temperature. ThereforeRi should equal its lower bound ciρ such that the peak temperature won’t be

ele-vated unnecessarily.

From Lem. 3.19, T?(R,toff) in (3.41) can be transformed to a function of toff , T?(c·ρ,toff), with the constraint:

n i=1

(to f fi +tswoni +ci)≤b (3.43)

Next we present two fast algorithms to solve the sub-problem (3.41) corresponding to the two peak temperature algorithms proposed in Sec-tion 3.6.2.

3.8.1 Algorithm FBGD to solve the FBPT based sub-problem

In this case,T?(R,toff)is calculated with the FBPT algorithm. Intuitively, one can brutally search the whole exploring space to find the optimal solution. However, as the stage numbernincreases, the exploring space expends (approximated) exponentially and this approach will finally be

infeasible. For example, ifn =8 and everyto f f has 50 candidates in the exploring space, there will be 508=3.90625×1013 combinations in total.

The brutally searching algorithm needs more than 120 years to finish if the computer can check 10000 combinations per second. Therefore, a more clever algorithm is needed to solve sub-problem (3.41). We first introduce the following conjecture obtained from a set of systematic experiments.

Conjecture 3.20 (Unimodal Peak Temperature) Given ρ and R = c·ρ, the peak temperature calculated by FBPTis a unimodal function of to f fi in the feasible region of to f fi .

An example is shown in Fig. 3.8, the obtained peak temperature first decrease and then increase asto f fi varies from its lower bound to upper bound while otherto f fs stay constant.

From Conjecture 3.20, the local minima is also the global minima of the peak temperature. Therefore, inspired by the gradient descent method, we propose an Fast-Bounding-based adaptive-step-Gradient-Descent(FBGD) algorithm to find the optimaltoffin the exploring space.

Algo. 6 outlines the pseudo-code of the algorithm. It takes the thermal model, the stage number, mode-switching overhead vectors, b, ρ, c, a initial step size ξ, and a minimal step size ξmin as input. The iteration starts at the initial point tswoff (line 3). In every iteration, it first checks whether feeding one current step size ξ to toff will violate the limit of b (line 5). If so, the current step size should shrink to a smaller value which satisfies constraint 3.43. In this algorithm, the golden section scale is utilized to obtain the new step size ξ (line 6). Then all the possible directions are checked (line 11) to find the direction which leads to the current steepest descent. If the the minimal gradient results in a lower peak temperature, the corresponding direction will be selected to update toffby addingξtotoff(line 16). Otherwise, we adapt the step to a smaller size which is also determined by the golden section rule (line 18). the algorithm executes the iteration until the minimal step size is reached (line 8).

3.8.2 Algorithm ANSA to solve the ANPT based sub-problem

Obtained from algorithm ANPT, the peak temperature varies irregularly in the space oftoff. As shown in Fig. 3.8, there exist several cliffs as to f fi

3.8. Solving the sub-problem Algorithm 6FBGD: solve the FBPT based sub-problem with givenband

ρ

Input: TM, n, b, ρ, c, tswon, tswoff, initial step size ξ, minimal step size ξmin

Output: T?, R, toff

1: e1 ←(1, 0,· · · , 0), e2 ←(0, 1,· · · , 0), en ←(0, 0,· · · , 1),g01,n 2: Rρ·c,tofftswoff

3: Tlast?T?(R,toff) calculated by Algo. 3

4: whiletruedo

5: ifni=1(to f fi +tswoni +ci) +ξ >b then

6: ξ0.618∗(b−∑ni=1(to f fi +tswoni +ci))

7: end if

8: ifξξmin then

9: break

10: end if

11: foreach 1≤in do

12: gi ←(T?(R, toff+ξei)−Tlast? )

13: end for

14: if min{g}<0then

15: findi whereg==min{g},tofftoff+ξei,

16: Tlast?Tlast? +min{g}

17: else

18: ξ0.618ξ

19: end if

20: end while

21: T?Tlast? , RR,tofftoff

increases, indicating the gradient descent method is not suitable any more. Therefore, we determine to deploy an heuristic algorithm to find the sub-optimal solution of sub-problem (3.41) rather than the global minimum, which can only be safely discovered by the brutally search-ing method. The well-known Simulated Annealsearch-ing (SA) algorithm is adopted to solve (3.41) in our approach and is denoted as ANSA. Note that the typical SA algorithm searches in the space oftoff without linear constraints. Therefore, the section of updating a new candidate in the SA algorithm needs to be revised to guarantee the new candidate meets the linear constraints in (3.41). Algo. 7 presents the pseudo code of the revised section.

Algo. 7 uses the current toff, b, n, c, tswon, the current simulated

an-0 50 100 150 200 250 300 377

378 379 380 381 382

toffi /ms

PeakTemperature/K FBPT

ANPT

Figure 3.8: Peak temperature obtained by FBPT and ANPT change as to f fi increases, while otherto f fs keep constant.

Algorithm 7Update toffwith linear constraint (3.40) for SA

Input: toff, b, n, c, tswon, Current SA Temperature TSA, Initial SA Tem-perature TinitSA,

1: lower boundbdl, upper boundbdu Output: toff

2: ifni=1(tio f f +tswoni +ci) ≥b then

3: toffbdl

4: return

5: end if

6: k ←an uniformly distributed random integer between 1 andn

7: temp upper boundbdmin[bduk,b−∑ni=1(to f fi +tswoni +ci) +to f fk ]

8: step ←an uniformly distributed random number between−1 and 1

9: ηTkSA/TinitSA

10: to f fkto f fk +η∗(bdbdlk)∗step

11: toffmax[toff,bdl], toffmin[toff,bdu]

3.9. Case Studies nealing temperature TSA, the initial SA temperature, and the lower and

upper bounds of toff to update the new candidate. bdl and bdu are the strict constraints thattoffmust not violate, which can be set astswoffand (b−∑ni=1(tiswo f f +tswoni +ci))·[1,· · · , 1]0, respectively. The algorithm first check if the current toff satisfies the constraint (3.43) (line 2). If (3.43) is violated, toff will be assigned to its lower bound, indicating an error toff is given (line 3). Otherwise, a to f fi in toff is chosen randomly to be updated by adding a random number between −η ∗(tbd−bdlk) and η∗(tbd−bdlk) to it (line 10). η is a control coefficient to ensure the convergence of the algorithm. Finally, the new toff is checked with bdl and bdu and revised to the safe region if necessary (line 11).

3.9 Case Studies

We evaluate the effectiveness and feasibility of our proposed approaches in this section. Four approaches are compared: (1) our FBPT based adaptive-step Gradient-Descent algorithm (FBGD), (2) the ANPT based Simulated Annealing algorithm (ANSA) (3) Brutally Searching based PBOO algorithm (BS), and (4) the brutally searching Sub-Deadline Parti-tions algorithm introduced in Section 3.5 (SDP).