Architectures · Chapter 9 of 16 · AI accelerators

Dataflow and spatial meshes

Some AI chips split the work across many small processors laid out in a grid. Each has its own memory, and neighbors pass data straight to each other.

Spatial chips place many cores, each with local memory, on an on-chip network. A compiler maps each layer onto groups of cores and schedules the data moving between them, so data stays on the chip.

Spatial and dataflow execution, tiling and placing layers, network-on-chip bandwidth and congestion, the compiler’s central role, and the trade-off between flexibility and efficiency.

An AI model works in steps called layers. Each layer does a lot of multiplying and adding, then hands its results to the next layer. An ordinary chip does the layers one at a time. Between layers, it parks the results in a big memory and fetches them back later. Those trips are slow and use a lot of energy.

Some AI chips work differently. They hold hundreds or thousands of cores, which are small processors, laid out in a grid. Each core has its own small, fast memory right beside it. The model is spread across the chip: one group of cores does the first layer, the next group does the second, and so on. Results flow from group to group along short wires. These are called or dataflow chips.

That planning is done by a program called a compiler. On these chips, it matters as much as the hardware.

The previous chapters covered two ways to run neural networks. A GPU runs thousands of threads under central control, and they all fetch data through a shared memory hierarchy. A systolic array is one large grid of multiply-accumulate units that pass operands to their neighbors in lockstep. This chapter covers a third family that scales the systolic idea up to the whole chip: or dataflow architectures.

Sze and colleagues’ survey draws the line clearly. In a “temporal” architecture (CPUs, GPUs), a central controller drives many arithmetic units, which fetch data from the memory hierarchy and cannot talk to each other directly. In a “spatial” architecture, the arithmetic units form a processing chain and pass data from one to another; each unit sometimes has its own control and its own local memory, which together make a (PE).

A spatial AI chip at full scale has three ingredients:

  • Many cores, each with local memory. Hundreds to thousands of PEs, each with its own , so most data is read right next to the math that uses it.
  • An on-chip network. A (NoC), usually a grid, that carries data between cores.
  • A compiler that plans everything. It splits each layer into pieces, assigns the pieces to cores, and decides how data travels, all before the model runs.

The payoff is energy and speed: moving data is often costlier than computing on it, and spatial chips keep data moving over short distances. The cost is that the hardware is only as good as the plan the compiler finds.

A spatial or dataflow architecture distributes a computation across an array of , each with local , connected by an exposed , and executes it under a schedule fixed largely at compile time. Sze et al. contrast it with temporal architectures (SIMD/SIMT CPUs and GPUs), whose ALUs share centralized control and cannot communicate except through the memory hierarchy. The design premise is Dally’s cost model for accelerators: arithmetic is nearly free, global memory is expensive, and memory dominates area and power.

The family spans a wide range of PE granularity. At one end are the systolic arrays of the previous chapter, where a PE is one MAC and a register. In the middle are such as Stanford’s Plasticine, whose units are SIMD pipelines and banked scratchpads. At the other end are many-core designs whose “PE” is a full processor with hundreds of KB to MB of SRAM. All of them share one problem: a model must be tiled, placed and routed onto the fabric, and the result is bounded by the slowest stage, the busiest link, or whatever does not fit in SRAM.

This chapter covers the execution model, the network (topology, routing, channel load, flow control), how layers are tiled and placed, the compiler’s central role, and the flexibility-versus-efficiency trade-off. Case studies are open publications on Plasticine, SambaNova’s SN40L, Graphcore’s IPU, Tesla’s Dojo D1 and AMD’s AI Engine. Wafer-scale designs push the same ideas past the reticle limit and have their own chapter, Wafer-scale and SRAM-heavy designs.

DRAMoff chipChipcachecentral controlone layer at a timelayer 1layer 2layer 3layer 4
Architecture

Two ways to execute the same layers. Pick one to see where the data goes.

Temporal and spatial architectures, after Sze et al. A spatial chip spreads the layers across cores with their own memory and passes data between neighbors. Not to scale.Share freely with credit: ‘Figure from chipfieldguide.com’

In a computer, the math is quick and cheap. The costly part is fetching the numbers to do math on. Getting a number from the big memory outside the chip can take about 200 times the energy of getting it from a tiny memory right next to the math.

So a spatial chip gives every core its own small memory. Each core loads its share of the model’s learned numbers, called weights, just once. They stay put. Then data streams through: a core takes in numbers, combines them with its weights and passes the result on.

This has a catch. Each core’s memory is small, so the model has to fit. If a layer’s weights don’t fit in its cores, part of them must keep coming in from outside the chip, which is slow.

Work also has to be shared fairly. A layer with three times the math needs about three times the cores.

Why local memory

Every multiply in a neural network needs two numbers, and the cost of fetching them depends on where they live. Sze’s survey gives the energy of one fetch, normalized to a read from a PE’s tiny register file (1×): about 2× from a neighboring PE over the on-chip network, 6× from a shared on-chip buffer of a few hundred kilobytes, and about 200× from off-chip . A design that gets most operands from nearby spends a fraction of the energy of one that goes to DRAM, and Dally’s group reports that keeping data in local on-chip memory costs about two orders of magnitude less energy than off-chip access.

A spatial chip therefore spreads its SRAM out as many small memories, one beside each core, instead of one big shared cache. Each is a : software decides what goes in it, rather than hardware guessing. Graphcore’s IPU shows how far this goes: 1,216 tiles, each a core with 256 KiB of local memory, for 304 MiB on one chip, with a local-memory latency of 6 clock cycles.

Weights stay, activations flow

A layer has weights (fixed numbers learned in training) and activations (the data flowing through: an image’s features, a sentence’s tokens). A common plan for a spatial chip is:

  1. Split each layer’s weights across a group of cores and load them once.
  2. Cut the activations into small enough to stream through the cores’ buffers.
  3. Each core multiplies the tiles it receives by its weights and sends its results on to the next layer.

If every layer has its own group of cores, the whole model runs as a pipeline: while layer 3 works on image 1, layer 2 works on image 2 and layer 1 on image 3. This means intermediate results never leave the chip. SambaNova calls the approach “streaming dataflow”: tensors are tiled and streamed through a pipeline of operators, with on-chip memory units between the stages holding intermediate results.

What can go wrong

