Hierarchical Design of Parallel Architectures for Signal Processing

  • Slides: 60
Download presentation
Hierarchical Design of Parallel Architectures for Signal Processing Applications Patrice Quinton, Tanguy Risset IRISA

Hierarchical Design of Parallel Architectures for Signal Processing Applications Patrice Quinton, Tanguy Risset IRISA - COSI http: //www. irisa. fr/cosi/ALPHA July 2001 Samos - 2001

Outline § § § What is MMAlpha? Example of design flow The Alpha language

Outline § § § What is MMAlpha? Example of design flow The Alpha language Structured scheduling Performance Conclusion July 2001 Samos - 2001 2

What is MMAlpha? § A public domain silicon compiler for loop nests FPGA for

What is MMAlpha? § A public domain silicon compiler for loop nests FPGA for i = 1 to n do for k = 1 to m do y[i, k] = y[i, k-1] + w[i, k]*x[i-k] July 2001 ASIC VHDL Samos - 2001 3

What is MMAlpha? Alpha Uniformization Scheduling/Mapping HDL derivation Vhdl 1 Vhdl 2 Vhdl 3

What is MMAlpha? Alpha Uniformization Scheduling/Mapping HDL derivation Vhdl 1 Vhdl 2 Vhdl 3 July 2001 Samos - 2001 4 MMAlpha § User controlled design process § Design script easily reused

Target applications § Fir § Adaptive LMS § Kalman filtering § Data intensive applications

Target applications § Fir § Adaptive LMS § Kalman filtering § Data intensive applications § Signal processing § Motion estimators § 2 D-filters § Multimedia § Bio-Informatics § DNA sequencing July 2001 Samos - 2001 5

MMAlpha highlights § Compilation of loop nests to parallel circuits for i = 1

MMAlpha highlights § Compilation of loop nests to parallel circuits for i = 1 to n do for k = 1 to m do y[i, k] = y[i, k-1] + w[i, k]*x[i-k] § by means of the polyhedral model July 2001 Samos - 2001 6

MMAlpha highlights § Semi-automatic design space exploration Alpha Scheduling/Mapping 1 Scheduling/Mapping 2 HDL derivation

MMAlpha highlights § Semi-automatic design space exploration Alpha Scheduling/Mapping 1 Scheduling/Mapping 2 HDL derivation July 2001 Samos - 2001 7 MMAlpha Uniformization

MMAlpha highlights Alpha Uniformization Scheduling/Mapping HDL derivation July 2001 Samos - 2001 8 MMAlpha

MMAlpha highlights Alpha Uniformization Scheduling/Mapping HDL derivation July 2001 Samos - 2001 8 MMAlpha § Hierarchical design methodology

MMAlpha highlights § Multi-target output for codesign for i = 1 to n do

MMAlpha highlights § Multi-target output for codesign for i = 1 to n do for k = 1 to m do y[i, k] = y[i, k-1] + w[i, k]*x[i-k] July 2001 VHDL C Samos - 2001 9

Outline § § § What is MMAlpha? Example of design flow The Alpha language

Outline § § § What is MMAlpha? Example of design flow The Alpha language Structured scheduling Performance Conclusion July 2001 Samos - 2001 10

The algorithm July 2001 Samos - 2001 11

The algorithm July 2001 Samos - 2001 11

The algorithm Alignment matrix July 2001 Samos - 2001 12

The algorithm Alignment matrix July 2001 Samos - 2001 12

Equations Recurrence for one point of the matrix July 2001 Samos - 2001 13

Equations Recurrence for one point of the matrix July 2001 Samos - 2001 13

Iteration space July 2001 Samos - 2001 14

Iteration space July 2001 Samos - 2001 14

Uniformization July 2001 Samos - 2001 15

Uniformization July 2001 Samos - 2001 15

Uniformization July 2001 Samos - 2001 16

Uniformization July 2001 Samos - 2001 16

Scheduling July 2001 Samos - 2001 17

Scheduling July 2001 Samos - 2001 17

