Presentation is loading. Please wait.

Presentation is loading. Please wait.

Examples of Two- Dimensional Systolic Arrays. Obvious Matrix Multiply Rows of a distributed to each PE in row. Columns of b distributed to each PE in.

Similar presentations


Presentation on theme: "Examples of Two- Dimensional Systolic Arrays. Obvious Matrix Multiply Rows of a distributed to each PE in row. Columns of b distributed to each PE in."— Presentation transcript:

1 Examples of Two- Dimensional Systolic Arrays

2 Obvious Matrix Multiply Rows of a distributed to each PE in row. Columns of b distributed to each PE in column. Row x Column on respective PEs.

3 Systolic Matrix Multiplication Processors are arranged in a 2-D grid. Each processor accumulates one element of the product. The elements of the matrices to be multiplied are “pumped through” the array.

4 Multiplication Here the matrix B is Transposed! Each PE function is to first multiply and then add. PE ij  C ij PE A 1n ……A 12 A 11 … A 22 A 21 …..A 31 A n1 B 11 B 12 B 21 B 13 B 22 B 31 B n1 Sqewing inputs

5 Systolic Matrix Multiplication Illustrated with two 3x3 matrices a 0,2 a 0,1 a 0,0 a 1,2 a 1,1 a 1,0 a 2,2 a 2,1 a 2,0 alignments in time b 2,0 b 1,0 b 0,0 b 2,1 b 1,1 b 0,1 b 2,2 b 1,2 b 0,2 rows of a columns of b

6 Systolic Matrix Multiplication Illustrated with two 3x3 matrices a 0,2 a 0,1 a 1,2 a 1,1 a 1,0 a 2,2 a 2,1 a 2,0 alignments in time b 2,0 b 1,0 b 2,1 b 1,1 b 0,1 b 2,2 b 1,2 b 0,2 a 0,0 *b 0,0 a 0,0 b 0,0

7 Systolic Matrix Multiplication Illustrated with two 3x3 matrices a 0,2 a 1,2 a 1,1 a 2,2 a 2,1 a 2,0 alignments in time b 2,0 b 2,1 b 1,1 b 2,2 b 1,2 b 0,2 a 0,0 *b 0,0 +a 0,1 *b 1,0 a 1,0 *b 0,0 a 0,0 *b 0,1 a 0,0 b 0,0 a 0,1 b 1,0 b 0,1 a 1,0

8 Systolic Matrix Multiplication Illustrated with two 3x3 matrices a 1,2 a 2,2 a 2,1 b 2,1 b 2,2 b 1,2 a 0,0 *b 0,0 +a 0,1 *b 1,0 +a 0,2 *b 2,0 a 1,0 *b 0,0 +a 1,1 *b 1,0 a 0,0 *b 0,1 +a 0,1 *b 1,1 a 0,0 *b 0,2 a 2,0 *b 0,0 a 1,0 *b 0,1 b 1,0 b 0,1 a 0,0 a 0,1 a 1,0 a 0,2 b 0,0 b 2,0 b 1,1 b 1,0 a 1,1 a 2,0

9 Systolic Matrix Multiplication Illustrated with two 3x3 matrices a 2,2 b 2,2 a 0,0 *b 0,0 +a 0,1 *b 1,0 +a 0,2 *b 2,0 a 1,0 *b 0,0 +a 1,1 *b 1,0 +a 1,2 *b 2,0 a 0,0 *b 0,1 +a 0,1 *b 1,1 +a 0,2 *b 2,1 a 0,0 *b 0,2 +a 0,1 *b 1,2 a 2,0 *b 0,0 a 2,1 *b 1,0 a 1,0 *b 0,1 +a 1,1 *b 1,1 b 1,0 b 0,1 b 2,0 b 1,1 b 1,0 b 2,1 b 1,2 a 0,1 a 1,0 a 0,2 a 1,1 a 2,0 a 2,0 *b 0,1 a 1,0 *b 0,2 a 2,1 a 1,2

