TL;DR
VW-SDK is a novel mapping algorithm that optimizes how convolutional neural network (CNN) weights are laid out on Processing-In-Memory (PIM) arrays. By moving away from rigid square windows and allowing flexible rectangular shapes with partial channel tiling, it achieves up to a 4.67× speedup in inference compared to traditional mapping methods.
What Problem Does This Paper Address?
Processing-In-Memory (PIM) is a hardware paradigm where computation happens directly inside memory cells (like RRAM crossbars), drastically reducing the energy wasted moving data between a processor and RAM. However, there is a physical mismatch: modern CNN layers are massive, while PIM arrays are relatively small (e.g., 512x512).
To run a CNN on PIM, we must "map" the weights to the array. Early methods like im2col are simple but don't reuse data efficiently. A more recent approach called Shifted and Duplicated Kernel (SDK) mapping improves data reuse by duplicating kernels so multiple output pixels can be calculated at once.
The problem? Existing SDK methods are too rigid. They insist on using square-shaped windows and mapping entire channel depths at once. If a layer has too many channels to fit into the PIM array's rows, the SDK method essentially breaks down, failing to offer any speed advantage over the most basic mapping techniques.
Methods
The authors introduce Variable-Window SDK (VW-SDK), which introduces two key degrees of freedom:
- Rectangular Windows: Instead of forcing a 4x4 parallel window, the algorithm might find that a 4x5 or 4x3 window fits the physical dimensions of the PIM array better, leading to fewer wasted cycles.
- Channel Tiling: Rather than trying to map all input channels of a kernel at once, VW-SDK tiles them. By mapping only a portion of the channels, it frees up space in the PIM array to unroll more spatial windows. This allows the hardware to compute more output pixels in parallel, even for very "deep" layers.
The core of the paper is an optimization algorithm (Algorithm 1) that searches for the "Goldilocks" configuration—the specific window width, height, and channel tile size—that minimizes the total number of computing cycles for a specific CNN layer on a specific PIM array size.
Datasets
The researchers evaluated their mapping strategy using two industry-standard CNN architectures:
- VGG13: Known for its uniform structure and high parameter count.
- ResNet-18: A popular residual network used in many real-world computer vision tasks.
They simulated these networks across various PIM array sizes, ranging from 128x128 to 512x512, to demonstrate how their algorithm scales with hardware constraints.
Key Insights and Ideas
- The "Square" Trap: We often default to square windows in computer vision out of habit. This paper shows that in the constrained world of hardware crossbars, rectangular windows are often the key to maximizing utilization.
- Tiling for Parallelism: It sounds counter-intuitive to compute only part of a channel at a time, but the "aha moment" here is that the saved row-space allows for massive spatial parallelism. Computing 10 pixels partially is often faster than computing 2 pixels fully.
- Hardware-Aware Mapping: The "computable channel size" is a moving target. VW-SDK treats mapping as a dynamic optimization problem rather than a static one-size-fits-all rule.
Key Results
The quantitative gains are significant, especially as networks get deeper:
- Inference Speedup: On a 512x512 PIM array, VW-SDK improved inference speed by 4.67× compared to
im2coland 1.69× compared to the standard SDK algorithm for ResNet-18. - VGG13 Performance: It achieved a 3.16× speedup over
im2col. - Array Utilization: In deep layers (like Layer 5 of VGG13), VW-SDK reached a hardware utilization of 73.8%, whereas conventional methods plateaued at around 45%.
- Scalability: The speedup gap between VW-SDK and other methods actually increases as the PIM array size grows, suggesting this method is future-proof for next-generation hardware.
Limitations and Future Work
- Control Logic Overhead: While the paper focuses on the efficiency of the weight mapping, implementing variable window shapes in actual hardware requires a more complex controller to manage data feeding. The authors do not detail the specific power/area overhead of this controller.
- Sparsity: The current algorithm assumes dense weights. Future iterations could potentially integrate weight pruning or activation sparsity to further reduce cycles.
- Automated Search: While the current algorithm is efficient, integrating this into a full Neural Architecture Search (NAS) pipeline could allow for designing CNNs that are natively "PIM-friendly" from the start.
Summary updated