NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

StreamNet: Memory-Efficient Streaming Tiny Deep Learning Inference on the Microcontroller

Hong Sheng Zheng, Yu-Yuan Liu, Chen-Fong Hsu, Tsung Tai YehNeurIPS 2023

TL;DR

StreamNet is a novel inference framework that dramatically speeds up deep learning on microcontrollers (MCUs) by eliminating the redundant computations found in existing memory-saving techniques. By introducing a "stream buffer" to reuse data between processing patches, it achieves a 7.3x speedup and an 81% reduction in operations compared to state-of-the-art methods, all while fitting within the strict SRAM limits of a typical MCU.

What Problem Does This Paper Address?

Microcontrollers (MCUs) are the backbone of the "Internet of Things," but they are incredibly resource-constrained, often possessing only a few hundred kilobytes of SRAM. Standard deep learning inference is "layer-wise," meaning the chip tries to load an entire intermediate data tensor into memory at once. For modern, high-accuracy models, these tensors are often too large for the MCU's SRAM.

Memory vs. Computation Trade-off in Patch-based Inference

To solve this, researchers previously developed patch-based inference, which breaks large tensors into small, overlapping patches. While this saves memory, it creates a "computational nightmare": because patches overlap to account for the receptive field of filters, the MCU ends up recalculating the same pixels multiple times. As shown above, the first layer of a model can require 33x more computations (MACs) than the standard approach. StreamNet aims to provide the memory benefits of patches without this massive performance penalty.

Methods

The authors introduce StreamNet, which centers around three key technical innovations to eliminate redundant computations:

StreamNet-1D Processing vs. Standard Patch-based Inference
  1. The Stream Buffer: Instead of discarding the results of a patch calculation, StreamNet identifies the "overlapping areas" that will be needed by the next patch and stores them in a dedicated stream buffer. This allows the system to "reuse" data rather than recomputing it.
  2. 1D and 2D Streaming:
    • 1D Streaming reuses data along a single dimension (e.g., horizontally).
  3. 2D Streaming reuses data across both height and width. While 2D is more efficient at eliminating redundant calculations, it requires more SRAM for the buffer.
  4. Output Padding Bypassing: Standard convolution kernels often perform calculations on "padding" (zero-value pixels at the edges). In patch-based inference, this overhead is magnified. StreamNet uses specialized kernels that intelligently skip these useless zero-value computations.
  5. Parameter Selection Framework: Since every MCU has a different memory budget, the authors created an automated algorithm. It searches for the optimal "mix" of 1D and 2D streaming and patch sizes to maximize speed for a specific SRAM constraint.

Datasets and Evaluation

The researchers evaluated StreamNet using 10 TinyML models from the MCUNetV2 model zoo, including MobileNetV2-w0.35 (MB2), Proxyless-w0.3 (PL), MCUNet-VWW (Visual Wake Words models 0, 1, and 2), and MCUNet-ImageNet (Models 0 through 4).

All evaluations were performed on actual hardware: an ARM Cortex-M7 (STM32F767ZI) microcontroller.

Key Insights and Results

  • Redundancy is the "Notorious" Bottleneck: The paper highlights that the primary reason patch-based inference feels slow isn't the memory management, but the sheer volume of redundant Multiply-Accumulate (MAC) operations.
  • The Memory-Speed Trade-off: There is a direct relationship between buffer size and speed. 2D streaming is the "gold standard" for speed but the "most expensive" for memory. StreamNet’s ability to mix 1D and 2D layers allows it to "ride the line" of the SRAM limit perfectly.
  • Massive Speedup: StreamNet significantly outperforms the previous state-of-the-art (MCUNetV2), achieving a geometric mean of 7.3x speedup using 2D streaming and 3.4x using 1D streaming.
  • Efficiency and Latency: It reduced the number of MAC operations by 81% on average. For the Proxyless-w0.3 model, latency dropped from 6,296 ms to just 676 ms—a massive improvement for real-time applications.
  • Memory Footprint: It achieved these gains while maintaining a peak SRAM usage that is roughly 47% to 66% lower than traditional layer-wise inference.

Limitations and Future Work

While StreamNet is memory-efficient, the stream buffer itself does occupy SRAM. On devices with extremely limited memory (e.g., <64KB), the buffer might leave too little room for the model weights or input patches, forcing a fallback to slower 1D streaming. Additionally, the current implementation required manual optimization of TinyEngine kernels to support specific filter sizes (5x5 and 7x7). Expanding this to a wider variety of operators and extending the automated parameter selection framework to more complex neural network architectures represent promising future directions.

Summary updated

BibTeX
@inproceedings{zheng2023streamnet,
  author = {Hong Sheng Zheng and Yu-Yuan Liu and Chen-Fong Hsu and Tsung Tai Yeh},
  title = {{StreamNet: Memory-Efficient Streaming Tiny Deep Learning Inference on the Microcontroller}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2023},
  url = {https://openreview.net/forum?id=5t5u8PQa2T},
}
Figure