Docsity

Understanding Performance in Computer Architecture: Lecture 4, Study notes of Computer Architecture and Organization

Partial preview of the text

Download Understanding Performance in Computer Architecture: Lecture 4 and more Study notes Computer Architecture and Organization in PDF only on Docsity!

CS 35101

Computer Architecture

Spring 2008

Lecture 04: Understanding Performance

Taken from Mary Jane Irwin (www.cse.psu.edu/~mji) and Kevin Schaffer [Adapted from Computer Organization and Design , Patterson & Hennessy, © 2005, UCB]

Airplane Example

DC-8-50 146 8720 544 79, Concorde 132 4000 1350 178, Boeing 747 470 4150 610 286, Boeing 777 375 4630 610 228, Passenger throughput (passengers × MPH) Cruising speed (MPH) Cruising range (mi) Passenger capacity Airplane

Defining (Speed) Performance

 Normally interested in reducing  Response time (aka execution time) – the time between the start and the completion of a task

  • Important to individual users (desktop computers, user-interactive)  Thus, to maximize performance, need to minimize execution time X Y X Y X Y X X

Execution Time Execution Time

Execution Time

Execution Time

Performance Performanc e

Execution Time

Performanc e

Relative Performance

 Commonly we want to compare performance of two different computers  If X is n times faster than Y, then...

= = n

X Y Y X

Execution Time

Execution Time

Performanc e

Performanc e

 Throughput – the total amount of work done in a given time

  • Important to data center managers (non-user-interactive systems, servers)  Decreasing response time almost always improves throughput

Clock Cycles

 Clock cycle time (clock period) is the length of one clock cycle in seconds (ps, ns)  Clock rate (clock frequency) is the number of clock cycles per second measured in Hertz (GHz, MHz)  Clock rate = 1 / Clock cycle time  Make sure units match

Review: Machine Clock Rate

CC = 1 / CR

one clock period 10 nsec clock cycle => 100 MHz clock rate 5 nsec clock cycle => 200 MHz clock rate 2 nsec clock cycle => 500 MHz clock rate 1 nsec clock cycle => 1 GHz clock rate 500 psec clock cycle => 2 GHz clock rate 250 psec clock cycle => 4 GHz clock rate 200 psec clock cycle => 5 GHz clock rate

Performance Factors continued

 Want to distinguish elapsed time and the time spent on our task  CPU execution time (CPU time) – time the CPU spends working on a task  Does not include time waiting for I/O or running other programs CPU execution time # CPU clock cycles for a program for a program = x clock cycle time CPU execution time # CPU clock cycles for a program for a program clock rate

 Can improve performance by reducing either the length of the clock cycle or the number of clock cycles required for a program or

Clock Cycles per Instruction

 Not all instructions take the same amount of time to execute  One way to think about execution time is that it equals the number of instructions executed multiplied by the average time per instruction  Clock cycles per instruction (CPI) – the average number of clock cycles each instruction takes to execute  A way to compare two different implementations of the same ISA

CPU clock cycles # Instructions Average clock cycles

for a program for a program per instruction = x CPI 1 2 3 A B C CPI for this instruction class

THE Performance Equation

 Our basic performance equation is then CPU time = Instruction_count x CPI x clock_cycle Instruction_count x CPI clock_rate CPU time = ----------------------------------------------- or  These equations separate the three key factors that affect performance  Can measure the CPU execution time by running the program  The clock rate is usually given  Can measure overall instruction count by using profilers/ simulators without knowing all of the implementation details  CPI varies by instruction type and ISA implementation for which we must know the implementation details

Determinates of CPU Performance

CPU time = Instruction_count x CPI x clock_cycle Algorithm Technology Processor organization ISA Compiler Programming language Instruction_ CPI clock_cycle count

Evaluating Performance

 Set of programs run on a computer is a workload  A benchmark is a workload specifically designed to measure a computer's performance  The best benchmarks are made up of real programs  Synthetic benchmarks , on the other hand, try to measure low-level performance by repeating short blocks of code

Comparing and Summarizing Performance

 Guiding principle in reporting performance measurements is reproducibility – list everything another experimenter would need to duplicate the experiment (version of the operating system, compiler settings, input set used, specific computer configuration (clock rate, cache sizes and speed, memory size and speed, etc.))  How do we summarize the performance for benchmark set with a single number?  The average of execution times that is directly proportional to total execution time is the arithmetic mean (AM)

AM = 1/n Σ Time

i i = 1 n  Where Timei is the execution time for the i th program of a total of n programs in the workload  A smaller mean indicates a smaller average execution time and thus improved performance

SPEC Benchmarks www.spec.org

apsi Pollutant distribution sixtrack Nuclear physics accel twolf Circuit place & route fma3d Crash simulation fem bzip2 compression lucas Primality testing vortex Object oriented database ammp Computational chemistry gap Group theory interpreter facerec Facial image recognition Seismic wave propagation simulation perlbmk perl application equake eon Computer visualization art Image recognition (NN) parser Word processing program galgel Computational fluid dynamics crafty Chess program mesa 3D graphics library mcf Combinatorial optimization applu Parabolic/elliptic pde gcc GNU C compiler mgrid Multigrid solver in 3D fields vpr FPGA place & route swim Shallow water model gzip compression wupwise Quantum chromodynamics Integer benchmarks FP benchmarks

Example SPEC Ratings