Amdahl's Law
𝑆𝑝𝑒𝑒𝑑𝑢𝑝= 𝑂𝑙𝑑 𝑇𝑖𝑚𝑒 𝑁𝑒𝑤 𝑇𝑖𝑚𝑒 Speed up 𝑆𝑝𝑒𝑒𝑑𝑢𝑝= 𝑂𝑙𝑑 𝑇𝑖𝑚𝑒 𝑁𝑒𝑤 𝑇𝑖𝑚𝑒 A program used to take 20 minutes to run. Now it takes 15. What is the speedup? 1.33 times or 33% 𝑆𝑝𝑒𝑒𝑑𝑢𝑝= 20 15 =1.33
Gene Amdahl
Amdahl's Law Describes overall speedup of a system when we speed up one part of a system 𝑆= 1 1−𝑓 + 𝑓 𝑘
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 𝑆= 1 1−𝑓 + 𝑓 𝑘
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 1−𝑓 + 𝑓 𝑘
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 𝑆= 1 1−𝑓 + 𝑓 𝑘
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 𝑆= 1 1−𝑓 + 𝑓 𝑘
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?
Example 𝑆= 1 1−𝑓 + 𝑓 𝑘 f : fraction of time part is limiting factor …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 𝑆= 1 1−𝑓 + 𝑓 𝑘
Example 𝑆= 1 1−.30 + .30 2.50 150% increase on 100% = 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 f : fraction of time part is limiting factor k : speedup of that part 1 – f : fraction of time doing other stuff S : speed up 𝑆= 1 1−.30 + .30 2.50 150% increase on 100% = 250%
Example 𝑆= 1 .70+.12 𝑆= 1 .82 𝑆=1. 21951 Speed up is ~ 22% …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% 𝑆= 1 .70+.12 𝑆= 1 .82 𝑆=1. 21951
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…
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 f : fraction of time part is limiting factor k : speedup of that part 1 – f : fraction of time doing other stuff S : speed up 𝑆= 1 1−.70 + .70 1.50
Example 𝑆= 1 .30+.46 6 𝑆= 1 .76 6 𝑆=1.304 Speed up is ~ 30% …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% 𝑆= 1 .30+.46 6 𝑆= 1 .76 6 𝑆=1.304
Choices Disks : 22% speedup for $7,000 ~ $318 per % CPU : 30% speedup for $10,000 ~ $333 per %
Non IO Protein String Matching Code Which is the better tradeoff? 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 IO Reduce instructions by 25% = 33% speedup (1/.75) Reduce IO from 6us to 5us = 20% speedup (6/5) 𝑆= 1 1−.20 + .20 1.333 𝑆= 1 1−.35 + .35 1.20 𝑆= 1.0526 𝑆= 1.0619
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