1 / 23

Computer Science 320

Computer Science 320. Measuring Speedup. What Is Running Time?. T ( N , K ) says that the running time T is a function of the problem size N and the number of processors K

carlyn
Download Presentation

Computer Science 320

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Computer Science 320 Measuring Speedup

  2. What Is Running Time? • T(N, K) says that the running time T is a function of the problem size N and the number of processors K • To determine speedup, we’ll always determine both Tseq(N, K) and Tpar(N, K), where K = 1 and K > 1, respectively

  3. What Is Speed? • Speed is the rate at which program runs can be done • S(N, K) = 1 / T(N, K) • Measured in program runs per second, rather than seconds per run

  4. What Is Speedup? • Speedup is the speed of a parallel version running on K processors relative to a sequential version running on one processor • Speedup(N, K) = Spar(N, K) / Sseq(N, 1) • Why seq in the denominator?

  5. Speedupin Terms of Running Time Speedup(N, K) = Tseq(N, K) / Tpar(N, K) Ideally, the speedup should equal K, or a linear speedup The real speedup of most algorithms is sublinear

  6. What Is Efficiency? Eff(N, K) = Speedup(N, K) / K Usually a fraction < 1

  7. Amdahl’s Law • The sequential portion of a parallel program puts an upper bound on the efficiency it can achieve • The sequential parts are usually run at startup and cleanup

  8. What Is the Sequential Fraction? • The sequential fraction F is the fraction of the code that must be run sequentially • F * T(N, 1) is the running time of the sequential part on a single processor • (1 – F) * T(N, 1) is the running time of the parallel part on a single processor

  9. Amdahl’s Law T(N, K) = F * T(N, K) + 1/K * (1 – F) * T(N, K) Running time when the parallel part is equally divided among K processors

  10. Speedup and Efficiency in Terms of Sequential Fraction Speedup(N, K) = 1 /(F + (1 – F) / K) Eff(N, K) = 1 / (K * F + 1 – F)

  11. Consequences of Amdahl • As K increases, the speedup approaches 1 / F • As K goes to infinity, the efficiency approaches 0

  12. Predicted Speedups

  13. Predicted Efficiencies

  14. A Normal Plot for up to 8 Processors

  15. Experimentally Determining F To calculate the sequntial fraction F from the running time measurements, we rearrange Amdahl’s Law to get F = (K * T(N, K) - T(N, 1)) / (K * T(N, 1) - T(N, 1)) Called EDSF If F is not a constant or EDSF versus K is not a horizontal line, something’s not right with the program

  16. Measuring Running Times • Not the same on each run with the same data set • Take the minimum time of several runs, not the average time. Why?

  17. Experimental Situation • Close all unnecessary apps and prevent remote logins • Tseq(N, 1) must be at least 60 seconds • Run the sequential program 7 times on each data size N, and take the minimum time

  18. Experimental Situation • For each data size N and for each K from 1 up to the number of available processors, run Tpar(N, K) 7 times and take each minimum time

  19. Running Time of Key Search

  20. Speedup of Key Search

  21. Efficiency of Key Search

  22. EDSF of Key Search

More Related