80 likes | 233 Views
CS170 Computer Organization and Architecture I. Ayman Abdel-Hamid Department of Computer Science Old Dominion University Lecture 8: 9/19/2002. Outline. An example of geometric mean use to summarize performance Fallacies and Pitfalls Amdahl’s Law Using MIPS as a performance Metric
E N D
CS170 Computer Organization and Architecture I Ayman Abdel-Hamid Department of Computer Science Old Dominion University Lecture 8: 9/19/2002 CS170 Fall 2002
Outline • An example of geometric mean use to summarize performance • Fallacies and Pitfalls • Amdahl’s Law • Using MIPS as a performance Metric • Should cover section 2.7 CS170 Fall 2002
Performance Summary Example1/2 Which machine is faster according to total execution time? And by how much? Total Execution Time (A) = 1482 + 2266 + 6206 = 9954 Total Execution (B) = 139 + 254 + 690 = 1083 Machine B is fastest by 9954/1083 = 9.27 times CS170 Fall 2002
Performance Summary Example2/2 Which machine is faster by the geometric mean measure? • Remember how SPEC reported performance? • Normalize in reference to one machine • Choose A as reference machine • Obtain Execution time ratios (ET Ratio) • ET Ratio(P1) = ET(A)/ET(B) = 1482/139 = 10.66 • ET Ratio (P2) = 2266/254 = 8.92 • ET Ratio(P3) = 6206/690 = 8.99 • Geometric Mean = (Ratio (P1) * Ratio(P2) * Ratio(P3))1/3 • Geometric Mean = 9.49 • Machine B is 9.49 times faster than A according to geometric mean measure CS170 Fall 2002
Amdahl’s Law1/3 Pitfall Expecting the improvement of one aspect of a machine to increase performance by an amount proportional to the size of the improvement Program runs in 100 sec on a machine Multiply operations responsible for 80 sec of time How much do we need to improve the speed of multiplication if program is to run 5 times faster? Execution time after improvement = (Execution time affected by improvement/Amount of improvement + Execution time unaffected) Execution time after improvement = 80/n + (100-80) = 20 = (100/5) 20 = 80/n + 20 80/n = 0 no n can be found to achieve the requested improvement Make the common case fast CS170 Fall 2002
Amdahl’s Law2/3 Another form of Amdahl’s Law (to yield Speedup) Speedup = Performance after improvement/Performance before Speedup = Execution time before/Execution time after improvement Assume new hardware added to machine f = fractions of all operations which use new hardware s = speedup of those operations using new hardware Execution time with new hardware is Tnew Execution time without new hardware is Told Tnew = f* Told/s + (1-f) * Told Overall speedup S = Told/Tnew Speedup = s / (s –f * (s-1)) CS170 Fall 2002
Amdahl’s Law3/3 • Example of memory versus processor speedup • A = B op C • Assume memory access takes 4 cycles and a typical operation takes 2 cycles • Which of the following achieves the best increase in performance • Increase memory speed by 50% • Double operation speed Option 1 increase memory speed by 50% s1 = 1.5 (how?) f1 = memory access time/ total time = 16/18 = 0.889 S1 = 1.42 Option 2 double operation speed s2 = 2 f2 = operation time/total time = 2/18 = 0.111 S2 = 1.059 • Calculate how many memory accesses are needed first? • 1 to get instruction from memory • 2 to get B and C from memory • 1 to store result (A) back in memory • Then we need a total of 4 memory access operations • Memory access time = 4 (accesses) * 4 (cycles/access) = 16 cycles • Operation time = 1 (operation) * 2 (cycles/operation) = 2 cycles • Total number of cycles = 16 + 2 = 18 CS170 Fall 2002
MIPS as a Performance Metric • MIPS is million instructions per second MIPS = instruction count / (Execution time * 106) • Instruction execution rate (instruction/sec) • Faster machines have a higher MIPS rating • Problems with MIPS • Does not take into account capabilities of instructions • (can not compare computers with different ISA) • Varies between programs on the same computer • (a machine can not have a single MIPS rating for all programs) • Can vary inversely with performance • Example page 78 CS170 Fall 2002