Increase bandwidth at (often times) the cost of increased Latency. There are problems that are very easy to parallelize, but there is often some sort of overhead. There are problems that are “inherently sequential” (if an iteration’s execution depends directly on the previous execution). There’s also always going to be some cognitive overhead writing parallel code (partial ordering etc).
Parallelism can lead to data race (which is solved with primatives, but when too constrained can lead to deadlock.
Amdahl’s Law
In 1967 Gene Amdahl argued that improvements in processor design for single processors would be more effective than designing multi-processor systems.
Assumptions:
- Problem size is fixed
- The program or the underlying implementation behaves the same on 1 vs N processors
- We can accurately measure runtimes and overhead doesn’t matter
Where:
- : Parallel time
- : Total time in single processor system
- : Serial part
- : Parallelizable part
Here, as N increases, is dominated by S, limiting potential speedups
We can also define max speedup as Where as P increases, we can get up to an 18x speedup. We can use this information to figure out our runtimes relative to how many processors we have.
To empirically estimate parallel speedup: .
If we generalize Amdahl’s law, lets have:
- which is the fraction of time in part n
- which is the speedup for part n
Then: .