6.5.9Advanced & Emerging Architectures

Dataflow architectures

1,786 words8 min readdifficulty · medium2 backlinks

WHAT is a dataflow architecture?

The three ideas you must never forget:

  1. Program = graph, not a list.
  2. Execution rule = "fire when inputs ready" (called the firing rule).
  3. Parallelism is automatic — any two nodes whose inputs are ready can run at the same time.

WHY do we want this?

HOW execution works — from first principles

Consider the expression r=(x+y)×(xz)r = (x + y) \times (x - z)

Let's derive the dataflow graph instead of being handed one.

  • The final operation is ×\times. It needs two inputs: (x+y)(x+y) and (xz)(x-z).
  • (x+y)(x+y) is itself a node: a ++ that consumes tokens xx and yy.
  • (xz)(x-z) is a - node consuming xx and zz.

So the graph is:

x[+]y[+][+] ⁣ ⁣×x \rightarrow [+] \quad y \rightarrow [+] \quad\Longrightarrow\quad [+]\!\rightarrow\!\times x[]z[][] ⁣ ⁣×x \rightarrow [-] \quad z \rightarrow [-] \quad\Longrightarrow\quad [-]\!\rightarrow\!\times

Firing trace (Why each step?):

  1. Tokens x,y,zx,y,z arrive. Why? Inputs are the starting data.
  2. + node has both inputs (x,yx,y) → fires, emits token t1=x+yt_1=x+y. Simultaneously - node has x,zx,zfires, emits t2=xzt_2=x-z. Why simultaneously? Both firing rules are satisfied at once and the nodes are independent → hardware runs them in parallel.
  3. × node now has t1,t2t_1,t_2fires, emits rr. Why last? Its firing rule could not be satisfied earlier because its inputs didn't exist yet — the data dependency forces the order, nothing else does.
Figure — Dataflow architectures

Static vs Dynamic dataflow

Worked example — a loop

Compute i=1ni\sum_{i=1}^{n} i conceptually as a dataflow.

Body per iteration ii: sum_new = sum_old + i.

Why tags matter here (step-by-step):

  1. Iteration i=1i=1: token sum=0,τ1\langle sum=0,\tau_1\rangle, i=1,τ1\langle i=1,\tau_1\rangle → fires → 1,τ1\langle 1,\tau_1\rangle.
  2. Iteration i=2i=2 can already have its ii-token flowing while iteration 1 finishes. Tags τ1,τ2\tau_1,\tau_2 keep them separate so a fast ii-token never wrongly pairs with a slow sumsum-token from another iteration.
  3. Result: pipeline parallelism across iterations with no locks — the "matching store" hardware only fires when tags agree.

Common mistakes

Recall Feynman: explain to a 12-year-old

Imagine a kitchen where each cook makes one thing but only when all their ingredients are on the table. Nobody waits for a bell or a boss shouting "next!". The moment a cook has everything they need, they cook — and lots of cooks can work at the same time. The "recipe" isn't a numbered list; it's a picture of arrows showing whose finished dish becomes whose ingredient. In the fancy version, every ingredient has a sticker saying which order it belongs to, so the salad for table 3 never gets mixed with table 7's soup.

Active recall

What replaces the program counter in a dataflow architecture?
Nothing — execution is driven by data availability (the firing rule); there is no PC.
State the firing rule of a dataflow node.
A node fires when tokens are present on all of its input edges.
How is a dataflow program represented?
As a directed graph: nodes = operations, edges = data (tokens).
What determines execution order in dataflow?
Only data dependencies (which node's output feeds another's input).
Difference between static and dynamic dataflow?
Static allows at most one token per edge; dynamic attaches tags so many concurrent instances of the same graph can run.
In tagged-token dataflow, what must match before a node fires?
The tags of the input tokens must be equal.
Why does dataflow expose parallelism "for free"?
Independent operations have no connecting edge, so their firing rules are satisfied independently and they run concurrently.
What is a token?
A packet carrying a data value (and in dynamic dataflow, a tag) that flows along an edge and is consumed on firing.
What hardware unit pairs up matching tokens in dynamic dataflow?
The matching store / matching unit.
Why do we need tags in a loop?
To keep tokens from different iterations from wrongly pairing and to allow iterations to overlap (pipeline parallelism).

Connections

  • Von Neumann architecture — the sequential PC-based model dataflow reacts against.
  • Instruction-Level Parallelism — dataflow is the natural limit of ILP: all dependencies exposed.
  • Out-of-Order Execution — modern CPUs use a local, hidden dataflow engine (Tomasulo/reservation stations = tagged-token matching!).
  • Systolic Arrays — another data-driven, PC-free style for regular computations.
  • Directed Acyclic Graph (DAG) — the mathematical structure of a dataflow graph.
  • Loop-Level Parallelism — enabled cheaply by dynamic/tagged dataflow.

Concept Map

represented as

edges carry

executes by

enable

has

avoids

motivates

yields

imposes

variant

variant

at most one token per edge

Dataflow architecture

Program as directed graph

Data as tokens on edges

Firing rule fire when inputs ready

No program counter

Automatic parallelism

Von Neumann sequential bottleneck

Order set by data dependencies

Static dataflow

Dynamic dataflow

Hinglish (regional understanding)

Intuition Hinglish mein samjho

Dekho, normal computer (Von Neumann) mein ek program counter hota hai jo decide karta hai ki agli instruction kaunsi chalegi — bilkul ek numbered list ki tarah, ek ke baad ek. Dataflow architecture mein yeh program counter hota hi nahi. Yahan program ek graph ki tarah likha jata hai: har node ek operation (jaise +, -, ×) hai, aur edges pe tokens (yaani data values) travel karte hain. Rule simple hai: koi bhi node tabhi fire (execute) karta hai jab uske saare input tokens ready ho jayein. Matlab data hi batata hai kya chalega — isliye naam "dataflow".

Iska sabse bada fayda: parallelism free mein milta hai. Jaise (x+y) aur (x-z) dono ek dusre pe depend nahi karte, toh dono ek saath chal sakte hain — bina programmer ke bole. Sirf jab multiply ko dono results chahiye, tab woh wait karta hai. Yaani ordering sirf data dependency se aati hai, faltu sequential ordering hataa di jaati hai.

Ab loops ka issue: agar do iterations ek saath overlap kar rahe hain, toh confusion ho sakta hai — iteration-2 ka token galti se iteration-1 ke saath match kar le. Isko solve karne ke liye dynamic (tagged-token) dataflow aata hai, jisme har token pe ek tag (sticker) lagta hai jo batata hai "main kaunse iteration/context ka hoon". Node tabhi fire karta hai jab tokens ke tags match karein. Isse multiple iterations safely pipeline ho jaate hain.

Yeh matter kyun karta hai? Kyunki modern CPUs bhi andar-andar chhota sa dataflow engine chalati hain (Tomasulo, reservation stations = tagged-token matching!). Toh yeh concept sirf theory nahi — aaj ke out-of-order processors ki backbone hai. Yaad rakho: D.A.T.A — Data drives, Arrows = dependencies, Tokens carry values, All-inputs-ready = fire.

Go deeper — visual, from zero

Test yourself — Advanced & Emerging Architectures

Connections