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.

Slides:



Advertisements
Similar presentations
2.3 Modeling Real World Data with Matrices
Advertisements

Section 13-4: Matrix Multiplication
EECC756 - Shaaban #1 lec # 1 Spring Systolic Architectures Replace single processor with an array of regular processing elements Orchestrate.
Matrices A matrix is a rectangular array of quantities (numbers, expressions or function), arranged in m rows and n columns x 3y.
Parallel Matrix Operations using MPI CPS 5401 Fall 2014 Shirley Moore, Instructor November 3,
Matrix Multiplication To Multiply matrix A by matrix B: Multiply corresponding entries and then add the resulting products (1)(-1)+ (2)(3) Multiply each.
Maths for Computer Graphics
Multidimensional arrays Many problems require information be organized as a two- dimensional or multidimensional list Examples –Matrices –Graphical animation.
CSE 160/Berman Programming Paradigms and Algorithms W+A 3.1, 3.2, p. 178, 5.1, 5.3.3, Chapter 6, 9.2.8, , Kumar Berman, F., Wolski, R.,
Ch 7.2: Review of Matrices For theoretical and computation reasons, we review results of matrix theory in this section and the next. A matrix A is an m.
1 Matrix Addition, C = A + B Add corresponding elements of each matrix to form elements of result matrix. Given elements of A as a i,j and elements of.
Multiplying matrices An animated example. (3 x 3)x (3 x 2)= (3 x 2) These must be the same, otherwise multiplication cannot be done Is multiplication.
CSE 160/Berman Lecture 6 -- Programming Paradigms and Algorithms W+A 3.1, 3.2, p. 178, 5.1, 5.3.3, Chapter 6, 9.2.8, , Kumar
Fundamentals of matrices
CE 311 K - Introduction to Computer Methods Daene C. McKinney
Section 8.1 – Systems of Linear Equations
Chapter 7 Matrix Mathematics Matrix Operations Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Determinants 2 x 2 and 3 x 3 Matrices. Matrices A matrix is an array of numbers that are arranged in rows and columns. A matrix is “square” if it has.
Row 1 Row 2 Row 3 Row m Column 1Column 2Column 3 Column 4.
4.2 Operations with Matrices Scalar multiplication.
Chapter One Introduction to Pipelined Processors.
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 5-1 Two allocations of a 16X16 array to 16 processes: (a) 2-dimensional blocks;
By: Maureen Cop. A matrix is a rectangular array of numbers arranged by rows and columns. The numbers inside a matrix are called elements. The numbers.
How to Multiply Two Matrices. Steps for Matrix Multiplication 1.Determine whether the matrices are compatible. 2.Determine the dimensions of the product.
8.2 Operations With Matrices
Matrices: Simplifying Algebraic Expressions Combining Like Terms & Distributive Property.
Matrix Operations.
Sec 4.1 Matrices.
Copyright © Cengage Learning. All rights reserved. 2 SYSTEMS OF LINEAR EQUATIONS AND MATRICES.
Chapter 1 Section 1.5 Matrix Operations. Matrices A matrix (despite the glamour of the movie) is a collection of numbers arranged in a rectangle or an.
PARALLEL PROCESSING From Applications to Systems Gorana Bosic Veljko Milutinovic
Matrices and Matrix Operations. Matrices An m×n matrix A is a rectangular array of mn real numbers arranged in m horizontal rows and n vertical columns.
MATRIX A set of numbers arranged in rows and columns enclosed in round or square brackets is called a matrix. The order of a matrix gives the number of.
CS 450: COMPUTER GRAPHICS TRANSFORMATIONS SPRING 2015 DR. MICHAEL J. REALE.
Notes Over 4.2 Finding the Product of Two Matrices Find the product. If it is not defined, state the reason. To multiply matrices, the number of columns.
Precalculus Section 14.1 Add and subtract matrices Often a set of data is arranged in a table form A matrix is a rectangular.
Matrix Algebra Definitions Operations Matrix algebra is a means of making calculations upon arrays of numbers (or data). Most data sets are matrix-type.
Matrices. Variety of engineering problems lead to the need to solve systems of linear equations matrixcolumn vectors.
A rectangular array of numeric or algebraic quantities subject to mathematical operations. The regular formation of elements into columns and rows.
A very brief introduction to Matrix (Section 2.7) Definitions Some properties Basic matrix operations Zero-One (Boolean) matrices.
Matrices. Matrix A matrix is an ordered rectangular array of numbers. The entry in the i th row and j th column is denoted by a ij. Ex. 4 Columns 3 Rows.
13.4 Product of Two Matrices
Lesson 43: Working with Matrices: Multiplication
12-1 Organizing Data Using Matrices
Christmas Packets are due on Friday!!!
Matrices Rules & Operations.
Linear Algebra review (optional)
1.5 Matricies.
Matrix Operations.
Matrix Multiplication
Matrix Operations.
Multiplying Matrices.
WarmUp 2-3 on your calculator or on paper..
Parallel Matrix Operations
MATRICES MATRIX OPERATIONS.
Section 2.4 Matrices.
Multidimensional array
Multiplying Matrices.
Matrices.
Linear Algebra review (optional)
Matrix Addition, C = A + B Add corresponding elements of each matrix to form elements of result matrix. Given elements of A as ai,j and elements of B as.
1.8 Matrices.
What is the dimension of the matrix below?
Matrix A matrix is a rectangular arrangement of numbers in rows and columns Each number in a matrix is called an Element. The dimensions of a matrix are.
1.8 Matrices.
Multiplying Matrices.
Arrays and Matrices Prof. Abdul Hameed.
Multiplying Matrices.
Matrix Multiplication Sec. 4.2
Multiplying Matrices.
Presentation transcript:

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 column. Row x Column on respective PEs.

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.

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

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

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

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

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

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

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

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

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

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

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

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 a b41 b42 b43 b44 b31 b32 b33 b34 b21 b22 b23 b24 b11 b12 b13 b

Data Flow for Systolic MM Beat 1 Beat 2

Data Flow for Systolic MM Beat 3 Beat 4

Data Flow for Systolic MM Beat 5 Beat 6

Data Flow for Systolic MM Beat 7 Beat 8

Data Flow for Systolic MM Beat 9 Beats 10 and 11

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