10 Systolic Matrix Multiplication Illustrated with two 3x3 matrices a 0,0 *b 0,0 +a 0,1 *b 1,0 +a 0,2 *b 2,0 a 1,0 *b 0,0 +a 1,1 *b 1,0 +a 1,2 *b 2,0 a 0,0 *b 0,1 +a 0,1 *b 1,1 +a 0,2 *b 2,1 a 0,0 *b 0,2 +a 0,1 *b 1,2 +a 0,2 *b 2,2 a 2,0 *b 0,0 +a 2,1 *b 1,0 +a 2,2 *b 2,0 a 1,0 *b 0,1 +a 1,1 *b 1,1 +a 1,2 *b 2,1 b 2,0 b 1,1 b 1,0 b 2,1 a 0,2 a 1,1 a 2,0 a 2,0 *b 0,1 +a 2,1 *b 1,1 a 1,0 *b 0,2 +a 1,1 *b 1,2 b 1,2 b 2,2 a 2,1 a 2,2 a 2,0 *b 1,0 a 1,2

11 Systolic Matrix Multiplication Illustrated with two 3x3 matrices a 0,0 *b 0,0 +a 0,1 *b 1,0 +a 0,2 *b 2,0 a 1,0 *b 0,0 +a 1,1 *b 1,0 +a 1,2 *b 2,0 a 0,0 *b 0,1 +a 0,1 *b 1,1 +a 0,2 *b 2,1 a 0,0 *b 0,2 +a 0,1 *b 1,2 a 2,0 *b 0,0 +a 2,1 *b 1,0 +a 2,2 *b 2,0 a 1,0 *b 0,1 +a 1,1 *b 1,1 +a 1,2 *b 2,1 b 2,1 a 2,0 *b 0,1 +a 2,1 *b 1,1 +a 2,2 *b 2,1 a 1,0 *b 0,2 +a 1,1 *b 1,2 +a 1,2 *b 2,2 b 1,2 b 2,2 a 2,1 a 2,2 a 2,0 *b 1,0 +a 2,0 *b 1,1 a 1,2 a 0,0 *b 0,2 +a 0,1 *b 1,2 +a 0,2 *b 2,2

12 Systolic Matrix Multiplication Illustrated with two 3x3 matrices a 0,0 *b 0,0 +a 0,1 *b 1,0 +a 0,2 *b 2,0 a 1,0 *b 0,0 +a 1,1 *b 1,0 +a 1,2 *b 2,0 a 0,0 *b 0,1 +a 0,1 *b 1,1 +a 0,2 *b 2,1 a 0,0 *b 0,2 +a 0,1 *b 1,2 a 2,0 *b 0,0 +a 2,1 *b 1,0 +a 2,2 *b 2,0 a 1,0 *b 0,1 +a 1,1 *b 1,1 +a 1,2 *b 2,1 a 2,0 *b 0,1 +a 2,1 *b 1,1 +a 2,2 *b 2,1 a 1,0 *b 0,2 +a 1,1 *b 1,2 +a 1,2 *b 2,2 b 2,2 a 2,2 a 2,0 *b 1,0 +a 2,0 *b 1,1 +a 2,2 *b 2,2 a 0,0 *b 0,2 +a 0,1 *b 1,2 +a 0,2 *b 2,2

13 Systolic Algorithm for Matrix Multiplication: another visualization is very useful Problem: multiply two nxn matrices A ={a_ij} and B={b_ij}. Product matrix will be R={r_ij}. Systolic solution uses 2D array with NxN cells, 2 input streams and 2 output streams

14 Operation at each cell Each cell updates at each time step as shown below initialized to 0

15 Systolic Matrix Multiplication P34 P31 P32 P33 P44 P41 P42 P43 P14 P11 P12 P13 P24 P21 P22 P23 a44 a34 a24 a14====== a43 a33 a23 a13==== a42 a32 a22 a12=== a41 a31 a21 a11 -- -- -- -- b41 b42 b43 b44 b31 b32 b33 b34 b21 b22 b23 b24 b11 b12 b13 b14 -- -- -- -- -- ------

16 Data Flow for Systolic MM Beat 1 Beat 2

17 Data Flow for Systolic MM Beat 3 Beat 4

18 Data Flow for Systolic MM Beat 5 Beat 6

19 Data Flow for Systolic MM Beat 7 Beat 8

20 Data Flow for Systolic MM Beat 9 Beats 10 and 11

21 Programming Issues Performance of systolic algorithms based on fine granularity (1 update about the same as a communication) and regular dataflow –Can be done on asynchronous platforms with tagging but must ensure that idle time does not dominate computation Many systolic algorithms do not map well to more general MIMD or distributed platforms


Download ppt "Examples of Two- Dimensional Systolic Arrays. Obvious Matrix Multiply Rows of a distributed to each PE in row. Columns of b distributed to each PE in."

Similar presentations


Ads by Google