41
1 - CPRE 583 (Reconfigurable Computing): Compute Models Iowa State University (Ames) CPRE 583 Reconfigurable Computing Lecture 7: Wed 10/28/2009 (Compute Models) Instructor: Dr. Phillip Jones ([email protected]) Reconfigurable Computing Laboratory Iowa State University Ames, Iowa, USA http:// class.ee.iastate.edu/cpre5 83/

1 - CPRE 583 (Reconfigurable Computing): Compute Models Iowa State University (Ames) CPRE 583 Reconfigurable Computing Lecture 7: Wed 10/28/2009 (Compute

Embed Size (px)

Citation preview

Page 1: 1 - CPRE 583 (Reconfigurable Computing): Compute Models Iowa State University (Ames) CPRE 583 Reconfigurable Computing Lecture 7: Wed 10/28/2009 (Compute

1 - CPRE 583 (Reconfigurable Computing): Compute Models Iowa State University (Ames)

CPRE 583Reconfigurable ComputingLecture 7: Wed 10/28/2009

(Compute Models)

Instructor: Dr. Phillip Jones([email protected])

Reconfigurable Computing LaboratoryIowa State University

Ames, Iowa, USA

http://class.ee.iastate.edu/cpre583/

Page 2: 1 - CPRE 583 (Reconfigurable Computing): Compute Models Iowa State University (Ames) CPRE 583 Reconfigurable Computing Lecture 7: Wed 10/28/2009 (Compute

2 - CPRE 583 (Reconfigurable Computing): Compute Models Iowa State University (Ames)

• Class Projects

• Common Compute Models

Overview

Page 3: 1 - CPRE 583 (Reconfigurable Computing): Compute Models Iowa State University (Ames) CPRE 583 Reconfigurable Computing Lecture 7: Wed 10/28/2009 (Compute

3 - CPRE 583 (Reconfigurable Computing): Compute Models Iowa State University (Ames)

Project Grading Breakdown

• 60% Final Project Demo• 30% Final Project Report

– 30% of your project report grade will come from your 5 project updates. Friday’s midnight

• 10% Final Project Presentation

Page 4: 1 - CPRE 583 (Reconfigurable Computing): Compute Models Iowa State University (Ames) CPRE 583 Reconfigurable Computing Lecture 7: Wed 10/28/2009 (Compute

4 - CPRE 583 (Reconfigurable Computing): Compute Models Iowa State University (Ames)

Project Update

• The current state of your project write up– Even in the early stages of the project you

should be able to write a rough draft of the Introduction and Motivation section

• The current state of your Final Presentation

• What things are work & not working

• What roadblocks are you running into

Page 5: 1 - CPRE 583 (Reconfigurable Computing): Compute Models Iowa State University (Ames) CPRE 583 Reconfigurable Computing Lecture 7: Wed 10/28/2009 (Compute

5 - CPRE 583 (Reconfigurable Computing): Compute Models Iowa State University (Ames)

• Introduction to common Compute Models

What you should learn

Page 6: 1 - CPRE 583 (Reconfigurable Computing): Compute Models Iowa State University (Ames) CPRE 583 Reconfigurable Computing Lecture 7: Wed 10/28/2009 (Compute

6 - CPRE 583 (Reconfigurable Computing): Compute Models Iowa State University (Ames)

• Design patterns– Why are they useful?– Examples

• Compute models– Why are they useful?– Examples

Outline

Page 7: 1 - CPRE 583 (Reconfigurable Computing): Compute Models Iowa State University (Ames) CPRE 583 Reconfigurable Computing Lecture 7: Wed 10/28/2009 (Compute

7 - CPRE 583 (Reconfigurable Computing): Compute Models Iowa State University (Ames)

• Design patterns– Why are they useful?– Examples

• Compute models– Why are they useful?– Examples

Outline

Page 8: 1 - CPRE 583 (Reconfigurable Computing): Compute Models Iowa State University (Ames) CPRE 583 Reconfigurable Computing Lecture 7: Wed 10/28/2009 (Compute

8 - CPRE 583 (Reconfigurable Computing): Compute Models Iowa State University (Ames)

References

• Reconfigurable Computing (2008) [1]– Chapter 5: Compute Models and System

Architectures• Scott Hauck, Andre DeHon

• Design Patterns for Reconfigurable Computing [2]– Andre DeHon (FCCM 2004)

• Type Architectures, Shared Memory, and the Corollary of Modest Potential [3]– Lawrence Snyder: Annual Review of Computer

Science (1986)

Page 9: 1 - CPRE 583 (Reconfigurable Computing): Compute Models Iowa State University (Ames) CPRE 583 Reconfigurable Computing Lecture 7: Wed 10/28/2009 (Compute

9 - CPRE 583 (Reconfigurable Computing): Compute Models Iowa State University (Ames)

• Compute Models [1]: High-level models of the flow of computation.

• Useful for:– Capturing parallelism – Reasoning about correctness– Decomposition– Guide designs by providing constraints on

what is allowed during a computation• Communication links• How synchronization is performed• How data is transferred

Compute Models

Page 10: 1 - CPRE 583 (Reconfigurable Computing): Compute Models Iowa State University (Ames) CPRE 583 Reconfigurable Computing Lecture 7: Wed 10/28/2009 (Compute

10 - CPRE 583 (Reconfigurable Computing): Compute Models Iowa State University (Ames)

• Function[1]: A deterministic, mathematical function that maps each finite input to a finite output– Y = F(X)– Y= [y0,y1,y2...,yn], X=[x0,x1,x2...,yn]

– Output only depends on inputs (i.e. no internal state)

– Can be composed: Y = (FoG)(X) = F(G(X)) • Object[1]: Function + internal state information

– Yi = F(Xi, Yi-1)

– O = {O.s, O.f}– Y,O.si = O.f(X,O.si-1)

Basic Elements

Page 11: 1 - CPRE 583 (Reconfigurable Computing): Compute Models Iowa State University (Ames) CPRE 583 Reconfigurable Computing Lecture 7: Wed 10/28/2009 (Compute

11 - CPRE 583 (Reconfigurable Computing): Compute Models Iowa State University (Ames)

• Data Flow:– Single-rate Synchronous Data Flow– Synchronous Data Flow– Dynamic Streaming Dataflow– Dynamic Streaming Dataflow with Peeks– Steaming Data Flow with Allocation

• Sequential Control:– Finite Automata (i.e. Finite State Machine)– Sequential Controller with Allocation– Data Centric– Data Parallel

Two High-level Families

Page 12: 1 - CPRE 583 (Reconfigurable Computing): Compute Models Iowa State University (Ames) CPRE 583 Reconfigurable Computing Lecture 7: Wed 10/28/2009 (Compute

12 - CPRE 583 (Reconfigurable Computing): Compute Models Iowa State University (Ames)

• Graph of operators that data (tokens) flows through• Composition of functions

Data Flow

X X

+

Page 13: 1 - CPRE 583 (Reconfigurable Computing): Compute Models Iowa State University (Ames) CPRE 583 Reconfigurable Computing Lecture 7: Wed 10/28/2009 (Compute

13 - CPRE 583 (Reconfigurable Computing): Compute Models Iowa State University (Ames)

• Graph of operators that data (tokens) flows through• Composition of functions

Data Flow

X X

+

Page 14: 1 - CPRE 583 (Reconfigurable Computing): Compute Models Iowa State University (Ames) CPRE 583 Reconfigurable Computing Lecture 7: Wed 10/28/2009 (Compute

14 - CPRE 583 (Reconfigurable Computing): Compute Models Iowa State University (Ames)

• Graph of operators that data (tokens) flows through• Composition of functions

Data Flow

X X

+

Page 15: 1 - CPRE 583 (Reconfigurable Computing): Compute Models Iowa State University (Ames) CPRE 583 Reconfigurable Computing Lecture 7: Wed 10/28/2009 (Compute

15 - CPRE 583 (Reconfigurable Computing): Compute Models Iowa State University (Ames)

• Graph of operators that data (tokens) flows through• Composition of functions

Data Flow

X X

+

Page 16: 1 - CPRE 583 (Reconfigurable Computing): Compute Models Iowa State University (Ames) CPRE 583 Reconfigurable Computing Lecture 7: Wed 10/28/2009 (Compute

16 - CPRE 583 (Reconfigurable Computing): Compute Models Iowa State University (Ames)

• Graph of operators that data (tokens) flows through• Composition of functions

Data Flow

X X

+

Page 17: 1 - CPRE 583 (Reconfigurable Computing): Compute Models Iowa State University (Ames) CPRE 583 Reconfigurable Computing Lecture 7: Wed 10/28/2009 (Compute

17 - CPRE 583 (Reconfigurable Computing): Compute Models Iowa State University (Ames)

• Graph of operators that data (tokens) flows through• Composition of functions

Data Flow

X X

+

Page 18: 1 - CPRE 583 (Reconfigurable Computing): Compute Models Iowa State University (Ames) CPRE 583 Reconfigurable Computing Lecture 7: Wed 10/28/2009 (Compute

18 - CPRE 583 (Reconfigurable Computing): Compute Models Iowa State University (Ames)

• Graph of operators that data (tokens) flows through• Composition of functions

Data Flow

X X

+

Page 19: 1 - CPRE 583 (Reconfigurable Computing): Compute Models Iowa State University (Ames) CPRE 583 Reconfigurable Computing Lecture 7: Wed 10/28/2009 (Compute

19 - CPRE 583 (Reconfigurable Computing): Compute Models Iowa State University (Ames)

• Graph of operators that data (tokens) flows through• Composition of functions• Captures:

– Parallelism– Dependences– Communication

Data Flow

X X

+

Page 20: 1 - CPRE 583 (Reconfigurable Computing): Compute Models Iowa State University (Ames) CPRE 583 Reconfigurable Computing Lecture 7: Wed 10/28/2009 (Compute

20 - CPRE 583 (Reconfigurable Computing): Compute Models Iowa State University (Ames)

• One token rate for the entire graph– For example all operation take one token on

a given link before producing an output token

– Same power as a Finite State Machine

Single-rate Synchronous Data Flow

-

1

1

update1

F1

1 1 copy

11

11

1

Page 21: 1 - CPRE 583 (Reconfigurable Computing): Compute Models Iowa State University (Ames) CPRE 583 Reconfigurable Computing Lecture 7: Wed 10/28/2009 (Compute

21 - CPRE 583 (Reconfigurable Computing): Compute Models Iowa State University (Ames)

• Each link can have a different constant token input and output rate

• Same power as signal rate version but for some applications easier to describe

• Automated ways to detect/determine:– Dead lock– Buffer sizes

Synchronous Data Flow

-

1

1

update1

F1

10 10 copy

11

110

1

Page 22: 1 - CPRE 583 (Reconfigurable Computing): Compute Models Iowa State University (Ames) CPRE 583 Reconfigurable Computing Lecture 7: Wed 10/28/2009 (Compute

22 - CPRE 583 (Reconfigurable Computing): Compute Models Iowa State University (Ames)

• Token rates dependent on data• Just need to add two structures

– Switch Select

Dynamic Steaming Data Flow

Switch SelectS S

in0 in1

out

in

out0 out1

Page 23: 1 - CPRE 583 (Reconfigurable Computing): Compute Models Iowa State University (Ames) CPRE 583 Reconfigurable Computing Lecture 7: Wed 10/28/2009 (Compute

23 - CPRE 583 (Reconfigurable Computing): Compute Models Iowa State University (Ames)

• Token rates dependent on data• Just need to add two structures

- Switch, Select• More

– Powerful– Difficult to detect Deadlocks

• Still Deterministic

Dynamic Steaming Data Flow

Switch

S

Select

x

x

y

yF0 F1

1

x

x

y

y

Page 24: 1 - CPRE 583 (Reconfigurable Computing): Compute Models Iowa State University (Ames) CPRE 583 Reconfigurable Computing Lecture 7: Wed 10/28/2009 (Compute

24 - CPRE 583 (Reconfigurable Computing): Compute Models Iowa State University (Ames)

• Allow operator to fire before all inputs have arrived– Example were this is useful is the merge

operation• No execution can be nondeterministic

– Answer depends on input arrival times

Dynamic Steaming Data Flow with Peeks

Merge

Page 25: 1 - CPRE 583 (Reconfigurable Computing): Compute Models Iowa State University (Ames) CPRE 583 Reconfigurable Computing Lecture 7: Wed 10/28/2009 (Compute

25 - CPRE 583 (Reconfigurable Computing): Compute Models Iowa State University (Ames)

• Allow operator to fire before all inputs have arrived– Example were this is useful is the merge

operation• Now execution can be nondeterministic

– Answer depends on input arrival times

Dynamic Steaming Data Flow with Peeks

Merge

A

Page 26: 1 - CPRE 583 (Reconfigurable Computing): Compute Models Iowa State University (Ames) CPRE 583 Reconfigurable Computing Lecture 7: Wed 10/28/2009 (Compute

26 - CPRE 583 (Reconfigurable Computing): Compute Models Iowa State University (Ames)

• Allow operator to fire before all inputs have arrived– Example were this is useful is the merge

operation• Now execution can be nondeterministic

– Answer depends on input arrival times

Dynamic Steaming Data Flow with Peeks

Merge

B

A

Page 27: 1 - CPRE 583 (Reconfigurable Computing): Compute Models Iowa State University (Ames) CPRE 583 Reconfigurable Computing Lecture 7: Wed 10/28/2009 (Compute

27 - CPRE 583 (Reconfigurable Computing): Compute Models Iowa State University (Ames)

• Allow operator to fire before all inputs have arrived– Example were this is useful is the merge

operation• Now execution can be nondeterministic

– Answer depends on input arrival times

Dynamic Steaming Data Flow with Peeks

Merge

B

A

Page 28: 1 - CPRE 583 (Reconfigurable Computing): Compute Models Iowa State University (Ames) CPRE 583 Reconfigurable Computing Lecture 7: Wed 10/28/2009 (Compute

28 - CPRE 583 (Reconfigurable Computing): Compute Models Iowa State University (Ames)

• Removes the need for static links and operators. That is the Data Flow graph can change over time

• More Power: Turing Complete• More difficult to analysis• Could be useful for some applications

– Telecom applications. For example if a channel carries voice verses data the resources needed may vary greatly

• Can take advantage of platforms that allow runtime reconfiguration

Steaming Data Flow with Allocation

Page 29: 1 - CPRE 583 (Reconfigurable Computing): Compute Models Iowa State University (Ames) CPRE 583 Reconfigurable Computing Lecture 7: Wed 10/28/2009 (Compute

29 - CPRE 583 (Reconfigurable Computing): Compute Models Iowa State University (Ames)

• Sequence of sub routines– Programming languages (C, Java)– Hardware control logic (Finite State Machines)

• Transform global data state

Sequential Control

Page 30: 1 - CPRE 583 (Reconfigurable Computing): Compute Models Iowa State University (Ames) CPRE 583 Reconfigurable Computing Lecture 7: Wed 10/28/2009 (Compute

30 - CPRE 583 (Reconfigurable Computing): Compute Models Iowa State University (Ames)

• Finite state• Can verify state reachablilty in polynomial

time

Finite Automata (i.e. Finite State Machine)

S1

S2

S3

Page 31: 1 - CPRE 583 (Reconfigurable Computing): Compute Models Iowa State University (Ames) CPRE 583 Reconfigurable Computing Lecture 7: Wed 10/28/2009 (Compute

31 - CPRE 583 (Reconfigurable Computing): Compute Models Iowa State University (Ames)

• Adds ability to allocate memory. Equivalent to adding new states

• Model becomes Turing Complete

Sequential Controller with Allocation

S1

S2

S3

Page 32: 1 - CPRE 583 (Reconfigurable Computing): Compute Models Iowa State University (Ames) CPRE 583 Reconfigurable Computing Lecture 7: Wed 10/28/2009 (Compute

32 - CPRE 583 (Reconfigurable Computing): Compute Models Iowa State University (Ames)

• Adds ability to allocate memory. Equivalent to adding new states

• Model becomes Turing Complete

Sequential Controller with Allocation

S1

S2

S3

S4

SN

Page 33: 1 - CPRE 583 (Reconfigurable Computing): Compute Models Iowa State University (Ames) CPRE 583 Reconfigurable Computing Lecture 7: Wed 10/28/2009 (Compute

33 - CPRE 583 (Reconfigurable Computing): Compute Models Iowa State University (Ames)

• Multiple instances of a operation type acting on separate pieces of data. For example: Single Instruction Multiple Data (SIMD)– Identical match test on all items in a

database– Inverting the color of all pixels in an image

Data Parallel

Page 34: 1 - CPRE 583 (Reconfigurable Computing): Compute Models Iowa State University (Ames) CPRE 583 Reconfigurable Computing Lecture 7: Wed 10/28/2009 (Compute

34 - CPRE 583 (Reconfigurable Computing): Compute Models Iowa State University (Ames)

• Similar to Data flow, but state contained in the objects of the graph are the focus, not the tokens flowing through the graph– Network flow example

Data Centric

S1

D1

D2SW1

S1

S1 Flow rateBuffer overflow

Page 35: 1 - CPRE 583 (Reconfigurable Computing): Compute Models Iowa State University (Ames) CPRE 583 Reconfigurable Computing Lecture 7: Wed 10/28/2009 (Compute

35 - CPRE 583 (Reconfigurable Computing): Compute Models Iowa State University (Ames)

• Multi-threaded: a compute model made up a multiple sequential controllers that have communications channels between them

• Very general, but often too much power and flexibility. No guidance for:– Ensuring determinism– Dividing application into treads– Avoiding deadlock– Synchronizing threads

• The models discussed can be defined in terms of a Multi-threaded compute model

Multi-threaded

Page 36: 1 - CPRE 583 (Reconfigurable Computing): Compute Models Iowa State University (Ames) CPRE 583 Reconfigurable Computing Lecture 7: Wed 10/28/2009 (Compute

36 - CPRE 583 (Reconfigurable Computing): Compute Models Iowa State University (Ames)

• Thread: is an operator that performs transforms on data as it flows through the graph

• Thread synchronization: Tokens sent between operators

Streaming Data Flow as Multithreaded

Page 37: 1 - CPRE 583 (Reconfigurable Computing): Compute Models Iowa State University (Ames) CPRE 583 Reconfigurable Computing Lecture 7: Wed 10/28/2009 (Compute

37 - CPRE 583 (Reconfigurable Computing): Compute Models Iowa State University (Ames)

• Thread: is a data item• Thread synchronization: data updated with

each sequential instruction

Data Parallel as Multithreaded

Page 38: 1 - CPRE 583 (Reconfigurable Computing): Compute Models Iowa State University (Ames) CPRE 583 Reconfigurable Computing Lecture 7: Wed 10/28/2009 (Compute

38 - CPRE 583 (Reconfigurable Computing): Compute Models Iowa State University (Ames)

• Use when a stricter compute model does not give enough expressiveness.

• Define restrictions to limit the amount of expressive power that can be used– Define synchronization policy– How to reason about deadlocking

Caution with Multithreaded Model

Page 39: 1 - CPRE 583 (Reconfigurable Computing): Compute Models Iowa State University (Ames) CPRE 583 Reconfigurable Computing Lecture 7: Wed 10/28/2009 (Compute

39 - CPRE 583 (Reconfigurable Computing): Compute Models Iowa State University (Ames)

• “A Framework for Comparing Models of computation” [1998] – E. Lee, A. Sangiovanni-Vincentelli– Transactions on Computer-Aided Design of

Integrated Circuits and Systems• “Concurrent Models of Computation for

Embedded Software”[2005]– E. Lee, S. Neuendorffer– IEEE Proceedings – Computers and Digital

Techniques

Other Models

Page 40: 1 - CPRE 583 (Reconfigurable Computing): Compute Models Iowa State University (Ames) CPRE 583 Reconfigurable Computing Lecture 7: Wed 10/28/2009 (Compute

40 - CPRE 583 (Reconfigurable Computing): Compute Models Iowa State University (Ames)

Next Lecture

• System Architectures

Page 41: 1 - CPRE 583 (Reconfigurable Computing): Compute Models Iowa State University (Ames) CPRE 583 Reconfigurable Computing Lecture 7: Wed 10/28/2009 (Compute

41 - CPRE 583 (Reconfigurable Computing): Compute Models Iowa State University (Ames)

Slides in Progress

• Need to revise this lecture with figures, and useful animations

• Add some non-FPGA systems, maybe not since GARP, and PipeRench were discussed in last lecture. Perhaps just mention again– Main reason other archs are not used is

economy of scales. Lots of FPGAs are manufacture, thus lowing cost and enable the use of state of the art fab technology (given high performance