Three things limit how fast such a pipeline can run:

  • The slowest stage. A layer with too few cores for its share of the math makes every other stage wait.
  • The busiest link. All of a layer’s output must cross the network to the next layer. If too much of it squeezes through one link, the network sets the pace.
  • Memory that doesn’t fit. Weights that overflow a core’s SRAM must come back in from off-chip memory, over and over.

The energy argument, quantified

The normalized data-movement costs from the Eyeriss work, as summarized by Sze et al., are 1× for a register file of 0.5–1.0 kB inside the PE, 2× for a transfer from a neighbor PE over an array of 200–1000 PEs, 6× for a global buffer of 100–500 kB, and 200× for DRAM. Two consequences follow. First, every reuse of a fetched value at a cheaper level pays back part of the fetch from a dearer level, so reuse is the objective of a dataflow. Second, large memories are dear per access even on chip, which argues for many small distributed banks over one big one. Dally et al. state the same conclusion as a design rule: memory, not arithmetic, typically dominates both the area and the power of a domain-specific accelerator.

Granularity of the processing element

  • Coarse-grained reconfigurable units. Plasticine splits the fabric into Pattern Compute Units (pipelines of reconfigurable SIMD stages) and Pattern Memory Units (banked scratchpads with their own address logic), in a 16 × 8 array with a 1:1 ratio and 256 KB per PMU. SambaNova’s SN40L uses the same unit names, adds address-generation and coalescing units, and connects them in a two-dimensional mesh.
  • Processor tiles. Each IPU tile is a multithreaded core with 256 KiB of SRAM that holds both its code and its data, in its own 21-bit address space. Each Dojo node is a vector core with matrix units and 1.25 MB of SRAM.
  • Tiles with shared neighbor memory. AMD’s AI Engine array is a 2D array of tiles, each a VLIW processor with memory and streaming interconnect. A tile has 32 KB of data memory in eight banks, and its processor can address its own memory and the memories of its north, south and one east-or-west neighbor as one contiguous block; cascade streams pass results from tile to tile. Shared neighbor memory is a second way, besides the network, to move data one hop.

Streaming dataflow versus kernel-by-kernel execution

A GPU typically runs one kernel (one or a few fused operators) across the whole chip, writes the result to HBM or a shared cache, then launches the next. The SN40L paper argues why this caps : a grid of thread blocks is fixed for a kernel’s lifetime, so a transpose that crosses blocks forces a trip through shared cache or HBM; limited SRAM forces large intermediates out; and the programming model offers no straightforward way to run small matrix multiplies as a pipeline. On its Monarch-FFT example, the paper reports arithmetic intensity of 39.5 FLOP/byte unfused, 102.6 with partial fusion and 410.4 fully spatially fused, against an A100’s ratio of about 150 FLOP/byte, the point below which a kernel is memory-bound. (The workloads chapter explains the roofline reasoning behind that threshold.)

The spatial alternative maps the operators as stages of a coarse-grained pipeline. Stages with more of the work get more compute units, and stage buffers between them are split over enough memory units to match the bandwidth and capacity each needs. A transpose becomes an access pattern on a buffer rather than a data movement. The pipeline’s rate is the minimum over stages of their throughput, so the mapping problem is a load-balancing problem in three resources at once: compute, SRAM and network bandwidth.

Energy per fetch1×register file2×neighbor PE6×global buffer200×DRAMEnergy per useDRAM every use200Load once, reuse21200 ÷ 10 + 1 per use

Load once from DRAM, then 10 register-file reads: ≈ 21× per use, 9.5× less than fetching from DRAM each time.

Normalized energy per fetch from Sze et al. Spatial chips load each core’s weights once and reuse them for every input, so the DRAM cost is spread over many uses.Share freely with credit: ‘Figure from chipfieldguide.com’
time (ticks) →Layer 14 coresLayer 24 coresLayer 34 coresLayer 44 coresImages done: 0cell = image number
Cores per layer
1 / 11

Press Tick to advance one tick. Each stage works on a different image at the same time.

Layer pipelining: each layer has its own cores, and images stream through. Taking cores from one layer makes it the slowest stage. Ticks are illustrative.Share freely with credit: ‘Figure from chipfieldguide.com’

The cores are joined by a grid of tiny roads called the . Each core connects only to its four neighbors: up, down, left and right. To go farther, data hops from core to core, like a car driving through a city’s intersections.

Many chips use a very simple rule for directions. Go left or right until you reach the right column, then go up or down. It can never cause gridlock, but it can’t take a detour around a busy road either.

Every hop costs a little time and energy, so long trips cost more. And each road can carry only so much at once. If one road gets far more traffic than the rest, everything waits for it, the way one jammed bridge can slow a whole city.

Mesh, routers and hops

Many large spatial chips use a : cores on a grid, each linked to its four neighbors through a small . Tesla’s Dojo D1 is a typical example: a 2D mesh spanning all its processing nodes, one clock cycle per hop, with each node connected to the network independently and reading and writing its SRAM directly. The mesh’s appeal is physical: every wire is short and the same length, so it scales to large dies. MIT’s Raw processor, an early tiled design, made the point explicitly: each tile was sized so a signal could cross it in one clock cycle, so the longest wire was never longer than a tile.

The cost of a mesh is distance. A message from one corner to the opposite corner of a k×kk \times k mesh crosses 2(k−1)2(k-1) links; on Raw’s 4 × 4 grid that was 6 hops, about six cycles. Each hop also costs energy, so the same bytes sent twice as far cost roughly twice as much network energy.

Routing: which way to go

The simplest rule, and the one on-chip network research has long favored, is : travel along the row until you reach the destination’s column, then along the column. Its advantages are that it is cheap to build and can never deadlock. Its weakness is that every message between two cores takes the same path, so it cannot spread load around a busy link. SambaNova’s SN40L, for example, routes packets either with 2D dimension-order routing or along fixed routes that the compiler chooses.

The busiest link sets the speed

For any pattern of traffic, you can add up how much data must cross each link: its . The network saturates when the most heavily loaded link is full, so the maximum channel load, not the average, sets the network’s throughput. A small example: if one link must carry 800 KB for every image and links run at 16 GB/s, that link alone needs 50 µs per image, so the chip can’t exceed 20,000 images per second no matter how fast its cores are.

Waiting without losing data

