Home / Learn / AI Chips / Dataflow Architecture Explained
On this page
The conventional model, brieflyThe dataflow modelWhy it fits neural networksHow dataflow hardware is builtControl flow and dataflow comparedThe advantagesThe challengesA long historyWhere dataflow sits among accelerator designsCommon questionsRelated guidesDataflow Architecture Explained
In a dataflow architecture, an operation runs as soon as the data it needs has arrived. There is no program counter stepping through instructions one after another. The program is a graph of operations connected by the data that flows between them, and the hardware follows that graph. Neural networks are naturally described as graphs, which is why dataflow ideas are common in AI accelerators.
The conventional model, briefly
Almost every general-purpose processor follows the same pattern. A program is a list of instructions. A counter points at the current one. The processor fetches it, carries it out and moves the counter to the next. This is called control flow, because the order of work is set by the flow of control through the list.
The model is simple and extremely flexible. Its weakness is that it is sequential by nature. Finding work that can safely be done in parallel takes a lot of extra machinery, both in the processor and in the compiler.
The dataflow model
A dataflow program is drawn as a graph. Each node is an operation, such as a multiplication. Each edge carries a value from one operation to the next.
The rule for execution is short: a node runs when all of its inputs are available. Nothing else decides the order. If ten nodes have their inputs ready at the same moment, all ten can run at once.
Parallelism does not have to be discovered. It is visible in the shape of the graph.
Why it fits neural networks
A neural network is already a dataflow graph. Frameworks represent a model as a set of operations, such as matrix multiplications, convolutions and activation functions, joined by the tensors that pass between them.
On a conventional processor, that graph has to be flattened into a sequence of instructions, and the parallelism then has to be recovered. A dataflow accelerator keeps the graph closer to its original form. The compiler places operations onto hardware units and connects them, and data streams through.
How dataflow hardware is built
Designs vary, but most include the following.
- Processing units that each carry out an operation, or a small group of operations.
- A configurable interconnect that routes outputs from one unit to the inputs of the next.
- Local memory placed near the units, so data does not have to travel far.
- A compiler that takes the model graph and decides which unit does what, and how they are wired for this model.
In some designs, the configuration is set once per model and stays fixed while it runs. In others, the hardware can be reconfigured quickly to switch between models or between stages of one model.
Control flow and dataflow compared
| Control flow | Dataflow | |
|---|---|---|
| What sets the order of work | A program counter | Arrival of data |
| Program form | List of instructions | Graph of operations |
| Parallelism | Must be found | Explicit in the graph |
| Overhead per operation | Fetch and decode each instruction | Little once configured |
| Flexibility | Very high | Depends on the compiler and hardware |
| Typical example | CPU | Some AI accelerators and signal processors |
The advantages
- Efficiency. Little energy is spent on fetching and decoding instructions. Most of the hardware is doing arithmetic.
- Natural parallelism. Independent parts of the model run at the same time without special effort.
- Good use of memory. Data moves directly from one operation to the next, with fewer trips to a shared memory.
- Steady throughput. Once data is streaming, results come out at a regular rate.
The challenges
- The compiler carries the load. Mapping a model onto the hardware, placing operations and routing data well, is a hard problem. Performance depends heavily on how good that mapping is.
- Irregular models are harder. When the path through a model depends on the data itself, with branches or loops of varying length, a fixed graph fits less neatly.
- New operations need support. If a model uses an operation the toolchain does not handle, it may run poorly or not at all until support is added.
- Debugging is different. There is no single sequence of steps to follow, which changes how engineers trace problems.
A long history
Dataflow computing was explored in university research in the 1970s and 1980s as an alternative to conventional processors. General-purpose dataflow machines did not displace them, largely because ordinary software is written as sequences of instructions and conventional processors kept improving quickly.
AI changed the situation. The workload is a graph, it is highly parallel and it is run billions of times. Those are the conditions in which dataflow hardware does best, and the idea has been taken up again in modern accelerator designs.
Where dataflow sits among accelerator designs
Dataflow is one of several approaches. GPUs keep a programmable, instruction-driven model and add massive parallelism. Systolic arrays fix the structure even more tightly around matrix arithmetic. Manycore processors use many conventional cores. Real chips often blend these ideas.
for how they line up.
Common questions
What is the difference between dataflow and control flow?
In control flow, a program counter decides which instruction runs next. In dataflow, an operation runs whenever its input data is ready, so the order is set by the data.
Is a dataflow architecture only for AI?
No. Dataflow ideas are also used in signal processing, networking and stream processing. AI is the area where they are currently drawing the most attention.
Does dataflow replace GPUs?
Not broadly. GPUs remain the most flexible and widely supported option. Dataflow designs compete where efficiency on a known set of models matters more than generality.