Performance
Moore's Law
Moore's Law Related Curves
The Complete System Performance depends on much besides CPU:
Terminology
CPU Time Execution Time:
CPU Time Execution Time:
Clock GHz = billions of cycles / second
Clock Different subsystems, different clocks Pentium IIi7
Limiting Circuits Increasing clock may outpace time required by some circuits:
Limiting Circuits Processor designers can compensate by making instruction step take multiple cycles:
Clock Speedup Potentially counter productive results:
Clock Speedup Potentially counter productive results:
GHz Myth Different processors = different work/clock Ramping up clock in same processor may not help
MIPS MIPS = Millions of Instructions Per Second
CPI Different instructions = different #clock cycles
CPI Finding average cycles per instruction: – Clock cycles/instruction weighted by frequency
CPI Determining time spent doing different types using frequency & CPI: Average: 1.75
MIPS Flaws Compiler A: 2 million 1-cycle + 1 million 2-cycle = 3 million instruction over 4 million cycles Compiler B: 1.5 million 1-cycle million 2-cycle = 2.7 million instructions over 3.9 million cycles Faster program
MIPS Flaws Compiler A: = 3 million instruction & 4 million cycles 3 / 4 =.75 instruction per cycle Compiler B: = 2.7 million instructions & 3.9 million cycles 2.7 / 3.9 =.69 instructions per cycle Faster program Worse IPS
GHz Myth What work does an instruction do? Assume same execution time for A & B – A's MIPS score is 50% higher
MIPS MIPS can't compare different architectures
Measurement Reliable performance measurement must measure all three factors
Amdahl's Law
Gene Amdahl
Amdahl's Law Applied to parallel processing: Applied to computer systems: – Which chunk of work should we optimize?
Speed up A program used to take 20 minutes to run. Now it takes 15. What is the speedup? 1.33 times or 33%
Amdahl's Law Describes overall speedup of a system when we speed up one part of a system
Amdahl's Law Describes overall speedup of a system when we speed up one part of a system f : fraction of time part is limiting factor
Amdahl's Law Describes overall speedup of a system when we speed up one part of a system f : fraction of time part is limiting factor k : speedup of that part
Amdahl's Law Describes overall speedup of a system when we speed up one part of a system f : fraction of time part is limiting factor k : speedup of that part 1 – f : fraction of time doing other stuff
Amdahl's Law Describes overall speedup of a system when we speed up one part of a system f : fraction of time part is limiting factor k : speedup of that part 1 – f : fraction of time doing other stuff S : speed up
Example On a large system, suppose we can upgrade its disk drives for $7,000 to make them 150% faster. Processes spend 70% of their time running in the CPU and 30% of their time waiting for disk service. What would the expected speedup be?
…upgrade its disk drives for $7,000 to make them 150% faster. Processes spend 70% of their time running in the CPU and 30% of their time waiting for disk service f : fraction of time part is limiting factor k : speedup of that part 1 – f : fraction of time doing other stuff S : speed up Example 150% increase = 250%
…upgrade its disk drives for $7,000 to make them 150% faster. Processes spend 70% of their time running in the CPU and 30% of their time waiting for disk service Speed up is ~ 22% Example
On a large system, suppose we can upgrade its disk drives for $7,000 to make them 150% faster. Processes spend 70% of their time running in the CPU and 30% of their time waiting for disk service. Or we could spend $10,000 to upgrade the CPU to be 50% faster…
…upgrade its cpu to run 50% faster. Processes spend 70% of their time running in the CPU and 30% of their time waiting for disk service f : fraction of time part is limiting factor k : speedup of that part 1 – f : fraction of time doing other stuff S : speed up Example
…upgrade its cpu to run 50% faster. Processes spend 70% of their time running in the CPU and 30% of their time waiting for disk service Speed up is ~ 30% Example
Choices Disks : 22% speedup for $7,000 ~ $318 per % CPU : 30% speedup for $10,000 ~ $333 per %
Non IO Protein String Matching Code 4 days execution time on current machine 20% of time doing integer instructions 35% percent of time doing I/O – Which is the better tradeoff? Compiler optimization that reduces number of integer instructions by 25% Hardware optimization that reduces the latency of each IO operations from 6us to 5us.
Non Hardware Reduce instructions by 25% = (1/.75) = 1.33 speedup 20% of time doing integer instructions 35% percent of time doing I/O
Non Hardware Reduce IO from 6us to 5us = (6/5) = 1.2 speedup 20% of time doing integer instructions 35% percent of time doing I/O
Non Hardware Reduce instructions by 25% Reduce IO from 6us to 5us = 20% speedup (6/5)
Limitations of Amdahl's Law Amdahl's Law doesn't take into account interactions – Speeding up one part of process may change the % of time it is limiting factor