








Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!









Yue Zhou [email protected]
Abstract In this report, we study the performance of “share algorithm” for adaptive disk spin down. We test the algorithm for different spin down cost and for different expert time-out distribution like linear, harmonic and exponential. And we also test the “share algorithm” with different learning rates to see its impact on the performance of prediction. Some of the performance results give us hint to further improve the algorithm efficiency and reduce the complexity.
Energy efficiency is an important problem in computer architecture design especially for mobile systems. Nowadays, almost all the operating systems spin down the hard disk when the computer idles for a certain amount of time. However, nearly all of them use a constant time-out strategy to decide spin-down or not, which turns out to be not efficient in practice. Adaptive time-out disk spin down algorithm, on the other hand, chooses spin down time-out dynamically using learning algorithm and is more likely to work well under various situations.
In this report, we take a deep look into the “share algorithm” of adaptive disk spin down algorithm. We compare the total energy cost of this algorithm with the energy cost by optimal algorithm, in which the computer knows the idle time in advance. We also change the spin-down cost and different expert time-out distribution to study the effect and efficiency of this algorithm under different situations and with different experts. The rest of the report is organized as follows: section 2 briefly describe the “share algorithm”, in section 3 we give the algorithm performance result and the analysis, and we have the conclusion in section 4.
“Share algorithm” was described in the paper by David Helmbold and etc. Basically it is a member of the multiplicative-weight algorithmic family, whose performance is excellent to deal with online problems. The input of this algorithm is the output of a set of experts which could be viewed as a set of binary numbers. In each step, each expert makes a prediction and the algorithm is designed to combine the predictions in such way that the total loss is minimized. The loss function can be defined linearly, exponentially and etc. The “share algorithm” assigns weights to each expert and combines the output linearly to get the final prediction, which is a weighted average of the experts’ prediction.
After each step, the weights of the experts are updated by the following rules: (1) The weights of wrong predictions are penalized. (2) The weights of correct predictions are strengthened.
Intuitively, this approach makes the prediction converge to those of the best experts. More specifically, the “share algorithm” updates the weight as follows: it takes certain weight of each misleading expert and “share” it with other experts. Therefore experts that are predicting well gain its influence on the final prediction and vice versa. Due to the burst nature of the disk usage, the adaptability of this algorithm is expected to perform much better than normal fixed time-out strategy.
The detail of the algorithm is as follows: (1) Equally assign weights to all the experts’ prediction in initialization. (2) Compute the weighted average of the experts’ time-outs
=
− = = n i i
n i i i w
wx time out 0
0
(3) Compute the loss of each expert
− + −
= time out spin down
idle Energy ( xi ) otherwise
idle < time − out
spin down
Energyx optimal Loss xi i −
( ) ( )
(4) Give penalty to the poorly performing experts ' Loss ( xi ) wi wie = −^ η (5) Share part of the weights to all the remaining experts
=
= − −
n
i
Lossx pool wi i 1
'( 1 ( 1 α) (^ ))
pool n
w (^) i Lossxi^ wi
1 '' =( 1 −α) (^ ) '+
(6) Normalize the new weights wi '' wi ' 'is the new weights used in the next step.
The time-complexity of this algorithm is constant and the space-complexity of this algorithm is linear to the number of the experts.
In implementation, we also set a threshold for the weights. That is, none of the weights can be less than a minimum value otherwise this weight will be zero for ever and can not regain larger value again.
3.1 Experts with exponentially distributed prediction time-out
Fig.2 Energy cost ratio of “Share Algorithm” and Optimal Algorithm
Fig.3 Energy of Individual Experts Vs Spin Down Costs
Fig.4 Weights of Individual Experts Vs Spin Down Costs
From Fig.1 and Fig.2, we can see the “share algorithm” works well in prediction of computer idle time and the difference between “share algorithm” and optimal algorithm increases sharply at first with the increase of spin down cost and then the increase becomes relatively flat.
From Fig.3, we can see that the energy cost of small time-out experts grow almost linearly with the increase of spin down cost while the energy cost of large time-out experts do not change significantly. This corresponds to our intuition well since in case of small time-out, the computer are easy to spin down and the energy cost is linear to spin down cost. And for large time-out expert, the energy cost is less related to the spin down cost.
From Fig.4 we can see that some of the experts have high weights, which means they are important in prediction while others’ weights are small and their influences are neglectable.
Then we change the parameters and set shift rate α = 0. 08 and learning rate η^ =^4.^0. Other
parameters remain the same. And we still get a very good result of prediction. The performance results are plotted in Fig.5, Fig.6, Fig.7 and Fig.8.
Fig.7 Energy of Individual Experts Vs Spin Down Costs
Fig.8 Weights of Individual Experts Vs Spin Down Costs
With the new set of parameters, the output of “share algorithm” does not change much and the energy use is very similar to the previous one.
Fig.9 Algorithm Energy Cost with Respect to Increasing Learning Rate
Fig.10 Energy Cost of Individual Experts with Respect to Increasing Learning Rate
Fig.12 Energy cost ratio of “Share Algorithm” and Optimal Algorithm
From Fig.11 and Fig.12, we find that the “share algorithm” still works well for expert of harmonically distributed prediction of idle time. And the output is very similar with those of exponentially distributed experts. The main reason that these two algorithms give similar result is that over time expert with large prediction has more weight than expert of small prediction; and thus there are only several experts that dominant the prediction of spin down decision.
3.3 Experts with linearly distributed prediction time-out In the case that experts have linearly distributed prediction time-out, the total energy cost of “share algorithm” is as good as those of exponentially distributed and harmonically distributed. The main difference here is that for experts’ time out distributing linearly, there are only one expert with very small time out while exponential and harmonic experts can have certain amount of expert with small time out prediction. We set shift
rate α = 0. 08 and learning rate^ η^ =^4.^0.
Fig.13 Harmonic Experts and Optimal Experts
Fig.14 Energy cost ratio of “Share Algorithm” and Optimal Algorithm
Fig.15shows us the energy cost of different experts (100 experts in this case). As we can see from the figure, only the one with least time-out have the energy cost linearly increase with the spin-down cost while others are nearly insensitive to spin-down cost in compare to the one of least time-out. Compared to the result with those of exponential distribution, we can find that more experts are of use in this case although the final results are generally the same. So for exponential distributed time-out experts, we are able to take away more useless experts than linearly distributed time-out experts.
Fig.16 shows the sum of weight over time for each individual experts when the spin down cost increase. We can see the weight of individual expert changes significantly when spin down cost increases and some experts have a peak of weight when the spin down cost reaches certain amount; and other experts have very low weight all the time for all the spin down cost which means they can generally useless in prediction and could be taken away in practical application.
In the project, we study the experimental performance of “share algorithm” for adaptive disk spin down application. We take the experts predictions be linear, exponential and harmonic and they generally give very good performance compared to those of optimal algorithm. We also find that there are quite amount of experts turning out to be almost useless for prediction in practice so that they could be taken away in practical application; and we also find that exponentially distributed experts generally have more number of experts to prune than exponential one. In this sense, exponential distributed time-out experts are better than linear distributed time-out experts. So in practical implementation, we need far less than 100 experts to get satisfying prediction result as the result of 100 experts; however, how to carefully choose the time out of limit number of expert doest not have a straight forward answer and requires further study on this algorithm. As for the change for learning rate, the performance of “share algorithm” becomes better but the change is about 10%, which is not significant.
Typical Codes in Matlab eta = 4.0; alpha = 0.08; s = fopen ('cello1.all.idles.only.txt', 'r'); f = fscanf (s, '%f', inf); fclose (s); energy_total = zeros (100,20);
weight_all = zeros (100,20); for x=1: weight = ones (100,1); weight = weight /100; spin_down_cost = x * 1000000; expert = (((spin_down_cost1e10) .^ 0.01) .^ (1:1:100))'1e-10; optimal = f; optimal (find(optimal>spin_down_cost))= spin_down_cost; optimal_cost (x,1) = sum (optimal); for i=1:size(f,1) time_out (i,1) = sum (weight.expert) / sum (weight); if time_out (i,1) > f (i,1) master_loss (i,1) = f (i,1); else master_loss (i,1) = time_out (i,1) + spin_down_cost; end; weight_old = weight; pool = 0; energy = expert+spin_down_cost; energy (find(expert>=f(i,1)))=f(i,1); loss = ((energy-optimal(i,1))/spin_down_cost); weight = weight . exp(0-etaloss); pool = sum (weight . (1-(1-alpha).^loss)); weight = ((1-alpha).^loss).*weight+pool / size (expert,1); weight (find(weight<1e-15)) = 1e-15; weight_total = sum(weight); weight = weight / weight_total; energy_total (:,x) = energy + energy_total (:,x); weight_all (:,x) = weight + weight_all (:,x); end; master_cost (x,1) = sum (master_loss); end;