Lecture 02-Amdahl's Law, Modern Hardware: ECE 459: Programming For Performance
Lecture 02-Amdahl's Law, Modern Hardware: ECE 459: Programming For Performance
Patrick Lam
University of Waterloo
January 7, 2015
2 / 13
3 / 13
Running times: 3.1s with good (or no) hint, 4.9s with bogus hint.
4 / 13
Limitations of Speedups
5 / 13
Formulation (1)
S: fraction of serial runtime in a serial execution.
P: fraction of parallel runtime in a serial execution.
Therefore, S + P = 1.
6 / 13
Formulation (1)
Runtime
S
P
P
P
P
7 / 13
Formulation (2)
Ts : time for the program to run in serial
N: number of processors/parallel executions
Tp : time for the program to run in parallel
Under perfect conditions, get N speedup for P
Tp = Ts (S + NP )
8 / 13
Formulation (3)
How much faster can we make the program?
speedup =
=
=
Ts
Tp
Ts
TS (S +
1
P
S+N
P
N)
9 / 13
Speedup
20
18
50% Parallel
70% Parallel
90% Parallel
95% Parallel
99% Parallel
100% Parallel
16
14
12
10
8
6
4
2
0
12
16
20
24
28
32
Number of processors
10 / 13
Amdahls Law
Replace S with (1 P):
speedup =
maximum speedup =
1
P
(1P)+ N
1
(1P) ,
since
P
N
11 / 13
12 / 13
We assume:
problem size is fixed (well see this soon);
program/algorithm behaves the same on 1
processor and on N processors; and
that we can accurately measure runtimes
i.e. that overheads dont matter.
13 / 13