Foundations to Frontier
Tests
M. Robust, Verifiable and Onboard AI › M4 Edge and Onboard AI

Embedded Hardware: FPGAs, Edge GPUs and Neuromorphic Chips

Onboard AI runs on hardware with fixed power, memory and latency budgets: microcontrollers, edge GPUs, FPGAs, dedicated accelerators and neuromorphic chips. Choosing among them starts with three questions: is each layer limited by arithmetic or by memory traffic (the roofline model), how much energy each operation and memory access costs, and how the hardware's execution model (batched kernels, streaming pipelines, spikes) matches the workload. The exercises cost a small CNN on illustrative device classes, model energy from published per-operation figures, allocate FPGA compute units to a pipeline, run a network in fixed point, and convert a network to spiking neurons to see when spikes save energy.

Level 0: Foundation

★☆☆☆☆ Introductory⏱ 5 minGeneral audience. No mathematics required.

Different engines for different journeys

A sports car, a lorry and a bicycle all move things, but each suits a different job. Chips for AI are similar. A tiny microcontroller uses almost no power but is slow; a small GPU is fast when it can work on many inputs at once; an FPGA can be wired into a custom assembly line for one network; and neuromorphic chips imitate neurons that only do work when they receive a spike. Which one is best depends on how much power you have, how quickly you need each answer, and whether the data can stay on the chip.

🎮 Edge AI lab
conv1conv2conv3denseops/byte (log)

Ridge point 20.0 operations per byte; peak 1.00 Top/s.

conv1: 44.5 ops/byte, 1.00 Top/s, compute-bound
conv2: 139.4 ops/byte, 1.00 Top/s, compute-bound
conv3: 95.8 ops/byte, 1.00 Top/s, compute-bound
dense: 1.8 ops/byte, 88.40 Gop/s, memory-bound

Layers left of the ridge (red) wait for memory; batching reuses each weight for several inputs and moves them right. Device numbers are illustrative orders of magnitude.

Why engineers care

Reading a number from off-chip memory costs over a hundred times more energy than reading it from on-chip memory, and over a thousand times more than an 8-bit multiplication.

📝 Quick check (Level 0)
0/3 answered
  1. 1. A layer is memory-bound when…
  2. 2. FPGAs can be configured as…
  3. 3. Neuromorphic chips do work mainly when…

Level 1: Beginner

★★☆☆☆ Basic⏱ 20 minSecondary-school mathematics: arithmetic and elementary algebra.

By hand

  • Microcontrollers (MCUs): milliwatt processors with hundreds of kilobytes of on-chip memory; run small int8 networks (TinyML).
  • Edge GPUs: many parallel cores with fast memory; high throughput for batched, regular workloads, with per-kernel launch overhead.
  • FPGAs: reconfigurable logic, DSP blocks and on-chip RAM; networks become streaming dataflow pipelines with custom fixed-point arithmetic and deterministic latency.
  • ASIC accelerators: fixed-function chips such as tensor processing units and edge accelerators, typically systolic arrays of int8 multiply-accumulate units.
  • Neuromorphic chips: event-driven spiking neurons with local memory (TrueNorth, Loihi, SpiNNaker); energy scales with spike activity.
  • Roofline model: attainable performance = min(peak compute, arithmetic intensity × memory bandwidth); the ridge point separates memory-bound from compute-bound kernels.
  • Energy model: energy per operation and per memory access, dominated by data movement once data leaves the chip.
📝 Quick check (Level 1)
0/3 answered
  1. 1. The roofline's ridge point is…
  2. 2. Arithmetic intensity is…
  3. 3. A systolic array is…

Level 2: Intermediate

★★★☆☆ Intermediate⏱ 25 minUndergraduate students and practising engineers.

Costing a network on a device

Exercise 1.

  • A small CNN (three 3×3 convolutions with pooling and a dense layer) costed layer by layer: MACs, weights, activations.
  • Roofline time on three illustrative device classes and energy from 45 nm per-operation figures.
  • A two-hidden-layer MLP converted to a rate-coded spiking network with data-based weight normalization; accuracy and synaptic operations against time steps.

