Processing Element (PE): one MAC unit — computes a×b+c.
Systolic array: a 2-D grid of PEs where data flows rhythmically (like a heartbeat — Greek systole) between neighbours, no global memory access per step.
On-chip SRAM / scratchpad: holds weights & activations near the compute.
Do it the dumb way: for each MAC, load Xik and Wkj from memory. That's 2×MNK memory reads. WHY bad? A DRAM read ≈ 640 pJ; a MAC ≈ 0.2 pJ. The memory tax dominates by 1000×.
Arrange PEs in a K×N grid. WeightsWkj are loaded and held stationary inside PEs (this is called weight-stationary). ActivationsXik flow left→right, one column of data entering per clock. Partial sums flow top→bottom, each PE doing:
psumout=psumin+Xin×Wstored
Because each activation, once injected, marches across a whole row of PEs, one memory load feeds many multiplies. After the array fills (the "pipeline fill" latency), it produces a full result column every cycle.
A domain-specific accelerator built around a spatial array of MAC units, optimised for neural-network matrix multiply using data reuse and low precision to maximise ops/joule.
Multiply-accumulate: compute a×b+c; one multiply plus an add into a running accumulator.
What is a systolic array?
A 2-D grid of processing elements where data flows rhythmically between neighbours, enabling massive data reuse without per-step global memory access.
Why is memory, not arithmetic, the real cost?
A DRAM read costs ~1000× more energy than a MAC, so naive loading dominates; reuse amortises fetches.
Formula for MACs in an M×K by K×N matmul?
M⋅N⋅K.
Peak throughput of an R×C PE array at clock f?
R⋅C⋅f MACs/s, i.e. 2RCf ops/s.
Why does low precision (int8) give more MACs per area?
Multiplier area/energy scales ~with (bit-width)², so int8 is ~16× smaller than fp32.
What is utilisation and why care?
actual MACs ÷ (R·C·cycles); peak TOPS is meaningless if the array sits idle due to small/mismatched layers or memory limits.
"Weight-stationary" means what?
Weights are loaded once and held in each PE while activations stream through, maximising weight reuse.
Why isn't peak TOPS the real performance?
It assumes 100% utilisation and unlimited bandwidth; real workloads are often memory-bound or under-fill the array.
Recall Feynman: explain to a 12-year-old
Imagine a huge factory of tiny workers arranged in a giant square grid. Each worker only knows ONE trick: "multiply two numbers and add the answer to my pile." Numbers walk along the rows like people on a conveyor belt, and each worker grabs a number as it passes, does its little trick, and passes the running total downward. Because thousands of workers all do their trick at the same time, a mountain of maths that would take your laptop ages gets done in a blink. That grid of tiny multiply-workers is an NPU — a calculator factory built just for the kind of maths that AI needs.
Dekho, ek neural network chalane mein 90% kaam sirf matrix multiply ka hota hai — matlab bahut saare "multiply karo aur jodo" (MAC) operations baar-baar. CPU ek time pe thode hi operations karta hai aur apni zyada energy control cheezon (fetch, decode, branch) mein jala deta hai. NPU ka idea simple hai: agar ek hi kaam crore baar karna hai, to hardware ko usi shape mein bana do — ek bada grid of tiny multiply units. Isko systolic array kehte hain, jahan data dil ki dhadkan ki tarah rhythmically neighbour PEs mein flow karta hai.
Sabse bada catch yeh hai ki asli kharcha memory se data laana hai, multiply karna nahi. DRAM se ek number laana ek MAC se ~1000× zyada energy leta hai. Isiliye NPU "data reuse" pe focus karta hai — ek baar weight load karo aur usse baar-baar use karo (weight-stationary). Isse memory ka tax bahut kam ho jaata hai aur efficiency (ops per joule) jump kar jaati hai.
Do aur tricks: low precision (int8, fp16). Multiplier ka size bit-width ke square ke proportional hota hai, to int8 fp32 se ~16× chhota — same silicon mein 16× zyada MACs fit ho jaate hain, aur accuracy bhi bahut kam giri. Aur width — 256×256 array matlab 65536 MACs har cycle, isiliye modest clock pe bhi CPU se 100× fast.
Ek warning: peak TOPS ko blindly mat maano. Woh 100% utilisation aur unlimited bandwidth maan ke bola jaata hai. Agar layer chhoti hai ya memory-bound hai, to array aadha khaali baithta hai. Isliye hamesha effective throughput aur utilisation dekho, sirf marketing number nahi.