On-chip networks don’t drop packets. They use : a router sends only when the next one has buffer space. SN40L applies credit-based flow control at every hop. The side effect is that a congested link backs up traffic behind it, which is how one hot spot can slow streams that never touch it.

Not every chip uses a mesh

Graphcore’s IPU connects its tiles through an all-to-all network it calls the exchange, rather than a nearest-neighbor mesh. Microbenchmarks measured about 7.7 TB/s of total on-chip bandwidth with all tiles sending to random destinations, 6.3 GB/s per tile, and found that the distance between two tiles has a negligible effect on bandwidth for large transfers. That makes placement matter less for bandwidth, at the price of a network whose reach across the whole chip has to be built in.

Topology metrics

For a k×kk \times k , node degree is 4, the diameter is 2(k−1)2(k-1) hops, and the bisection is kk links per direction, half that of a torus. Latency splits into head latency (hops × per-hop router and link delay) and serialization latency (packet length ÷ link bandwidth). Dojo’s D1 quotes one cycle per hop, 256 GB/s of bidirectional bandwidth on every row and column, and up to eight packets per cycle across each node’s boundary. Raw exposed wire delay to software directly as network hops.

Routing

Routing functions are deterministic (one path per source–destination pair), oblivious (chosen without regard to network state, possibly randomized) or adaptive (chosen using local congestion). Dimension-order () routing is deterministic and minimal. It is simple and deadlock-free, but it throws away the mesh’s path diversity and load-balances poorly; turn-model routing recovers some adaptivity by forbidding only two of the eight possible turns, and minimal routing is the norm on chip. Spatial accelerators add a third option that matters more than adaptivity: routes fixed by the compiler. SN40L supports both 2D dimension-order routing and software-assigned static flows, in which a flow ID carried by the packet is decoded and reassigned at every switch port; static flows also support multicast. Raw had two static networks, with routes specified at compile time, and two dynamic ones. Plasticine’s interconnect is entirely statically configured, with registers in the switch links to avoid long wire delays.

Channel load and saturation

For a traffic pattern and routing function, the load γc\gamma_c on channel cc is the traffic that crosses it per unit of injected traffic. The network saturates when the most loaded channel is busy every cycle, so maximum throughput is b/max⁡cγcb / \max_c \gamma_c for link bandwidth bb. A channel load of 2 relative to injection means each node can inject at most half the link bandwidth. For an accelerator the “traffic pattern” is not random: it is the producer-to-consumer streams the compiler created, known exactly in advance. That is why the compiler can, and must, compute channel loads before it commits to a placement.

Flow control, congestion and throttling

SN40L’s vector and scalar fabrics are packet-switched with at every hop, plus end-to-end flow control between communicating units that combines software tokens, hardware credits and forward-progress guarantees; a separate circuit-switched control fabric of single-bit wires carries tokens, typically marking the end of a loop, that orchestrate execution of the graph. Its designers report that bandwidth problems “often boiled down to” network congestion or memory bank conflicts, that bursty traffic could slow an entire kernel, and that programmable packet throttling mitigated many of the congestion issues, with stall counters in the switches and memory units helping to find hot spots.

Many-to-one and multicast

Layer boundaries rarely have equal producer and consumer counts, so traffic is often one-to-many (a weight or activation broadcast) or many-to-one (a gather or reduction). SN40L lists hardware fan-out paths for multicast and sequence IDs on vector packets so that a consumer can reorder data arriving out of order from many producers. Eyeriss v2 makes the same point at small scale: a broadcast network starves PEs when reuse is low, and an all-unicast network wastes energy when reuse is high, so its hierarchical mesh switches between the two per data type, raising MobileNet throughput 5.6×.

Mesh versus exchange

The IPU is the useful counterexample. Its on-chip exchange sustained 7.7 TB/s in an all-to-all test, every tile could use 6.3 GB/s to any destination, tile-to-tile latency was at most 165 ns and did not degrade under load, and near and far tile pairs reached the same bandwidth for blocks of 32 KiB or more. The IPU pairs that network with the model: compute, then exchange, then barrier, with the exchange scheduled by the compiler. Dojo takes the opposite stance: its slides say the system network has less bandwidth for long routes, which cross die and tile boundaries, that long routes consume a lot more of the system’s resources, and that software has a strong incentive to keep most communication local, with the amount of data transferred falling quickly with distance.

ABRoute A → B7 hops4 east then 3 southEnergy ∝ 7 hopsdiameter: 8 hopsOne streamturn on a second streamXY: row first, then column
Tap sets
Second stream

7 hops (4 east then 3 south). XY routing finishes the row first, then the column. Twice the hops, roughly twice the network energy.

A 5 × 5 mesh with dimension-order (XY) routing. Tap cores to set the source and destination; add a second stream to see shared links.Share freely with credit: ‘Figure from chipfieldguide.com’

Fitting a model onto a spatial chip is like making a seating chart for a big wedding. Each layer is a group of guests, and the cores are the seats. You have to decide how many seats each group gets and where each group sits.

Groups with more work need more seats. Groups that talk a lot, like one layer and the next, should sit side by side so their data takes short trips.

These goals pull against each other. Giving a big layer more cores takes cores away from the others. Squeezing everyone into one corner keeps trips short, but then each core has too much to store. You can try it yourself in the simulation below.

Step 1: split each layer

A layer is mostly a big matrix multiplication (see What the workload needs). To spread it over nn cores, the compiler cuts it into nn pieces with . There are several ways to cut, and each changes the traffic:

  • Split the weights. Each core holds 1/n1/n of the weights, so memory is shared evenly. But each core then produces only part of the output, and the next layer may need all of it, which means every core talks to every other.
  • Split the data. Each core works on a slice of the input (say, a band of rows of an image) with a full copy of the weights. Traffic stays local, but the weights are duplicated nn times.

Step 2: decide how many cores per layer

Two numbers set a lower limit. A layer needs enough cores to hold its weights (weights ÷ usable SRAM per core) and enough to keep up with the other layers (its share of the total work). The compiler then hands out spare cores to whichever stage is slowest. SambaNova’s paper describes the same idea: more compute units go to the heavier operators, and stage buffers are split over enough memory units to match each stage’s bandwidth and capacity.

Step 3: place the layers on the mesh

