Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Lecture 5: Part 1 Performance Laws: Speedup and Scalability.

Similar presentations


Presentation on theme: "1 Lecture 5: Part 1 Performance Laws: Speedup and Scalability."— Presentation transcript:

1

2 1 Lecture 5: Part 1 Performance Laws: Speedup and Scalability

3 2 Sequential Execution Time Execution time = Seconds = Instructions x Cycles x Seconds (T e ) Program Program Instruction Cycle Execution time = Seconds = Instructions x Cycles x Seconds (T e ) Program Program Instruction Cycle 500 MHz CPU: 500 x 10 6 clock cycles/sec My program consists of operations: addition: 500 x 10 6 (1 cycle per inst) mul: 180 x 10 6 (3 cycles/inst) div: 120 x 10 6 (2 cycles/inst) data move: 300 x 10 6 (1 cycle/inst) Expected execution time: 2 ns x (500x1+180x3+120x2+300x1)x 10 6

4 3 Basic Performance Metrics n MIPS = (instructions/second)x 10 -6 n MFLOPS = (floating point ops/second)x 10 -6 n CPI = Average cycles per instruction n Throughput: number of results per second n Workload: W, number of Ops. required to complete the program n Speed: W/T E n Speedup (S)= T e / T improve n Efficiency (using P processors) = Speedup / P

5 4 Part I: Speedup

6 5 Speedup n General concepts of Speedup in parallel computing: l How much faster an application runs on parallel computer ? l What benefits derive from the use of parallelism? n General agreement : speedup = serial time/parallel time

7 6 Speedup n Fixed-Workload Speedup (Amdahl’s Law) n Fixed-Time Speedup (Gustafson’s Law) n Fixed-Memory Speedup (Sun and Ni)

8 7 Amdahl's Law Speedup due to enhancement E: ExTime w/o E Speedup(E) = ------------- ExTime w/ E Suppose that enhancement E accelerates a fraction F of the task by a factor S, and the remainder of the task is unaffected ExTime: execution time 1/S F F/S

9 8 Amdahl’s Law ExTime new = ExTime old x (1 - Fraction enhanced ) + Fraction enhanced Speedup overall = ExTime old ExTime new Speedup enhanced = 1 (1 - Fraction enhanced ) + Fraction enhanced Speedup enhanced

10 9 Amdahl’s Law n Floating point instructions improved to run 2X; but only 10% of actual instructions are FP Speedup overall = ExTime new =

11 10 Amdahl’s Law n Floating point instructions improved to run 2X; but only 10% of actual instructions are FP Speedup overall = 1 0.95 =1.053 ExTime new = ExTime old x (0.9 +.1/2) = 0.95 x ExTime old

12 11 Amdahl’s Law n Some applications need real-time response n Amdahl’s law shows the upper bound of the achievable speedup for a given problem size. n Limit on the achievable speedup: l W: total workload l  of W must be executed sequentially n S p = W / (  W+(1-  )(W/P)) = P / (1+(P-1)  )  1 /  as P  

13 12 Fixed-Time Speedup n Gustafson’s Law (1988) n Scaling the problem size along with the increase of machine size within the same execution time n Scaling for higher accuracy n Parameters: l W: workload done by a single node l W’ =  W+(1-  )WP = work done by P nodes n S p = (  W+(1-  )WP) / W =  +(1-  )P  Speedup is linear function of P

14 13 Fixed-Memory Speedup Sun and Ni’s Law : Memory bounding (1993) n To solve the largest possible problem, limited only by the available memory space. n As P increases, use up all the increased memory by scaling the problem size also n See Kai’s book (Section 3.6.3)

15 14 More on Speedup n Can you measure the sequential time? l What if the memory is too small ? n Is the sequential machine using the same processor as the one in parallel machine ? n Can the sequential time be shorter than the parallel time ? n Is speedup really important ? Or only the execution time is important ?

16 15 More on Speedup n Speedup larger than “P” (Superlinear) ? l What if the disk swapping effects happen in sequential execution? l More caches/memory used in the parallel machines (PxC, PxM) n Both sequential and parallel machines use the same OS/compiler ? n Is the data distribution/collection time included in the parallel time? l Some parallel machines provide parallel I/O !!

17 16 More on Speedup n What if we use different algorithms for sequential and parallel solutions l Take a look at the parallel sorting assignment. What is the maximum speedup for parallel sorting?

18 17 Definitions of Speedup n Diverse definitions of serial and parallel execution times [Sahni:1996] l Relative l Real l Absolute l Asymptotic l Asymptotic relative