Practice.

  • Profile by layer: find which layers are memory-bound; those gain from fusion, batching or on-chip storage, not from faster arithmetic.
  • Fit the weights on chip when possible: quantize, prune or choose a smaller architecture before buying bandwidth.
  • Measure latency at the batch size you will deploy; per-kernel overheads dominate small models at batch 1.
  • On FPGAs, balance the pipeline: allocate resources in proportion to each layer’s work and choose word lengths per tensor.
  • Treat spiking hardware as an event-driven option: it pays off with sparse, temporally coded inputs, not as a drop-in for dense frame-based networks.
def roofline(dev, ops, nbytes):
    t_compute = ops / dev["peak"]; t_memory = nbytes / dev["bw"]
    return max(t_compute, t_memory)

def energy(macs, weight_bytes, dtype="int8", weights_in="sram"):
    mult, add = E_OP[dtype]
    return macs * (mult + add) + weight_bytes * E_MEM[weights_in]   # in pJ
🐍 Exercise 1: cost models for edge hardware
Count a CNN's operations, place its layers on the roofline of three device classes, estimate energy from per-operation costs, and convert an MLP to a spiking network.
📝 Quick check (Level 2)
0/3 answered
  1. 1. Per-kernel overhead matters most…
  2. 2. A pipeline's rate is set by…
  3. 3. Spiking hardware pays off with…

Level 3: Advanced

★★★★☆ Advanced⏱ 25 minGraduate level, with full derivations and proofs.

Theory

The roofline. A kernel performing W operations on Q bytes of memory traffic takes at least max(W/π, Q/β) on a device with peak π operations per second and bandwidth β, so its attainable rate is min(π, I·β) with arithmetic intensity I = W/Q. Below the ridge point I* = π/β, more bandwidth helps and faster arithmetic does not. A dense layer of width N at batch B performs 2BN² operations on about N² weight bytes (int8) plus 2BN activation bytes, so I ≈ 2BN²/(N² + 2BN) ≈ 2B for B ≪ N: batch 1 is deeply memory-bound and batching raises intensity linearly. A 3×3 convolution reuses each weight at every output position, so even at batch 1 its intensity is in the tens to hundreds.

Energy. In 45 nm CMOS an 8-bit multiply costs about 0.2 pJ and a 32-bit float multiply 3.7 pJ, while reading 32 bits costs about 5 pJ from a small SRAM and 640 pJ from DRAM. Weights that must be fetched from DRAM for every inference therefore dominate energy, and quantization helps twice: smaller arithmetic and fewer bytes to move.

Pipelines. In a streaming dataflow design every layer works concurrently on a different input, so throughput is f / max_l ⌈m_l/u_l⌉ for layer work m_l and u_l units at clock f. Any allocation needs at least Σm_l/U cycles per input for U units in total; allocating in proportion to m_l reaches this bound up to rounding.

Spiking neurons. An integrate-and-fire neuron with threshold 1, reset by subtraction and constant input z in [0, 1] emits N spikes in T steps with Tz − 1 < N ≤ Tz, so its rate approximates ReLU(z) with error below 1/T. Converted networks therefore need many steps for small approximation error, and every step costs synaptic operations and membrane updates. Normalizing weights by a high percentile of the activations instead of the maximum raises firing rates, trading more operations for faster convergence.

📝 Quick check (Level 3)
0/3 answered
  1. 1. For a dense layer with B ≪ N, intensity is about…
  2. 2. Rate error of an integrate-and-fire neuron after T steps is below…
  3. 3. A DRAM read costs roughly how much more than an SRAM read?

Level 4: Expert

★★★★★ Expert⏱ 30 minResearchers: original papers and open problems.

How do latency and energy compare for a small CNN on a microcontroller, an edge GPU and an FPGA, and when does a converted spiking network save energy over an int8 ANN?

History.

  • Xilinx sold the first commercial FPGA, the XC2064, in 1985; C. Mead described neuromorphic electronic systems in 1990.
  • R. Raina, A. Madhavan and A. Ng (2009) trained deep networks on GPUs; AlexNet (2012) was trained on two consumer GPUs.
  • S. Williams, A. Waterman and D. Patterson (2009) introduced the roofline model; M. Horowitz (2014) tabulated the energy of operations and memory accesses.
  • P. Merolla and colleagues (2014) presented IBM’s TrueNorth chip; S. Furber and colleagues (2014) the SpiNNaker system; M. Davies and colleagues (2018) Intel’s Loihi.
  • N. Jouppi and colleagues (2017) described Google’s tensor processing unit; Y. Umuroglu and colleagues (2017) the FINN framework for FPGA dataflow networks; J. Duarte and colleagues (2018) hls4ml.
  • P. Diehl and colleagues (2015) and B. Rueckauer and colleagues (2017) developed weight normalization for converting ANNs to spiking networks.

