Introduction
Sparse neural networks are increasingly favored for their computational efficiency. However, on modern hardware, the primary bottleneck is often not floating-point operations (FLOPs) but data movement (I/O) between slow DRAM and fast cache memory. For instance, on an NVIDIA V100, loading a value from global memory can take over 500 times longer than a single math operation. While dense networks have predictable access patterns, the unstructured nature of sparse networks often leads to inefficient "layer-by-layer" execution, forcing hardware to repeatedly evict and reload neuron values. This paper introduces a rigorous theoretical framework and a "Connection Reordering" algorithm to minimize these I/O costs.
Theoretical Framework and Connection Reordering
The authors propose shifting the paradigm of neural network inference from traditional node-based, layer-by-layer processing to an edge-based approach.
The core of this approach lies in three main components:
- Theoretical Bounds: The paper proves that for any sparse Feed-Forward Neural Network (FFNN), the optimal number of I/Os is bounded within a factor of 2 by basic network properties like the number of connections and neurons.
- Connection Reordering via Simulated Annealing: Instead of processing layers, the algorithm finds a "topological order" of individual connections. By using simulated annealing, it maximizes data reuse—ensuring that connections sharing a neuron are processed close together in time to keep that neuron in cache.
- Compact Growth: A constructive algorithm that builds networks from scratch to be mathematically guaranteed as I/O-optimal for a specific fast-memory size ($M$).
Experimental Evaluation and Key Results
The methods were evaluated using both synthetic randomly-sparse FFNNs (varying density from 0.1% to 100%) and a real-world pruned $BERT_{LARGE}$ model.
The results demonstrate significant improvements over standard execution:
- Massive Speedups: Reordered inference achieved up to 45x speedup on an Intel Xeon CPU compared to standard sparse matrix-matrix multiplication (MKL's CSRMM) at 0.1% density.
- I/O Reduction: Simulated annealing reduced total I/Os by up to 43.5% compared to a naive ordering, reaching within 97.4% of the theoretical lower bound.
- Scalability: Performance gains scale linearly with network depth and breadth, making the method increasingly valuable for larger models.
Discussion and Future Work
While this framework provides a strong foundation for I/O-efficient inference, several areas remain for future exploration. The current theory focuses on static sparsity patterns and does not yet account for dynamic sparsity or the training phase. Additionally, real-world hardware often features complex multi-level cache hierarchies, which may require extending the reordering logic. Finally, there is an ongoing challenge in balancing irregular sparse access patterns with the hardware's preference for contiguous data in SIMD (vector) instructions.
Summary updated