Altifigence Academy

17 / 24 · Concept

PEs, dataflow and MAC reuse

Map P=3,M=2,K=8 onto four output-stationary PEs. What are MAC cycles and useful MAC-slot utilization, excluding writes?

Decide what stays nearby

A PE is a processing element with multiplication, accumulation and small local state. More PEs increase possible concurrency only when operands and partial sums can reach them. Dataflow maps loop axes onto time and PE positions and chooses which values remain local. Identical MAC counts can require very different movement.

Output-stationary keeps an output partial sum local while supplying operands. Weight-stationary retains weights across inputs and moves or combines partial sums. Input-stationary retains input values for reuse across weights. Each name identifies a movement being reduced; it does not eliminate every other transfer. Describe the actual paths when combining reuse strategies.

Worked output-stationary mapping

P=4 spatial positions,M=2 output channels,K=9 reduction terms give eight outputs and 72 MACs. Four PEs each own one output and execute one term per cycle. The first four outputs take nine cycles, then the next four take nine: eighteen MAC cycles. Add one simultaneous result-write cycle after each group with no overlap, giving twenty total cycles. MAC slots are fully used, but full-operation utilization also includes writing.

Place two output channels for the same patch on different PEs and broadcast their shared input. Reading that nine-sample patch separately for both channels requires eighteen reads at the supply boundary; reading once and sharing requires nine. This does not count local PE reads or reuse between neighboring patches. State the boundary at which traffic is counted.

Keep only as many partial sums as local storage allows. Seven outputs on four PEs leave one unused PE in the second group. A validity mask must suppress its false result and utilization must count useful MACs.

Moving partial sums may require wider transfers than moving int8 operands. Record width and read/write counts for each value class. Reordering exact integer sums preserves their result, but intermediate clipping can break that equivalence. MIT's Eyeriss project provides a primary example of reuse-conscious accelerator design. The PE counts and schedules here are separate hypothetical teaching examples.

Try it yourself

Map P=3,M=2,K=8 onto four output-stationary PEs. What are MAC cycles and useful MAC-slot utilization, excluding writes?

Read the explanation

Six outputs require two groups and sixteen MAC cycles. There are 64 PE-cycle slots and 48 useful MACs, giving 75%.

Your choice applies to this browser. Change it any time using the footer.