Exercise 2.

  • The CNN (2.8 million MACs, 24,234 weights, int8, batch 1) on three illustrative device classes: microcontroller (0.4 GOPS, 0.4 GB/s, 0.05 W), edge GPU (1 TOPS, 50 GB/s, 10 W, 10 µs overhead per layer), FPGA (0.3 TOPS, 10 GB/s, 5 W, 0.2 µs per layer). Energy is power × latency.
  • An MLP (20-48-48-10) trained on 1,500 points and tested on 1,000, as an int8 ANN and as a converted spiking network for T = 5 to 50 steps, with energy from the same 45 nm figures including membrane-state updates.

Seed 0, CNN:

device class latency inferences per second energy per inference memory-bound layers
microcontroller 14.012 ms 71 0.701 mJ none
edge GPU 0.046 ms 21,921 0.456 mJ dense
FPGA 0.020 ms 51,150 0.098 mJ dense

Arithmetic and SRAM weight reads alone: 0.67 µJ per inference.

Seed 0, MLP: int8 ANN accuracy 0.932 at 5.54 nJ per input.

spiking, T steps accuracy synaptic operations energy
5 0.875 1,006 5.36 nJ
10 0.925 2,708 10.19 nJ
20 0.934 6,174 19.92 nJ
50 0.935 16,608 49.18 nJ

Seeds 1 and 2: ANN accuracy 0.933 and 0.934; spiking accuracy at T = 5 was 0.854 and 0.864, at T = 20 0.933 and 0.932, with energy 5.38 and 5.17 nJ at T = 5 and 20.01 and 19.04 nJ at T = 20.

Findings.

  • At batch 1 the edge GPU spent about 88% of its 46 µs on per-layer overhead (40 of 46 µs), so the FPGA pipeline was faster and used about a fifth of the energy under these illustrative parameters.
  • Only the dense layer was memory-bound; the convolutions reuse each weight hundreds of times.
  • Device-level energy was about 150 to 1,050 times the arithmetic-and-SRAM estimate, the gap being static power, control and data movement that a per-operation model omits.
  • The spiking network was cheaper than the ANN only at T = 5, where it lost 6 to 8 accuracy points in all seeds; it matched the ANN at T = 20 for about 3.5 times the energy.
🐍 Exercise 2 (research): how do latency and energy compare for a small CNN on a microcontroller, an edge GPU and an FPGA, and when does a converted spiking network save energy over an int8 ANN?
Compare a CNN's latency and energy on three illustrative device classes, and an int8 ANN with its spiking conversion.

Embedded AI hardware in practice

  • Spacecraft and drones use radiation-tolerant FPGAs and processors, and increasingly commercial edge GPUs and accelerators with mitigation (topics M3-1, M3-2 and M4-5).
  • Phones and microcontrollers run quantized networks on neural processing units or optimized int8 kernels within milliwatt budgets (topics M4-2 and M4-3).
  • Event cameras and neuromorphic processors are paired for low-latency sensing, where inputs are sparse in time and spiking computation is natural.

References

  1. S. Williams, A. Waterman and D. Patterson (2009). “Roofline: an insightful visual performance model for multicore architectures.” Communications of the ACM.
  2. M. Horowitz (2014). “Computing’s energy problem (and what we can do about it).” IEEE International Solid-State Circuits Conference.
  3. N. Jouppi and colleagues (2017). “In-datacenter performance analysis of a tensor processing unit.” ISCA.
  4. Y. Umuroglu and colleagues (2017). “FINN: a framework for fast, scalable binarized neural network inference.” FPGA.
  5. M. Davies and colleagues (2018). “Loihi: a neuromorphic manycore processor with on-chip learning.” IEEE Micro.
  6. B. Rueckauer, I.-A. Lungu, Y. Hu, M. Pfeiffer and S.-C. Liu (2017). “Conversion of continuous-valued deep networks to efficient event-driven networks for image classification.” Frontiers in Neuroscience.
  7. P. Merolla and colleagues (2014). “A million spiking-neuron integrated circuit with a scalable communication network and interface.” Science.