At the edge, resources are finite. Learn the engineering strategies used to fit intelligence into tiny memory footprints and make batteries last for years.
1The Edge Memory Hierarchy
Microcontrollers use two primary types of memory. Flash Memory (Read-Only) is large (0.5MB - 4MB) and stores the AI model's constant weights. SRAM (Random Access Memory) is tiny (32KB - 512KB) and stores the 'activations'βthe temporary results of math calculations. If your model has large layers, your activations might exceed SRAM, causing a memory overflow. Optimizing for memory involves reducing layer size or using techniques like 'Operator Fusion' to reuse buffers.
# The Resource Challenge
# Memory: Kilobytes (SRAM/Flash)
# Power: Milliwatts (Battery Life)2Duty Cycling & Deep Sleep
An MCU running at full clock speed consumes significant power. To achieve multi-year battery life, we use Duty Cycling. The device stays in a low-power Deep Sleep state where the CPU is powered down. A timer or a 'Wake-up Pin' triggers the device to boot, sample sensor data, run a quick AI inference, and immediately return to sleep. This reduces the average current draw from 50mA to less than 1mA.
// Tensor Arena Sizing
const int kTensorArenaSize = 4 * 1024; // 4KB
uint8_t tensor_arena[kTensorArenaSize];
// Error: Arena size 4096 is less than required 51203Power Profiling
Not all operations are equal. Moving data over Wi-Fi or Bluetooth (Radio TX) is the most expensive operation in an edge device. Running AI inference locally is often 10x to 100x more energy-efficient than transmitting raw data to the cloud. This 'Local Intelligence' is the primary driver for Edge AI, enabling smart sensors that process data on-site and only transmit a few bytes when an event is detected.
Memory Type: ???