Presentation is loading. Please wait.

Presentation is loading. Please wait.

Recap.

Similar presentations


Presentation on theme: "Recap."— Presentation transcript:

1 Recap

2 Amdahl’s Law Performance impact of optimizing part of a program:
Let an optimization speedup f fraction of time by a factor of s: New Time = OldTime x [(1-f) x 1 + f x (1/s)] Speedup = s > 1.0 for speedup, f <= 1.0 as it is a fraction

3 Amdahl’s Law Old Time New Time = s

4 Improving all FP operations
Example 1 Which change is more effective on a certain Processor: speeding up 10-fold the floating point square root operation only, which takes up 20% of execution time, or speeding up 2-fold all floating point operations, which take up 50% of total execution time? (Assume that the cost of accomplishing either change is the same, and the two changes are mutually exclusive.) SPEEDUPSQ = 1/((1-0.2) + (0.2/10)) = 1.22, or 22% SPEEDUPFP = 1/((1-0.5) + (0.5/2)) = 1.33, or 33% Note that there are three categories of operations here: floating point square root operations, other floating point operations, and non-FP operations. When we change one of these categories, we group the other two categories as the “other case”. Improving all FP operations is more effective

5 Improving all FP operations
Example SPEEDUPSQ = 1/((1-0.2) + (0.2/10)) = 1.22, or 22% SPEEDUPFP = 1/((1-0.5) + (0.5/2)) = 1.33, or 33% Note that there are three categories of operations here: floating point square root operations, other floating point operations, and non-FP operations. When we change one of these categories, we group the other two categories as the “other case”. Improving all FP operations is more effective

6 Amdahl’s Law Law of Diminishing Returns: The Performance Enhancement Possible Is Limited By the Amount That the Improved Feature Is Used.

7 Example A server spends 50% of CPU time on I/O and 50% on computation. What is the speedup if we replace the CPU with one that is 8 times faster?

8 Multi-Core (parallelism) and Amdah’s law
Suppose a program takes 1 unit of time to execute serially A fraction of the program, s, is inherently serial (unparallelizable) For example, consider a program that, when executing on one core processor, spends 20% of its time in a non-parallelizable region. How much faster will this program run on a 4-processor system? What is the maximum speedup from parallelization? 5 New Execution Time = 1-s + s P New Execution Time = .8T + .2T 0.4T 4 Speedup =1T/0.4T = 2.5


Download ppt "Recap."

Similar presentations


Ads by Google