Mapping July 2001 Samos - 2001 18

Mapping July 2001 Samos - 2001 18

Architecture July 2001 Samos - 2001 19

Architecture July 2001 Samos - 2001 19

Architecture July 2001 Samos - 2001 20

Architecture July 2001 Samos - 2001 20

Control July 2001 Samos - 2001 21

Control July 2001 Samos - 2001 21

Control July 2001 Samos - 2001 22

Control July 2001 Samos - 2001 22

Outline § § § What is MMAlpha? Example of design flow The Alpha language

Outline § § § What is MMAlpha? Example of design flow The Alpha language Structured scheduling Performance Conclusion July 2001 Samos - 2001 23

Alpha code for dot product system dot: {N|1<=N} (a, b: {k|1<=k<=N} of integer) returns

Alpha code for dot product system dot: {N|1<=N} (a, b: {k|1<=k<=N} of integer) returns (c: integer); k var Acc: {k|0<=k<=N} of integer; c a(4) a(3) a(2) a(1) b(4) b(3) b(2) b(1) 0 let Acc[k] = case {|k=0}: 0[]; {|k>0}: Acc[k-1]+a[k]*b[k]; esac; c[]=Acc[N]; tel; July 2001 Samos - 2001 24

Matrix product using dot product k A(1, 1, 4) A(1, 1, 3) j c[1,

Matrix product using dot product k A(1, 1, 4) A(1, 1, 3) j c[1, 1] A(1, 1, 2) A(1, 1, 1) B(1, 1, 4) B(1, 1, 3) B(1, 1, 2) B(1, 1, 1) i 0 {i, j, k|1<=i, j, k<=N}: A[i, j, k] = A[i, j-1, k-1]; {i, j, k|1<=i, j, k<=N}: B[i, j, k] = B[i-1, j, k-1]; use {i, j|1<=i<=N} dot[N](A, B) returns (C); July 2001 Samos - 2001 25

Outline § § § What is MMAlpha? Example of design flow The Alpha language

Outline § § § What is MMAlpha? Example of design flow The Alpha language Structured scheduling Performance Conclusion July 2001 Samos - 2001 26

Classical linear schedule in MMAlpha design flow Duration 1 4 2 6 10 14

Classical linear schedule in MMAlpha design flow Duration 1 4 2 6 10 14 July 2001 Samos - 2001 27

Classical linear schedule in MMAlpha design flow 2 6 C D 1 A 1

Classical linear schedule in MMAlpha design flow 2 6 C D 1 A 1 July 2001 1 0 2 B 4 2 1 0 F 14 Samos - 2001 0 28 E 10

Classical linear schedule in MMAlpha design flow schedule[ schedule. Type -> same. Linear. Part,

Classical linear schedule in MMAlpha design flow schedule[ schedule. Type -> same. Linear. Part, durations -> {0, 0, 1, 4, 2, 6, 10, 14, 0, 0}, add. Constraints -> {/* linear constraints */} ] July 2001 Samos - 2001 29

Multi-dimensional scheduling § Virtual clock counter is a vector (hours, minutes, …. ) N

Multi-dimensional scheduling § Virtual clock counter is a vector (hours, minutes, …. ) N t 2 N July 2001 t 1 Samos - 2001 30

Multi-dimensional scheduling § Useful for • Fast prototyping of parallelism in complex applications ØSVD

Multi-dimensional scheduling § Useful for • Fast prototyping of parallelism in complex applications ØSVD (S. Robert, 1997) ØKalman filtering (A. Mozipo, 1998) • Efficient code generation ØQuilleré 1999 • Structured scheduling July 2001 Samos - 2001 31

Extension to structured scheduling § Structured systems of recurrence equations (Dinechin 97) § Example:

Extension to structured scheduling § Structured systems of recurrence equations (Dinechin 97) § Example: • matrix product can be expressed as N 2 independent dot products. § Question: • Provided we have a layout for the dot product, can we use it for matrix product? July 2001 Samos - 2001 32

Example: Matrix-Matrix product {i, j, k|1<=i, j, k<=N}: A[i, j, k] = A[i, j-1,

Example: Matrix-Matrix product {i, j, k|1<=i, j, k<=N}: A[i, j, k] = A[i, j-1, k-1]; {i, j, k|1<=i, j, k<=N}: B[i, j, k] = B[i-1, j, k-1]; {i, j, k|1<=i, j, k<=N}: C[i, j, k] = C[i, j, k-1]*A[i, j, k]*B[i, j, k]; {i, j|1<=i, j<=N}: c[i, j] = C[i, j, N]; July 2001 Samos - 2001 33

Example: Matrix-Matrix product k j c[1, 1] A(1, 1, 4) B(1, 1, 4) A(1,

Example: Matrix-Matrix product k j c[1, 1] A(1, 1, 4) B(1, 1, 4) A(1, 1, 3) B(1, 1, 3) A(1, 1, 2) B(1, 1, 2) A(1, 1, 1) B(1, 1, 1) i 0 July 2001 Samos - 2001 34

Alpha code for dot product system dot: {N|1<=N} (a, b: {k|1<=k<=N} of integer) returns

Alpha code for dot product system dot: {N|1<=N} (a, b: {k|1<=k<=N} of integer) returns (c: integer); k var Acc: {k|0<=k<=N} of integer; c a(4) a(3) a(2) a(1) b(4) b(3) b(2) b(1) 0 let Acc[k] = case {|k=0}: 0[]; {|k>0}: Acc[k-1]+a[k]*b[k]; esac; c[]=Acc[N]; tel; July 2001 Samos - 2001 35

Matrix product using dot product k A(1, 1, 4) A(1, 1, 3) j c[1,

Matrix product using dot product k A(1, 1, 4) A(1, 1, 3) j c[1, 1] A(1, 1, 2) A(1, 1, 1) B(1, 1, 4) B(1, 1, 3) B(1, 1, 2) B(1, 1, 1) i 0 {i, j, k|1<=i, j, k<=N}: A[i, j, k] = A[i, j-1, k-1]; {i, j, k|1<=i, j, k<=N}: B[i, j, k] = B[i-1, j, k-1]; use {i, j|1<=i<=N} dot[N](A, B) returns (C); July 2001 Samos - 2001 36

Structured dependence graph DG: A SDG: B ACC C July 2001 C Samos -

Structured dependence graph DG: A SDG: B ACC C July 2001 C Samos - 2001 37

What is a structured scheduling? § Schedule each computations such that • dependencies are

What is a structured scheduling? § Schedule each computations such that • dependencies are respected • Timing functions are positive § All instances of a given subsystem refer to the same schedule § Schedule is built from the structured dependence graph. July 2001 Samos - 2001 38

Necessary form of a structured scheduling § This form can be imposed in term

Necessary form of a structured scheduling § This form can be imposed in term of linear constraints. July 2001 Samos - 2001 39

Schedule of the dot product k c a(4) a(3) a(2) a(1) b(4) b(3) b(2)

Schedule of the dot product k c a(4) a(3) a(2) a(1) b(4) b(3) b(2) b(1) 0 July 2001 Samos - 2001 40

Structured 1 D schedule use {i, j|1<=i<=N} dot[N](A, B) returns (C); July 2001 Samos

Structured 1 D schedule use {i, j|1<=i<=N} dot[N](A, B) returns (C); July 2001 Samos - 2001 41

2 D schedule use {i, j|1<=i<=N} dot[N](A, B) returns (C); July 2001 Samos -

2 D schedule use {i, j|1<=i<=N} dot[N](A, B) returns (C); July 2001 Samos - 2001 42

How to interpret this? k j c[1, 1] A(1, 1, 4) B(1, 1, 4)

How to interpret this? k j c[1, 1] A(1, 1, 4) B(1, 1, 4) A(1, 1, 3) B(1, 1, 3) A(1, 1, 2) B(1, 1, 2) A(1, 1, 1) B(1, 1, 1) i 0 July 2001 Samos - 2001 43

j=1 k j c[1, 1] A(1, 1, 4) B(1, 1, 4) A(1, 1, 3)

j=1 k j c[1, 1] A(1, 1, 4) B(1, 1, 4) A(1, 1, 3) B(1, 1, 3) A(1, 1, 2) B(1, 1, 2) A(1, 1, 1) B(1, 1, 1) i 0 July 2001 Samos - 2001 44

j=1 k j c[1, 1] A(1, 1, 4) B(1, 1, 4) A(1, 1, 3)

j=1 k j c[1, 1] A(1, 1, 4) B(1, 1, 4) A(1, 1, 3) B(1, 1, 3) A(1, 1, 2) B(1, 1, 2) A(1, 1, 1) B(1, 1, 1) i 0 July 2001 Samos - 2001 45

j=1 k j c[1, 1] A(1, 1, 4) B(1, 1, 4) A(1, 1, 3)

j=1 k j c[1, 1] A(1, 1, 4) B(1, 1, 4) A(1, 1, 3) B(1, 1, 3) A(1, 1, 2) B(1, 1, 2) A(1, 1, 1) B(1, 1, 1) i 0 July 2001 Samos - 2001 46

j=1 k j c[1, 1] A(1, 1, 4) B(1, 1, 4) A(1, 1, 3)

j=1 k j c[1, 1] A(1, 1, 4) B(1, 1, 4) A(1, 1, 3) B(1, 1, 3) A(1, 1, 2) B(1, 1, 2) A(1, 1, 1) B(1, 1, 1) i 0 July 2001 Samos - 2001 47

j=2 k j i July 2001 Samos - 2001 48

j=2 k j i July 2001 Samos - 2001 48

j=3 k j i July 2001 Samos - 2001 49

j=3 k j i July 2001 Samos - 2001 49

Structured schedules for MM § Dot product: § Matrix product: Or July 2001 Samos

Structured schedules for MM § Dot product: § Matrix product: Or July 2001 Samos - 2001 50

Matrix product re-using hardware Matrix product C B*, * A 1, * C 1,

Matrix product re-using hardware Matrix product C B*, * A 1, * C 1, * A 2, * C 2, * A 3, * C 3, * Acc + B * A July 2001 Samos - 2001 51 product Dot

Advantage of structured scheduling § Preserves designer’s structuring § Re-uses hardware § Constraints are

Advantage of structured scheduling § Preserves designer’s structuring § Re-uses hardware § Constraints are linear uses a classical schedule tool • Reduces the schedule computation complexity • Improves readability of the schedule information July 2001 Samos - 2001 52

Outline § § § What is MMAlpha? Example of design flow The Alpha language

Outline § § § What is MMAlpha? Example of design flow The Alpha language Structured scheduling Performance Conclusion July 2001 Samos - 2001 53

Experiments § Vertex method: Simplex of Mathematica § Farkas method: Pip software § Evaluation

Experiments § Vertex method: Simplex of Mathematica § Farkas method: Pip software § Evaluation of structured vs « flat » scheduling July 2001 Samos - 2001 54

Test set (vertex method) July 2001 Samos - 2001 55

Test set (vertex method) July 2001 Samos - 2001 55

#Constraints vs #Variables July 2001 Samos - 2001 56

#Constraints vs #Variables July 2001 Samos - 2001 56

Schedule time vs #constraints July 2001 Samos - 2001 57

Schedule time vs #constraints July 2001 Samos - 2001 57

#Constraints vs #Variables (Farkas method) July 2001 Samos - 2001 58

#Constraints vs #Variables (Farkas method) July 2001 Samos - 2001 58

Schedule time vs #constraints July 2001 Samos - 2001 59

Schedule time vs #constraints July 2001 Samos - 2001 59

Flat vs structured schedule July 2001 Samos - 2001 60

Flat vs structured schedule July 2001 Samos - 2001 60