Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống
1
/ 19 trang
THÔNG TIN TÀI LIỆU
Thông tin cơ bản
Định dạng
Số trang
19
Dung lượng
696,74 KB
Nội dung
om Si nh Vi en Zo ne C Speedup SinhVienZone.com Thoai Nam https://fb.com/sinhvienzonevn C ne Zo nh Vi en Speedup & Efficiency Amdahl’s Law Gustafson’s Law Sun & Ni’s Law Si om Outline SinhVienZone.com Khoa Khoa học Kỹ thuật Máy tính https://fb.com/sinhvienzonevn - ĐHBK TP.HCM Speedup: C S= 𝑇𝑠𝑒𝑞 𝑇𝑝𝑎𝑟 ne om Speedup & Efficiency E= 𝑆 𝑁 Si nh Vi en Zo - Tseq: Time(the most efficient sequential algorithm) - Tpar: Time(parallel algorithm) Efficiency: - with N is the number of processors SinhVienZone.com Khoa Khoa học Kỹ thuật Máy tính https://fb.com/sinhvienzonevn - ĐHBK TP.HCM The main objective is to produce the results as soon as possible C om Amdahl’s Law – Fixed Problem Size (1) Implications Zo ne – (ex) video compression, computer graphics, VLSI routing, etc Modified Amdahl’s law for fixed problem size including the overhead Si nh Vi en – Upper-bound is – Make Sequential bottleneck as small as possible – Optimize the common case SinhVienZone.com Khoa Khoa học Kỹ thuật Máy tính https://fb.com/sinhvienzonevn - ĐHBK TP.HCM om Amdahl’s Law – Fixed Problem Size (2) Parallel C Sequential Sequential T(1) Zo nh Vi en Sequential Parallel Tp ne Ts P0 P1 P2 P3 P4 P5 P6 P7 T(N) Number of processors Si Ts=T(1) Tp= (1-)T(1) T(N) = T(1)+ (1-)T(1)/N SinhVienZone.com Khoa Khoa học Kỹ thuật Máy tính https://fb.com/sinhvienzonevn - ĐHBK TP.HCM P8 P9 .C om Amdahl’s Law – Fixed Problem Size (3) nh Vi en Zo ne Time(1) Speedup Time( N ) Si T (1) 1 Speedup as N (1 )T (1) (1 ) T (1) N N SinhVienZone.com Khoa Khoa học Kỹ thuật Máy tính https://fb.com/sinhvienzonevn - ĐHBK TP.HCM ne C The overhead includes parallelism and interaction overheads om Enhanced Amdahl’s Law Si nh Vi en Zo T (1) Speedup as N (1 )T (1) Toverhead T (1) Toverhead N T (1) SinhVienZone.com Khoa Khoa học Kỹ thuật Máy tính https://fb.com/sinhvienzonevn - ĐHBK TP.HCM om Gustafson’s Law – Fixed Time (1) User wants more accurate results within a time limit – – – – – nh Vi en Properties of a work metric Easy to measure Architecture independent Easy to model with an analytical expression No additional experiment to measure the work The measure of work should scale linearly with sequential time complexity of the algorithm Si Zo ne C – Execution time is fixed as system scales – (ex) FEM (Finite element method) for structural analysis, FDM (Finite difference method) for fluid dynamics Time constrained seems to be most generally viable model! SinhVienZone.com Khoa Khoa học Kỹ thuật Máy tính https://fb.com/sinhvienzonevn - ĐHBK TP.HCM om Gustafson’s Law – Fixed Time (2) = Ws / W(N) W(N) = W(N) + (1-)W(N) W(1) = W(N) + (1-)W(N)*N C P9 ne Ws W0 Si W(N) Sequential P0 nh Vi en Sequential Zo Parallel Sequential P0 P1 P2 P3 P4 P5 P6 P7 P8 W(1) SinhVienZone.com Khoa Khoa học Kỹ thuật Máy tính https://fb.com/sinhvienzonevn - ĐHBK TP.HCM P9 om Gustafson’s Law – Fixed Time without overhead Zo ne C Time = Work * k W(N) = W Si nh Vi en T (1) W (1) * k W (1 NW Speedup (1 ) N T (N ) W (N ) * k W SinhVienZone.com Khoa Khoa học Kỹ thuật Máy tính https://fb.com/sinhvienzonevn - ĐHBK TP.HCM om Gustafson’s Law – Fixed Time with overhead ne Zo T (1) W (1) * k W (1 NW (1 N W0 T (N ) W (N ) * k W W0 1 W Si nh Vi en Speedup C W(N) = W + W0 SinhVienZone.com Khoa Khoa học Kỹ thuật Máy tính https://fb.com/sinhvienzonevn - ĐHBK TP.HCM Scale the largest possible solution limited by the memory space Or, fix memory usage per processor Speedup nh Vi en – Time(1)/Time(N) for scaled up problem is not appropriate – For simple profile, and G(N) is the increase of parallel workload as the memory capacity increases N times Si Zo ne C om Sun and Ni’s Law – Fixed Memory (1) SinhVienZone.com Khoa Khoa học Kỹ thuật Máy tính https://fb.com/sinhvienzonevn - ĐHBK TP.HCM Sun and Ni’s Law – Fixed Memory (2) om C ne Zo – the increased memory N*M – The scaled work: W = W+(1- )W*G(N) nh Vi en W = W+(1- )W Let M be the memory capacity of a single node N nodes: Speedup MC Si SinhVienZone.com (1 )G ( N ) G( N ) (1 ) N Khoa Khoa học Kỹ thuật Máy tính https://fb.com/sinhvienzonevn - ĐHBK TP.HCM om Sun and Ni’s Law – Fixed Memory (3) Definition: ne C A function g is homomorphism if there exists a function such that g for any real number c and variable x, nh Vi en Theorem: If W = g (M ) for some homomorphism function g, then with all data being shared by all available processors, the simplified memory-bounced speedup is Si Zo g (cx) g (c) * g ( x) W1 g ( N )WN (1 )G ( N ) S g (N ) G( N ) W1 WN (1 ) N N * N SinhVienZone.com Khoa Khoa học Kỹ thuật Máy tính https://fb.com/sinhvienzonevn - ĐHBK TP.HCM om Sun and Ni’s Law – Fixed Memory (4) Proof: * * W W W1 g ( N )WN * N SN * WN W g ( N ) W * W1 N N N Si nh Vi en Zo ne C Let the memory requirement of Wn be M, Wn = g (M ) M is the memory requirement when node is available With N nodes available, the memory capacity will increase to N*M Using all of the available memory, for the scaled parallel * portion WN : WN* g ( N * M ) g ( N ) * g (M ) g ( N ) *WN SinhVienZone.com Khoa Khoa học Kỹ thuật Máy tính https://fb.com/sinhvienzonevn - ĐHBK TP.HCM om Speedup W1 G ( N )WN S G( N ) W1 WN N Zo ne C * N Si nh Vi en – When the problem size is independent of the system, the problem size is fixed, G(N)=1 Amdahl’s Law – When memory is increased N times, the workload also increases N times, G(N)=N Gustafson’s Law – For most of the scientific and engineering applications, the computation requirement increases faster than the memory requirement, G(N)>N SinhVienZone.com Khoa Khoa học Kỹ thuật Máy tính https://fb.com/sinhvienzonevn - ĐHBK TP.HCM om Examples C 10 ne S(Linear) S(Normal) Zo 10 Si nh Vi en Speedup Processors SinhVienZone.com Khoa Khoa học Kỹ thuật Máy tính https://fb.com/sinhvienzonevn - ĐHBK TP.HCM Parallelizing a code does not always result in a speedup; sometimes it actually slows the code down! This can be due to a poor choice of algorithm or to poor coding The best possible speedup is linear, i.e it is proportional to the number of processors: T(N) = T(1)/N where N = number of processors, T(1) = time for serial run A code that continues to speed up reasonably close to linearly as the number of processors increases is said to be scalable Many codes scale up to some number of processors but adding more processors then brings no improvement Very few, if any, codes are indefinitely scalable Zo nh Vi en Si ne C om Scalability SinhVienZone.com Khoa Khoa học Kỹ thuật Máy tính https://fb.com/sinhvienzonevn - ĐHBK TP.HCM om Factors That Limit Speedup Software overhead Load balancing Communication overhead Si nh Vi en Zo ne C Even with a completely equivalent algorithm, software overhead arises in the concurrent implementation (e.g there may be additional index calculations necessitated by the manner in which data are "split up" among processors.) i.e there is generally more lines of code to be executed in the parallel program than the sequential program SinhVienZone.com Khoa Khoa học Kỹ thuật Máy tính https://fb.com/sinhvienzonevn - ĐHBK TP.HCM ... Vi en Speedup & Efficiency Amdahl’s Law Gustafson’s Law Sun & Ni’s Law Si om Outline SinhVienZone. com Khoa Khoa học Kỹ thuật Máy tính https://fb .com/ sinhvienzonevn - ĐHBK TP.HCM Speedup: ... 10 Si nh Vi en Speedup Processors SinhVienZone. com Khoa Khoa học Kỹ thuật Máy tính https://fb .com/ sinhvienzonevn - ĐHBK TP.HCM Parallelizing a code does not always result in a speedup; sometimes... om Scalability SinhVienZone. com Khoa Khoa học Kỹ thuật Máy tính https://fb .com/ sinhvienzonevn - ĐHBK TP.HCM om Factors That Limit Speedup Software overhead Load balancing Communication overhead