Now the compiler decides which physical cores each layer gets. Consecutive layers exchange the most data, so they should be neighbors, and each core should sit close to the cores it sends to. Placement does not change how many bytes are sent, but it changes how far they go and how much piles onto any one link.

Step 4: route and schedule

Finally, the compiler fixes the routes, buffer sizes and the order in which things happen. On some chips this becomes a static configuration of the whole fabric, “akin to an assembly language” that is turned into a configuration bitstream, as the Plasticine paper puts it. On others it becomes a program per core plus a schedule of exchanges.

The three budgets

For a chain of layers i=1…Li = 1 \dots L on a mesh of identical cores of rate FF (FLOP/s) and usable SRAM SS, assigning nin_i cores to layer ii with work WiW_i (FLOP per input), weights MiM_i and output activations AiA_i per input gives, with weights split evenly:

  • Compute per stage: ti=Wi/(niF)t_i = W_i / (n_i F).
  • SRAM per core: Mi/ni+BM_i / n_i + B, for streaming buffers BB, which must not exceed SS.
  • Network: the per-link load produced by streaming each AiA_i to layer i+1i + 1’s cores, which depends on the split, the placement and the routing.

The pipeline’s time per input is the maximum over all three, and ∑ni\sum n_i is bounded by the core count. Compute balance alone would give ni∝Win_i \propto W_i, but late layers of many networks carry most of the weights and little of the work, so the SRAM constraint, not compute, sets their core count. The sim’s model has exactly this shape.

How the split determines the traffic

For a dense layer Y=XWY = XW, splitting WW by output columns over nin_i cores (weights divided evenly) leaves each core with a column slice of YY. If the next layer is also column-split, each of its cores needs all of YY: all-to-all traffic, or a gather followed by a broadcast. Splitting the next layer by rows of its weight matrix instead lets core kk consume only slice kk of YY, so traffic is point-to-point between matching slices, but each consumer then produces a partial sum and the partial sums must be reduced. Splitting activations spatially (bands of an image, chunks of a sequence) keeps traffic local at the price of replicating weights and exchanging halos at band edges. These are the same tensor-, pipeline- and data-parallel choices that the parallelism chapter covers across chips, applied within one die; the SN40L paper notes that, to its compiler, mapping parallel dataflows across sockets is similar to mapping them within one.

Describing a mapping

MAESTRO describes a with data-centric directives: a spatial map distributes a loop dimension across PEs, a temporal map steps it over time, and clusters group PEs into levels so that the same notation describes nested arrays. Timeloop represents mappings as loop nests with tiling factors and orderings at each storage level, and treats the set of valid mappings for an architecture as a mapspace to be searched. Both make the point that the dataflow, not just the hardware, determines reuse, utilization and energy.

Layer 1Layer 2core 1core 2core 3core 4core 5core 6weights per core1/3streams9patternall-to-all
Split

Split the weights: each core holds 1/3 of its layer’s weights, but makes only part of the output, and every next-layer core needs all of it: 9 streams, all-to-all.

Splitting a layer across cores: by weights or by data. The bar in each core is its share of the weights; lines are the streams to the next layer.Share freely with credit: ‘Figure from chipfieldguide.com’

An ordinary chip makes lots of decisions on the spot while a program runs. A spatial chip has most of them made ahead of time by the compiler. The compiler is a program that turns the model into a detailed plan for the chip: which core does what, what each one stores and which road every number takes.

The plan matters a lot. Two plans can run equally fast on the same chip, yet one can use many times more energy than the other.

That is why companies that build these chips spend as much effort on software as on the chip itself.

A spatial chip’s compiler does far more than a normal compiler. It takes a model written in a framework such as PyTorch and decides:

  • How to split and tile every layer, and how many cores each one gets.
  • Where every piece sits on the mesh (placement).
  • How data travels between pieces, and which routes it takes (routing).
  • What lives in each core’s SRAM, and what has to spill to off-chip memory.
  • When each transfer happens, so nothing waits longer than necessary.

Published systems show how central this is:

  • Plasticine maps programs written as parallel patterns onto its units in stages: unroll, split into virtual units, partition those onto physical units with greedy heuristics, then place and route. Because its units are coarse, compilation finishes (or fails) in a few minutes, against the hours an FPGA can take.
  • Graphcore’s Poplar compiler lets programmers describe the computation and data flow; the compiler decides where data lives in each tile and schedules every transfer.
  • SambaNova’s compiler includes a place-and-route layer that configures the routing tables of every switch, and its designers built into it a static bandwidth model of both the application and the hardware.
  • Tesla’s Dojo leaves enough to software that dead processing nodes are simply avoided by the software, and the compiler defines which nodes synchronize together.

How much the plan matters: in the Timeloop study, about 480,000 different mappings of one convolution layer all ran within 5% of peak speed on the same accelerator, yet their energy efficiency varied by nearly 19×.

What gets decided statically

In a spatial machine the compiler absorbs work a GPU does in hardware at run time: operand delivery (instead of caches and warp schedulers), routing (static flows instead of only dynamic routing) and synchronization (compiled barriers or tokens instead of hardware scheduling).

  • Plasticine’s flow. Applications in a parallel-pattern language are unrolled by parallelization factors, lowered to virtual PCUs and PMUs with unlimited resources, partitioned onto physical units by a greedy algorithm with a cost metric over stages, live variables and I/O buses (graph partitioning being NP-hard in general), then bound hierarchically with placement, routing and register allocation. The hierarchy keeps each level of mapping under 1,000 nodes, and together with the coarse buses it lets compilation finish in minutes.
  • SN40L’s flow. A place-and-route layer programs the routing tables of all three network fabrics. The compiler allocates HBM and DDR, using static symbol-lifetime analysis because the programming model has neither dynamic allocation nor pointer aliasing. A static bandwidth model of application and hardware drives how many streams each unit gets, and kernel schedules can be offloaded to hardware to cut launch overhead.
  • IPU’s flow. Programs are vertices, tensors and static exchange edges; Poplar allocates data at rest, I/O buffers and the timing of every transfer, all organized as bulk-synchronous supersteps.
  • Dojo’s flow. A flat address scheme exposes the topology to software; software avoids dead nodes, and the compiler defines barrier domains and their communication trees.

Why search is unavoidable