19 18 Parameters Used in Speedup Definitions I = problem instance P = number of processors Q = parallel program n = size of I

20 19 Relative Speedup n serial time : execution time of the parallel program on a single node of the parallel computer. (mpirun -np 1) Relative speedup ( I,P ) = time to solve I using program Q and 1 processor ÷ time to solve I using Q program and P processors

21 20 Relative Speedup Depends on the characteristics of the instance I being solved as well as the size P of the parallel computer n Same OS, same node architecture, using same compiler n Extra overheads in serial time (distribution/collection).

22 21 Real Speedup n Parallel time vs. the fastest serial algorithm or program running on a single node of the parallel computer Real speedup ( I,P ) = time to solve I using best serial program and 1 processor ÷ time to solve I using Q program and P processors

23 22 Problems on Real Speedup The fastest algorithm might not be known. n No single algorithm might be fastest in all instances for some applications n In practice, we use the runtime of the most frequently used sequential algorithm.

24 23 Absolute Speedup n Parallel time vs. the fastest sequential algorithm run on the fastest serial computer Absolute speedup ( I,P ) = time to solve I using best serial program and 1 fastest processor ÷ time to solve I using Q program and P processors

25 24 Absolute Speedup n Can also use the sequential algorithm most often used in practice. Time-variant : researchers keep designing new algorithms n Speedup could be less than 1

26 25 Asymptotic Real Speedup n Compares the execution time of the best serial algorithm for a particular problem with the asymptotic complexity of the parallel algorithm n Assuming the the parallel computer has all the processors it can use

27 26 Asymptotic Real Speedup Asymptotic real speedup ( n ) = asymptotic complexity of best serial algorithm ÷ asymptotic complexity of Q using as many processors as needed

28 27 Asymptotic Real Speedup For problem such as sorting where the asymptotic complexity is not uniquely characterized by the instance size n, the worst-case complexity is used -- O(n 2 ), O(n log n) n Unbounded number of processors.

29 28 Asymptotic Relative Speedup n Uses the asymptotic time complexity of the parallel algorithm when run on a single processor. Asymptotic relative speedup = asymptotic complexity of Q using 1 processor ÷ asymptotic complexity of Q using as many processors as needed

30 29 n Matrix Multiplication (n X n) l Serial time: O(n 3 ) l Parallel time (on n 3 /log n processors hypercube): O(log n) time l Asymptotic Relative Speedup: O(n 3 /log n) n Others are measured Speedup l Relative l Real l Absolute Asymptotic Relative Speedup

31 30 Part II: Scalability

32 31 Scalability n Algorithmic Scalability: l the available parallelism increases at least linearly with problem size. n Architectural (Size) Scalability: l the architecture continues to yield the same performance per processor, as the number of processors is increased and as the problem size is increased.

33 32 Architectural Scalability Architectural scalability Interconnection Network: latency/bandwidth I/O performance OS support (lock, processes synchronization overheads) Processor Speed No. of issues, depth of pipelining Memory Subsystem: cache/memory speed Performance grows in all aspects

34 33 Discussion of Architectural Scalability: bus-based SMPs n Bus (single set of wires) : fixed bandwidth shared by all processors (P) l Bandwidth accessible by each processor decreases as P increases n Physical constraints: fixed number of slots n Electrical constraints: l bus loading, wire length determine frequency l power n Cost scaling: X (bus is the core) n OS scaling : scheduling, locking, I/O

35 34 Scalable Interconnection Network n Bandwidth (P)? n Latency (P)? n Cost (P)? n More bandwidth, smaller L  greater cost l SGI XL: 1.5 M HK$ (1.2 GB/s) l ALR SMP: 0.1 M HK$ (533 MB/s) Network (bus ? multistage, mesh, torus) PE

36 35 Bottom Line n There is NO “truly scalable” machine n Goal is to design for a given “range of scale” l one (instruction level) l two to tens (SMP): F Top-end: Sun Enterprise 1000 : 64 processors, COMPACQ 64 Alpha processors l tens to a few thousands (Distributed-Memory Multicomputers: T3E, SP2, Paragon,...) l tens of thousands (ASCI machines: cluster of SMPs) n Techniques at one scale may not be cost effect at another

37 36 Bottom Line n Even though we can meet the engineering requirements to physically scale over the range of interest, we must ensure that the communication and synchronization operations required to support target programming models also scale and are cost effective.


Download ppt "1 Lecture 5: Part 1 Performance Laws: Speedup and Scalability."

Similar presentations


Ads by Google