TL;DR
The paper introduces Fused Depthwise Tiling (FDT), a novel memory optimization technique for Deep Neural Network (DNN) inference on highly constrained TinyML devices. By tiling along the channel (depthwise) dimension instead of traditional spatial dimensions, FDT reduces peak RAM usage with absolutely zero runtime overhead. Furthermore, it expands automated optimization to non-convolutional layers like dense (fully-connected) layers and embedding lookups.
What Problem Does This Paper Address?
Deploying deep learning models to the "Extreme Edge"—such as microcontrollers with only a few hundred kilobytes of SRAM—is heavily bottlenecked by memory. During DNN inference, large intermediate activation buffers must be stored in RAM.
To combat this, researchers use a technique called Fused Feature Map Tiling (FFMT), which splits intermediate tensor buffers spatially into smaller partitions that can be computed independently. However, FFMT has two major flaws:
- Runtime Overhead: For convolution kernels larger than 1x1, spatial partitions overlap. This overlap requires redundant calculations, introducing significant latency penalties.
- Limited Applicability: FFMT is strictly designed for convolutional layers with spatial locality. It cannot optimize dense layers, 1x1 convolutions that reduce to a 1x1 spatial size, or embedding lookups.
This paper addresses these gaps by proposing a tiling method that eliminates the spatial overlap penalty and works across a broader variety of layer types.
Methods
Fused Depthwise Tiling (FDT)
Instead of slicing tensors along spatial feature maps, FDT slices them along the depthwise (channel) dimension.
Because the two-dimensional convolutions or dense operations themselves are not split spatially, FDT completely avoids any partition overlap, resulting in zero runtime overhead. For layers like dense layers, where every output neuron depends on all inputs, FDT computes partial sums for each channel partition and then recombines them using an element-wise addition (Merge) operation.
Automated Tiling Exploration Flow
The authors integrated FDT into an end-to-end compiler flow using Apache TVM. The framework automatically optimizes any given DNN using three main components:
- Block-based Path Discovery: Automatically scans the DNN graph to identify "critical buffers" (the largest buffers dictating peak memory) and explores valid chain configurations for both FFMT and FDT.
- Memory-Aware Scheduling: Uses a polynomial-time algorithm to schedule series-parallel graphs and a Mixed Integer Linear Program (MILP) / heuristic approach for complex graphs to minimize buffer lifetimes.
- Memory Layout Planning: An MILP solver maps non-overlapping buffers to the same physical memory addresses to minimize total peak RAM.
Datasets
The method was evaluated using seven distinct, 8-bit quantized models representing realistic TinyML applications:
- Keyword Spotting (KWS): From the MLPerf Tiny benchmark.
- Text Sentiment Analysis (TXT): A standard text classification network.
- Magic Wand (MW): Accelerometer-based gesture recognition.
- PoseNet (POS): Image-based pose estimation.
- MobileNet V2 SSDLite (SSD): Object detection on the COCO dataset.
- Cifar10 Classifier (CIF): A standard convolutional image classifier.
- Radar Gesture Recognition (RAD): A custom CNN processing radar sensor data.
Key Insights and Ideas
- Challenging the Status Quo: Prior literature asserted that cross-layer tiling across channel dimensions was impossible because all input channels are typically required to compute an output feature. FDT bypasses this by accumulating partial products across fused layers and deferring the activation function until after a final merge step.
- The Latency-Memory Trade-off Space: FFMT often yields higher memory savings than FDT but at the cost of high computational overhead. FDT expands the design space, acting as a "safe" alternative that guarantees memory reduction without making the model slower.
- Activation Function Constraints: Because activation functions (like ReLU) are non-linear, $f(a) + f(b) \neq f(a+b)$. Therefore, FDT can only fuse a maximum of two consecutive partitioned operations before requiring a
Mergeblock to apply the activation function correctly.
Key Results
The authors compared untiled networks against automated deployment using either FFMT or FDT:
- Unlocking New Models: For the TXT and KWS models, FFMT could not be applied at all (0% savings). FDT achieved a massive 76.2% RAM reduction for the TXT model and an 18.1% RAM reduction for KWS.
- Eliminating Latency Penalties: For PoseNet (POS), FFMT reduced memory by 45.3% but introduced a staggering 45.1% runtime overhead (MAC operations). FDT offered a zero-overhead alternative, saving 4.4% RAM with 0% extra latency. Similarly, for the CIF model, FDT eliminated a 9.0% FFMT runtime overhead while still providing a 5.0% memory saving.
- Averages: Across all seven models, FFMT saved more RAM on average (32.7% vs 24.7%) but suffered an average runtime overhead of 7.8%, whereas FDT consistently maintained 0% runtime overhead.
Limitations and Future Work
- Buffer Availability Requirements: FDT requires that the input buffer to the first tiled layer and the output buffer of the second tiled layer remain fully available in memory. If these boundary buffers are exceptionally large, FDT's memory saving potential is diminished.
- Strict Fusion Limits: Due to the mathematical constraints of non-linear activations, FDT sequences are strictly limited to two consecutive layers.
- Future Directions: The authors noted that while combining FFMT and FDT simultaneously within the same network didn't beat single-method optimizations in this specific benchmark suite, exploring hybrid multi-dimensional tiling (spatial + depthwise simultaneously) remains a promising avenue for complex, next-generation TinyML architectures.
Summary updated