Timeloop’s motivating example: on a 1,024-MAC accelerator, 480k mappings of VGG conv3_2 within 5% of peak performance span nearly 19× in energy, only one is energy-optimal, and 6,582 mappings with the same (minimum) DRAM traffic still vary 11× because on-chip buffer accesses are not free. The optimal mapping changes across workloads, and a mapping that is optimal on one architecture can be poor or invalid on another. A spatial compiler therefore needs a fast, accurate cost model and a search procedure, and its quality is part of the chip’s measured performance: a benchmark result measures a chip and its compiler together (see Comparing chips).

model graphLayer 1Layer 2Layer 3Layer 44 × 4 mesh
1 / 5

Input: The model’s graph of layers, as written in a framework such as PyTorch.

A spatial compiler’s main steps: split, place, route, configure. Piece counts are illustrative. Plans that run equally fast can still differ many times over in energy.Share freely with credit: ‘Figure from chipfieldguide.com’

Below is a chip with 36 cores in a 6 × 6 grid, and a model with five layers that works on pictures. Each core’s number shows which layer it works on. Pick a layer, then tap cores to give them that job. The goal is to get as many pictures through each second as you can.

The lines between cores are the roads, colored by how busy they are. A dashed red border means a core can’t fit its share of the model. Try the preset plans, then see if you can beat “Balanced”.

The sim maps a five-layer image model onto a 6 × 6 mesh. Each core does 1 TFLOP/s (a trillion operations per second) and has 512 KB of SRAM; links carry 16 GB/s in each direction. Choose a layer in the palette, then click or press Enter on cores to assign them. The readouts show images per second and which of the three limits (slowest stage, busiest link, memory overflow) sets it. Things to try:

  • Start with Equal. Which layer is the slowest stage, and which cores overflow their SRAM?
  • Switch to Pipelined, then Scattered. The core counts are identical. What changes, and why?
  • Compact squeezes the model into half the chip. Count how many problems that creates at once.

Each layer’s weights are split evenly over its cores, with 64 KB per core reserved for stream buffers. Producer core jj of layer ii sends core kk of layer i+1i + 1 the share of AiA_i where their output and input fractions overlap (a matched-slice split), routed XY. Time per image is max(slowest stage, busiest link ÷ link bandwidth, SRAM overflow ÷ 100 GB/s of off-chip bandwidth). The Expert view adds link-bandwidth and SRAM sliders, the three bounds in µs, and traffic × distance (MB·hop) as a proxy for network energy. Try:

  • In Pipelined, find the binding constraints. Then lower the link bandwidth: at what point does the network take over?
  • Compare byte-hops for Pipelined and Scattered. How does the hottest link’s load change, and why less than the byte-hops?
  • Shrink SRAM to 256 KB. Which layer overflows first, and how many cores would it need?

It is a first-order model: no latency, no router contention beyond link loads, no input or output traffic to the chip edge, and spills charged as if every overflowing weight were re-read from off-chip memory for every image.

Loading simulation…
DRAM vs register-file fetch energy
200×
Neighbor-PE fetch vs register file
2×
Energy spread of near-peak mappings, one layer
≈19×

Energy ratios from Sze et al.; mapping spread from Timeloop.

What these numbers mean:

  • 200 times. Fetching a number from memory outside the chip can take about 200 times the energy of fetching it from a tiny memory next to the math. Fetching it from a neighboring core takes only about twice as much. That gap is the whole reason to build chips this way.
  • Hundreds to over a thousand cores. Real spatial chips have that many cores, each with its own memory.
  • A few hundred megabytes. All that memory on the chip adds up to about what a hundred or so phone photos take. That is small next to today’s biggest models, so some chips add slower memory outside too.
  • 19 times. Different plans for the same layer on the same chip ran almost equally fast, but some used about 19 times as much energy as others. The plan matters.

How to read the table:

  • Per-core SRAM ranges from 32 KB to over a megabyte. Small cores need more of them per layer and more traffic between them; big cores keep more local but are fewer.
  • Total on-chip SRAM sits in the hundreds of megabytes. A model whose weights fit can run with almost no off-chip traffic; one that doesn’t must stream weights in, or spread across several chips (see The memory wall).
  • The networks differ in kind: a mesh where distance costs bandwidth (Dojo, SN40L) versus an exchange where it barely does (IPU).

For history: MIT’s Raw prototype of 2002 already had 16 tiles, each with a processor and local memory, 2 MB of distributed SRAM in total, and four 32-bit networks linking each tile only to its four neighbors. Stanford’s Plasticine (2017) was a research design: a 16 × 8 array of compute and memory units with 256 KB per memory unit, estimated at 113 mm² in a 28 nm process, 49 W at 1 GHz, and up to 76.9× better performance per watt than an FPGA in simulation.

Points worth drawing out of the data:

  • SRAM per unit of compute. SN40L pairs 638 BF16 TFLOPS with 520 MB of SRAM, and Dojo D1 pairs 362 BF16/CFP8 TFLOPS with 440 MB. Both are around 1 MB of SRAM per TFLOPS of peak, which is the regime where a meaningful slice of a model, not just a tile of one layer, can stay resident.
  • Network headroom. On the IPU, the 7.7 TB/s measured exchange throughput is about a sixth of the 45 TB/s nominal aggregate local-memory bandwidth. Local memory is the fast path; the network is the scarcer resource, which is the assumption behind keeping traffic local.
  • Memory tiers. SN40L adds 64 GB of HBM at about 1.8–2 TB/s and up to 1.5 TB of DDR at about 200 GB/s per socket, with the compiler deciding what spills where. Pure-SRAM designs instead scale out to more chips when a model exceeds on-chip capacity, the subject of the wafer-scale chapter.
  • Research versus product numbers. Plasticine’s 76.9× is a cycle-accurate simulation against an FPGA, with area from synthesis, not silicon. The Citadel IPU numbers are independent microbenchmarks; the others are the designers’ own figures.

Spatial chips give up some things to get their speed:

  • Small memory. A model too big to fit has to be split across several chips, or keep fetching parts of itself from slower memory.
  • Hard planning. The compiler has to solve a big puzzle for every model. A new kind of model may run poorly until the software learns to place it well.
  • Less flexible. A chip built for a steady assembly line can struggle with jobs whose steps keep changing.

The bet is that AI models repeat the same steps over and over, so careful planning pays off.

