Modelcore
Synchronous dataflow
Also called SDF graph, synchronous data flow graph.
Lee and Messerschmitt's dataflow model whose actors produce and consume fixed numbers of tokens per firing, so schedules and buffer sizes are known at compile time.
Synchronous dataflow, or SDF, is a model of a signal processing program as a directed graph of actors that pass tokens along FIFO edges. Each actor consumes a fixed number of tokens from each input edge and produces a fixed number of tokens on each output edge every time it fires, and these numbers never depend on the data. Lee and Messerschmitt introduced it in 1987. Because the rates are fixed, a compiler can decide before the program runs whether it can run forever in bounded memory, how often each actor fires per period, and how large each buffer must be. This page defines the model and proves its basic theorems: the rank condition, the repetition vector, the cycle criterion for deadlock and the bounded memory theorem. The method that builds a schedule is on the static scheduling of SDF page.
The machine
An SDF graph has actors and a finite set of directed edges. Each edge from actor to actor carries three integers: the production rate , the consumption rate and the delay . Parallel edges and self loops are allowed. The delay is not a time: it is the number of tokens on the edge at the start, and in a signal flow graph it is the number of unit delays on the arc.
The state of the machine is the vector of token counts, with at the start. Actor is enabled in state when every input edge of holds tokens. One step fires one enabled actor: it removes tokens from each input edge and then adds tokens to each output edge. A firing is atomic, and the values of the tokens play no part in the model. A firing sequence is admissible when each actor in it is enabled at the moment it fires.
The topology matrix has one row per edge and one column per actor. For with , row has in column , in column and 0 elsewhere. For a self loop on , row has in column . If is the unit vector of actor , firing changes the state from to . So after an admissible sequence in which actor fires times, the state is
whatever the order of the firings. This is the same bookkeeping as the state equation of a Petri net.
The graph is called connected when it is connected after the edge directions are dropped. A graph with several components is a set of separate programs, so the results below assume a connected graph.
What it counts
The cost unit is one firing, and the memory is the number of tokens on the edges. The questions of the model are about firing sequences:
- Periodic admissible sequential schedule (PASS). A finite admissible sequence in which every actor fires at least once and after which the state is again. Repeating runs the program forever.
- Repetition vector. The firing counts of the shortest periodic schedules.
- Buffer bound. The largest token count of each edge while a schedule runs, which is the memory a compiler must reserve.
- Deadlock. A state that no admissible sequence can leave toward the end of a period.
With an execution time per actor, the model also has a throughput, the number of periods per unit of time on unlimited processors. That question reduces to the iteration bound of an expanded graph, as explained below.
Relation to other models
- Petri nets and marked graphs. An SDF graph is a weighted Petri net in which every place has exactly one input transition and one output transition: actors are transitions, edges are places, rates are arc weights and delays are the initial marking. When all rates are 1 the graph is homogeneous, and it is exactly a marked graph in the sense of Commoner, Holt, Even and Pnueli. A timed event graph is the timed version of a marked graph.
- Kahn process networks. An SDF actor is a Kahn process that reads a fixed number of tokens from each input with blocking reads, so SDF is a special case of a Kahn process network and inherits its determinacy. The fixed rates are what make the questions above decidable, while they are undecidable for general Kahn networks.
- Signal flow graphs and data flow graphs. A homogeneous SDF graph whose actors have execution times is the data flow graph of the iteration bound, retiming, unfolding and folding pages: one firing of each actor is one iteration, and the delays are registers.
- Control data flow graphs. A CDFG describes one run of a block with branches. SDF has no branches and describes a stream that never ends; its edges are queues, not single values.
- Models with data-dependent rates. Boolean dataflow adds actors whose rates depend on a control token. Lee and Parks (1995) survey this family and explain that such models can simulate any program, so the questions that SDF answers become undecidable for them.
Known results in the model
Throughout, is connected, with actors and topology matrix .
Theorem 1 (rank condition and repetition vector). If has a PASS, then . If , then the integer vectors with are exactly the multiples , , of one vector whose entries are positive integers with greatest common divisor 1. Every PASS fires each actor exactly times for one integer .
Proof. First, . Let with real. The row of an edge with says , so . Along a spanning tree of the undirected graph, every entry of is a fixed positive multiple of . So the null space has dimension at most 1, and the rank-nullity theorem gives .
Now let be a PASS with firing counts . The state after is , so with . Hence the null space is not zero and .
If , the null space is one line. The spanning tree argument shows that this line is spanned by the vector with whose entries are the positive rationals forced by the tree. Multiply by the least common multiple of the denominators and divide by the greatest common divisor of the result: this gives , with positive integer entries and gcd 1. Let be an integer null vector. Then for a rational in lowest terms, and divides for every , so divides every and hence their gcd, which is 1. So is an integer. For a PASS, is a null vector with positive entries, so with .
The vector is the repetition vector. A graph with is called consistent, and one with is inconsistent: it has no PASS at all. The nullspace computation by Gaussian elimination gives , but the spanning tree walk above is simpler and is what the scheduling page uses.
Theorem 2 (bounded memory). If is inconsistent, then every infinite admissible firing sequence of has unbounded token counts.
Proof. Suppose an infinite admissible sequence keeps every count at most . Then it visits finitely many states, so some state appears after two prefixes with firing counts (componentwise , and not equal). Then , so is a nonzero null vector with . For each edge, , so exactly when , and since is connected, every entry of is positive. So , and is consistent, a contradiction.
So an inconsistent graph either deadlocks or overflows any finite memory. A consistent graph can still deadlock, and the next theorem says exactly when.
Theorem 3 (deadlock comes from a cycle). Let be consistent with repetition vector . For a directed simple cycle of , let be the graph that has only the actors and edges of , with the same rates and delays. Then has a PASS exactly when, for every directed simple cycle , the graph alone has an admissible sequence in which each actor of fires times.
In words: deadlock always comes from a directed cycle whose initial tokens are too few for the cycle alone to complete its share of one period. An acyclic consistent graph never deadlocks. For a homogeneous graph, , and a cycle alone completes one firing of each actor exactly when it holds at least one token, which is the liveness theorem of Commoner, Holt, Even and Pnueli for marked graphs.
Proof. Number the firings of each actor as . For an edge , the -th firing of needs tokens taken from in total, which holds exactly when has fired at least
times. Each is nondecreasing, , and . Since , this gives , so implies .
Firings only add tokens to the edges that other actors read, so an enabled actor stays enabled until it fires. Hence the firings that a run can reach form a set that is closed downward, and reaches the counts exactly when the following requirement graph has no directed cycle. Its nodes are the firings with . It has an arc for , and an arc for each input edge of with . If is acyclic, firing in reverse topological order is admissible and reaches , and the state is then , so this is a PASS. If has a cycle, no firing on it can come first, so no run fires all of them. By Theorem 1 a PASS fires each actor at least times, so it would fire every node of , and no PASS exists. The same holds for with its own requirement graph , whose arcs are a subset of the arcs of on the same nodes.
If some fails, then has a cycle, which is also a cycle of , so has no PASS.
Conversely, suppose every completes, and let a closed walk in pass through actor . Write for the composition of the functions of the edges of , read backward from around to . A cycle of through projects to a closed walk with , since the arcs inside one actor only lower the index and every is nondecreasing. So it is enough to show for every closed walk and every . For a simple cycle , a value would give a cycle of through , since all the intermediate values stay in their windows and stay at least 1 (once a value is 0, all later ones are 0). So on the window, and . A closed walk that is not simple contains a simple cycle as a closed sub-walk at some actor . Removing gives a shorter closed walk , and since and every is nondecreasing, . Induction on the length of gives . So is acyclic and has a PASS.
The condition "fires times" can be read with the repetition vector of instead: the rows of are rows of , so the repetition vector of satisfies for an integer , and a cycle that completes is back in its start state and can repeat it times.
Precedence expansion. Lee and Messerschmitt (1987, IEEE Transactions on Computers) expand a consistent SDF graph into an acyclic precedence graph with nodes for actor , one per firing in one period, and an arc from each firing to the firings of the same period that need its tokens. It orders the same firings as the requirement graph above, read in the other direction. If the dependencies on tokens of earlier periods are added as edges with delays, the result is a homogeneous graph with one iteration per period. With execution times on the actors, the throughput on unlimited processors is then the inverse of the iteration bound of that homogeneous graph.
Example
Take three actors on a ring: produces 2 tokens and consumes 3 on edge ; produces 1 and consumes 2 on edge ; produces 3 and consumes 1 on edge , which holds initial tokens. Then
The rows give , and , which meets, and the rank is 2. One period fires three times, twice and once.
The graph is one cycle, so Theorem 3 reduces to running it. With , the sequence is admissible: uses the 3 tokens and puts 6 on , fires twice and puts 2 on , and fires once and puts 3 tokens back on . With , fires twice, fires once, and then 1 token waits on for , 1 token waits on for , and nothing waits for : a deadlock, although the graph is consistent. Any deadlocks in the same way.
Change the rates of to " produces 2, consumes 1". The third row becomes , the determinant is , the rank is 3, and by Theorem 2 every infinite run of this graph either stops or needs unbounded memory: now gets of the tokens it needs per period of the other two actors.
References
- Edward A. Lee and David G. Messerschmitt, Synchronous data flow, Proceedings of the IEEE 75(9), 1235 to 1245, 1987, the model (actors with fixed token rates, delays as initial tokens), the topology matrix and the rank condition, and its use for signal processing
- Edward A. Lee and David G. Messerschmitt, Static scheduling of synchronous data flow programs for digital signal processing, IEEE Transactions on Computers C-36(1), 24 to 35, 1987, the theorems on periodic admissible schedules (rank n - 1 is necessary, the repetition vector, deadlock, bounded memory) and the expansion into a precedence graph
- F. Commoner, A. W. Holt, S. Even and A. Pnueli, Marked directed graphs, Journal of Computer and System Sciences 5(5), 511 to 523, 1971, the token count of a directed cycle is invariant, and a marked graph is live exactly when every directed cycle holds a token
- Shuvra S. Bhattacharyya, Praveen K. Murthy and Edward A. Lee, Software Synthesis from Dataflow Graphs, Kluwer, 1996, the chapters on SDF consistency, scheduling and the buffer memory of schedules
- Edward A. Lee and Thomas M. Parks, Dataflow process networks, Proceedings of the IEEE 83(5), 773 to 801, 1995, SDF as a special case of Kahn process networks, and the dataflow models with data-dependent rates
Where this leads
About this page
The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.
| Ladder | Level | What the next level needs |
|---|---|---|
| Human proof | H0 no proof |
|
| Lean | L0 no Lean part |
|
| Visual | V0 none |
|
| Writing | W4 complete |
|
Tag SZZFZY Edit this page History Report an error Markdown