Flexibility versus efficiency

Chips sit on a spectrum. An can be rewired down to single bits, which makes it very flexible but costly: over 60% of an FPGA’s area and power goes to its programmable wiring. A fixed-function wastes nothing but does only what it was built for. and many-core meshes sit in between: they are configured in whole numbers rather than bits, which makes them denser and faster to compile for, while still running many kinds of models. Dally and colleagues add that the best accelerators target a domain rather than a single application, keeping enough programmability to follow algorithms as they change.

Capacity

Keeping weights resident is what makes layer pipelining efficient, and it only works while the model fits in on-chip SRAM. Bigger models must be split across more chips, or the chip needs slower memory tiers behind the SRAM. SN40L does the latter with HBM and DDR, and its designers note the extra burden this puts on the software to manage several memory spaces.

Shape sensitivity

A mapping tuned for one model’s layer shapes can fit another poorly. Eyeriss v2 was built because compact networks like MobileNet vary much more in layer shape than older ones, and accelerators designed for large networks ran them with poor utilization.

How spatial designs go wrong

  • Imbalance. One under-resourced stage idles the rest of the pipeline.
  • Hot links and bursts. SN40L’s designers found that bandwidth problems often came down to network congestion or memory bank conflicts, and bursty traffic could slow a whole kernel.
  • Overflow. Weights that don’t fit spill off chip and can dominate run time.
  • Long-distance traffic. On a mesh, far-apart communicating cores spend energy on every hop and load many links; Dojo’s designers tell software to keep data transfers falling off quickly with distance.
  • Compile time. Coarse units help: Plasticine compiles in minutes rather than the hours an FPGA can take, but the search is still large.

Flexibility versus efficiency, quantified where possible

Plasticine’s case: bit-level reconfigurability costs FPGAs over 60% of their area and power in programmable interconnect and limits clock rates through long combinational paths, while word-level CGRAs offer denser compute and clock rates up to an order of magnitude higher; Plasticine’s simulated result was up to 76.9× perf/W over an FPGA. In the other direction, every bit of configurability a spatial chip keeps (routing tables, programmable address generators, flow IDs, sequence IDs for reordering) is area and energy a hard-wired systolic array does not spend, and the SN40L paper lists those features as requirements for streaming dataflow with arbitrary access patterns between operators. Dally et al. frame the middle ground: specialize for a domain, keep programmability where algorithms move, and co-design the algorithm with the hardware.

Static versus dynamic

Static schedules make performance predictable and let the compiler compute channel loads exactly, but they fit poorly with data-dependent behavior: dynamic shapes, routing decisions inside the model, variable sequence lengths. SN40L’s answer for its composition-of-experts system is to compile each expert independently and switch models at run time, with model-switching cost (copying an expert from DDR to HBM) as the new bottleneck it optimizes. The IPU’s discipline separates computation from exchange in time, at the cost of not overlapping compute and communication within a superstep and waiting at every barrier for the slowest tile.

Mesh versus richer networks

A mesh is cheap and scales with the die, but its bisection is only kk links per direction and its diameter grows with kk. Designs answer with locality (Dojo restricts global traffic to synchronization and all-reduce), with static routes that spread load (SN40L’s flows), or with a non-mesh exchange whose bandwidth is nearly distance-independent (IPU).

Failure modes and how they show up

  • Load imbalance: stage utilization far below 100% except on one stage; fixed by reassigning cores or splitting the slow operator.
  • Network saturation: stall counters climbing at a few switches; SN40L exposes per-switch performance counters and programmable packet throttling for this.
  • Bank conflicts: double buffers of arbitrary shapes landing in the same SRAM banks; fixed in SN40L by mapping buffers to different banks with programmable bank bits.
  • Deadlock: cyclic channel dependencies, avoided by dimension-order or turn-model routing, or by compiler-verified static routes.
  • Defects: a dead core breaks the regular grid; Dojo requires every router on a usable die to work and has software avoid dead processing nodes.
FPGAbit-levelCGRA / meshword-level×+×+×+×+×+×+×+×+×+Fixed-functionhard-wiredflexibleefficient

Tap each kind of chip to compare flexibility and efficiency.

The flexibility–efficiency spectrum. Figures from the Plasticine paper; drawings are schematic.Share freely with credit: ‘Figure from chipfieldguide.com’
ChipSRAM: 500 MB300 MB: fitsfree: 200 MBno off-chip weight traffic
Overflow plan

Fits: 300 MB of weights stay resident in 500 MB of SRAM, so the pipeline runs with almost no off-chip traffic.

On-chip SRAM capacity against model weights. 500 MB is an illustrative round figure in the range of the designs in the table.Share freely with credit: ‘Figure from chipfieldguide.com’

This part goes deeper, into the math, models and algorithms behind the chapter. It’s written for the Expert level.

The analytic model behind the simulation, the routing and channel-load computation it uses, why dimension-order routing cannot deadlock, and how compilers search for mappings.

1. A three-bound pipeline model

Take a chain of LL layers. Layer ii needs WiW_i FLOP per input, holds MiM_i bytes of weights and emits AiA_i bytes of activations. It runs on nin_i cores of rate FF, each with SRAM SS of which BB bytes go to buffers. Links carry bb bytes/s per direction, off-chip memory DD bytes/s.

  1. Compute bound:
    Tcomp=max⁡iWiniFT_{\mathrm{comp}} = \max_i \frac{W_i}{n_i F}
  2. Network bound:
    Tnet=max⁡cγcbT_{\mathrm{net}} = \frac{\max_c \gamma_c}{b}
    where γc\gamma_c is the bytes per input that cross directed link cc (step 2).
  3. Memory bound: every byte of weights that does not fit is re-read for each input, so
    Tmem=1D∑inimax⁡ ⁣(0, Mini+B−S)T_{\mathrm{mem}} = \frac{1}{D} \sum_i n_i \max\!\left(0,\ \frac{M_i}{n_i} + B - S\right)
  4. Time per input
    T=max⁡(Tcomp, Tnet, Tmem)T = \max(T_{\mathrm{comp}},\ T_{\mathrm{net}},\ T_{\mathrm{mem}})
    Throughput is 1/T1/T. Latency for one input would instead be the sum of stage delays plus network latency, which this model does not track.

In the sim, F=1 TFLOP/sF = 1\,\mathrm{TFLOP/s}, B=64 KBB = 64\,\mathrm{KB}, D=100 GB/sD = 100\,\mathrm{GB/s}, and the five layers have (WW in MFLOP, MM in KB, AA in KB): conv1 (100, 32, 3000), conv2 (300, 600, 1800), conv3 (300, 2400, 900), conv4 (150, 4000, 300), fc (15, 1000, 4). With 512 KB per core and 16 GB/s links, the Pipelined preset (6, 9, 9, 9, 3 cores) has Tcomp=33.3 μsT_{\mathrm{comp}} = 33.3\,\mu\mathrm{s} and Tnet=33.3 μsT_{\mathrm{net}} = 33.3\,\mu\mathrm{s}, so about 30,000 images/s; Scattered (same counts, random placement) has Tnet=45.8 μsT_{\mathrm{net}} = 45.8\,\mu\mathrm{s} and 72% more byte-hops. These numbers are illustrative, chosen so that each bound can bind.

2. Channel loads under XY routing

Order each layer’s cores (the sim uses row-major order) and give producer jj of nin_i the output fraction [ j/ni, (j+1)/ni)[\,j/n_i,\ (j+1)/n_i) and consumer kk of ni+1n_{i+1} the input fraction [ k/ni+1, (k+1)/ni+1)[\,k/n_{i+1},\ (k+1)/n_{i+1}). The bytes from jj to kk are AiA_i times the length of the intersection of those intervals. Each such flow is routed X first, then Y, and its bytes are added to every directed link on the path:

  1. From (r,c)(r, c) step cc toward the destination column, adding the flow to the east or west link at each step.
  2. Then step rr toward the destination row, adding it to the south or north links.
  3. After all flows, γc\gamma_c is the sum on link cc and the hottest link is argmax⁡cγc\operatorname{argmax}_c \gamma_c. Byte-hops ∑cγc\sum_c \gamma_c are a first-order proxy for network energy, since each hop costs roughly the same energy per byte.

Because XY routing is deterministic, γ\gamma is a linear function of the flow matrix, which is what lets a compiler evaluate a candidate placement quickly and why static traffic is so much easier to plan than random traffic.

Two observations the sim makes concrete. First, under XY routing a single core’s output leaves on at most four links (east, west, north, south), so max⁡γ\max \gamma is at least max⁡iAi/(4ni)\max_i A_i/(4 n_i) for any placement; when all of a core’s consumers lie in one direction, as in banded placements, the bound tightens to Ai/niA_i/n_i. Either way, the early, activation-heavy layer needs cores for injection bandwidth, not just compute. Second, scattering cores raises byte-hops a lot but the maximum load less, because the extra traffic spreads over many links; on a larger mesh, or one with more layers sharing it, the overlap and hence the maximum grows.

3. Why XY routing cannot deadlock

A routing deadlock needs a cycle of packets, each holding a channel and waiting for the next channel in the cycle. In a 2D mesh a packet can make eight kinds of turn (from ±X to ±Y and from ±Y to ±X), and any cycle in the channel-dependency graph needs at least one turn from Y back to X. Dimension-order routing finishes X before starting Y, so it never makes those turns, the dependency graph is acyclic, and no deadlock is possible. The turn model generalizes this: forbid just two of the eight turns, one in each potential cycle direction, and routing stays deadlock-free while regaining some adaptivity. Protocol-level deadlock (requests waiting on responses that wait on requests) is a separate issue, handled with separate message classes or, in statically scheduled machines, by the compiler’s schedule.

Four packets, four linksp1p2p3p4E→SS→WW→NN→EdeadlockThe eight turnsX→YY→XE→SE→NW→SW→NS→ES→WN→EN→W
Routing rule

Any turn allowed: each packet holds one link and waits for the next, clockwise. The dependency cycle closes, so none can ever move: deadlock.

Deadlock needs a cycle of packets, each waiting for a link the next one holds. Forbidding the right turns makes such a cycle impossible.Share freely with credit: ‘Figure from chipfieldguide.com’

4. Mapping as search

A mapper needs three parts:

  1. A mapspace. For each layer, the tiling factors per loop and memory level, loop orders, which dimensions are spread across PEs (spatial) and which are stepped through time (temporal). MAESTRO writes these as SpatialMap and TemporalMap directives within nested clusters of PEs. For a whole model on a mesh, add core counts per layer and a placement.
  2. A cost model. It must be fast enough to evaluate many candidates and accurate enough not to mislead. Timeloop’s point that 6,582 mappings with equal DRAM traffic still differ 11× in energy shows that counting only off-chip traffic is not enough.
  3. A search. Exhaustive enumeration is feasible for small mapspaces; otherwise random sampling, heuristics or hierarchical decomposition. Plasticine partitions virtual units greedily with a cost metric and binds hierarchically so each level has fewer than 1,000 nodes.

The placement part of the problem resembles VLSI placement: minimize communication weighted by distance, subject to capacity (SRAM per core) and congestion (channel loads), which is why the same families of techniques (partitioning, greedy construction, iterative improvement) appear in both. See Placement for the chip-level versions of those algorithms.

5. A simple balancing heuristic

One way to produce core counts like the sim’s Pipelined preset:

  1. Give each layer the minimum that fits its weights: ni=⌈Mi/(S−B)⌉n_i = \lceil M_i / (S - B) \rceil. If ∑ni\sum n_i already exceeds the core count, the model needs off-chip memory or more chips.
  2. While cores remain, give one to the layer with the largest max⁡(Wi/F, Ai/b)/ni\max(W_i/F,\ A_i/b) / n_i, a combined compute and injection time.
  3. Place layers in consecutive column bands so that each layer’s slices sit beside the matching slices of the next.
  4. Compute γ\gamma under XY routing, and if one link dominates, move or swap cores near it and re-evaluate.

With the sim’s numbers at 512 KB and 16 GB/s, steps 1 and 2 give 6, 9, 9, 9 and 3 cores. Step 4 is where real compilers spend their effort, with richer splits, multicast, static flows that avoid hot links, and models of router latency and buffering that this model leaves out.

Novice · 0 of 4 correct
  1. Q1In a published estimate of data-movement energy for a spatial accelerator, fetching a value from DRAM costs about 200× a register-file access. About how much does getting it from a neighboring processing element cost?

  2. Q2A mesh uses XY routing. A packet goes from the core at row 0, column 0 to the core at row 3, column 2. Which path does it take?

  3. Q3A layer’s weights are 4,000 KB and each core has 512 KB of SRAM, of which 64 KB is reserved for buffers. What is the fewest cores that can hold the layer without spilling to off-chip memory?

  4. Q4Why do spatial chips depend so heavily on their compiler?

Sources

Show Hide 15 sources
  1. Efficient Processing of Deep Neural Networks: A Tutorial and SurveyVivienne Sze, Yu-Hsin Chen, Tien-Ju Yang, Joel Emer · arXiv:1703.09039 (Proceedings of the IEEE) · 2017Temporal (CPU/GPU) versus spatial (dataflow) architectures; processing engines with local memory; normalized data-movement energy: DRAM 200×, global buffer 6×, neighbor PE 2×, register file 1×.
  2. Domain-Specific Hardware AcceleratorsWilliam J. Dally, Yatish Turakhia, Song Han · Communications of the ACM 63(7) (open-access copy in DSpace@MIT) · 2020Accelerator design as parallel programming with a cost model where arithmetic is free and global memory is expensive; memory dominates accelerator area and power; local on-chip memory costs two orders of magnitude less energy than off-chip.
  3. The Raw Microprocessor: A Computational Fabric for Software Circuits and General-Purpose ProgramsMichael Bedford Taylor et al. · IEEE Micro (copy hosted by MIT CSAIL) · 200216 tiles with local memory on four 32-bit nearest-neighbor networks, two static (routes fixed at compile time) and two dynamic; wire delay exposed as network hops; 2 MB of distributed SRAM.
  4. Plasticine: A Reconfigurable Architecture For Parallel PatternsRaghu Prabhakar, Yaqi Zhang, David Koeplinger, et al. (Stanford University) · ISCA 2017 (author copy, Stanford Pervasive Parallelism Laboratory) · 2017Pattern Compute Units and Pattern Memory Units in a 16×8 array; 256 KB scratchpad per PMU; statically configured interconnect with registered switch links; 113 mm², 49 W maximum at 1 GHz in 28 nm; up to 76.9× perf/W over an FPGA; FPGAs spend over 60% of area and power on interconnect; compiles in minutes.
  5. SambaNova SN40L: Scaling the AI Memory Wall with Dataflow and Composition of ExpertsRaghu Prabhakar et al. (SambaNova Systems) · arXiv:2405.07518 · 20241,040 PCUs and 1,040 PMUs on a 2D mesh; 520 MB SRAM, 64 GB HBM, 1.5 TB DDR; streaming dataflow pipelines; dimension-order or static flow routing set by the compiler’s place-and-route; credit-based flow control; bandwidth problems that often came down to network congestion or memory bank conflicts.
  6. Dissecting the Graphcore IPU Architecture via MicrobenchmarkingZhe Jia, Blake Tillman, Marco Maggioni, Daniele P. Scarpazza (Citadel) · arXiv:1912.03413 · 20191,216 tiles with 256 KiB each (304 MiB per chip); 6-cycle local memory latency; on-chip exchange measured at 7.7 TB/s all-to-all; tile distance barely affects bandwidth; bulk-synchronous execution organized by the Poplar compiler.
  7. IPU Programmer’s Guide: IPU hardware overviewGraphcore · Graphcore documentationThe IPU is made of many independent tiles, all connected to an all-to-all communication network called the exchange fabric.
  8. The Microarchitecture of Tesla’s Exa-Scale Computer (Hot Chips 34 slides)Emil Talpes, Douglas Williams, Debjit Das Sarma · Hot Chips 34 · 2022D1 die: 354 nodes with 1.25 MB SRAM each, 440 MB total, 2D mesh with one cycle per hop and 256 GB/s per row and column; long routes across die and tile boundaries have less bandwidth, so software should keep communication local; dead nodes avoided by software.
  9. AI Engine Array Overview (Versal Adaptive SoC AI Engine Architecture Manual, AM009)AMD · AMD technical documentationA two-dimensional array of AI Engine tiles, each with a VLIW processor, memory, and interconnect for streaming, configuration and debug.
  10. AI Engine Tile Architecture (AM009)AMD · AMD technical documentation32 KB of data memory in eight banks per tile; a tile can access its neighbors’ memory modules as one contiguous block; cascade streams pass results from tile to tile.
  11. ECE 1749H: Interconnection Networks for Parallel Computer Architectures: RoutingNatalie Enright Jerger · University of Toronto · 2010Deterministic dimension-order (XY) routing: simple and deadlock-free, but no path diversity and poor load balancing; oblivious and adaptive routing; the turn model; minimal routing is most common on chip.
  12. ECE 1749H: Interconnection Networks for Parallel Computer Architectures: TopologyNatalie Enright Jerger · University of Toronto · 2010Hop count, latency and serialization; maximum channel load sets the saturation throughput; bisection bandwidth; mesh versus torus.
  13. Eyeriss v2: A Flexible Accelerator for Emerging Deep Neural Networks on Mobile DevicesYu-Hsin Chen, Tien-Ju Yang, Joel Emer, Vivienne Sze · arXiv:1807.07928 (IEEE JETCAS) · 2019Compact DNNs vary widely in layer shape; a hierarchical-mesh on-chip network switches between high-bandwidth unicast and high-reuse multicast, raising MobileNet throughput 5.6×.
  14. Timeloop: A Systematic Approach to DNN Accelerator EvaluationAngshuman Parashar et al. (NVIDIA, MIT) · ISPASS 2019 (author copy, MIT) · 2019A mapping is the schedule of operations and data movement; 480k mappings of one layer within 5% of peak performance vary nearly 19× in energy; a mapper searches the mapspace with a fast cost model.
  15. Understanding Reuse, Performance, and Hardware Cost of DNN Dataflows: A Data-Centric Approach Using MAESTROHyoukjun Kwon, Prasanth Chatarasi, Michael Pellauer, Angshuman Parashar, Vivek Sarkar, Tushar Krishna · arXiv:1805.02566 (MICRO 2019) · 2019Data-centric directives (spatial map, temporal map, clusters) describe how a layer’s dimensions are split across processing elements and over time.