SIMD Dataflow Co-optimization for Efficient Neural Networks Inferences on CPUs

Cyrus Zhou, Zack Hassman, Ruize Xu, Dhirpal Shah, Vaughn Richard, Yanjing Li · DOI

Abstract

Modern CPUs utilize SIMD (Single Instruction, Multiple Data) units to accelerate neural network inference, yet existing compilers often fail to fully exploit these hardware capabilities. This paper introduces YFlows, a framework that systematically explores dataflows—the specific order of computations—to optimize data movement between memory and high-speed registers. By formalizing concepts like anchoring and auxiliary stationarity, YFlows reduces redundant memory operations. Experimental results on standard deep learning benchmarks show that YFlows achieves up to a 3.5x speedup for 8-bit networks and a 4.8x speedup for binary networks compared to state-of-the-art tools like TVM across ARM and x86 architectures.

Introduction

While specialized AI accelerators like GPUs and TPUs dominate high-performance computing, a vast majority of neural network inference occurs on standard CPUs, particularly in edge devices. Modern CPUs feature SIMD units designed for parallel data processing; however, current software implementations often rely on suboptimal "weight stationary" approaches or fragile auto-vectorization, leaving many registers idle. YFlows addresses this performance gap by systematically exploring the dataflow space to maximize register utilization and minimize memory traffic.

Methods

YFlows employs a heuristic-guided analysis and an automated code generator to optimize convolutional layers. The framework centers on three primary dataflows: Input Stationary (IS), Weight Stationary (WS), and Output Stationary (OS).

Conceptual diagram of dataflow optimization in YFlows, illustrating the movement of Inputs, Weights, and Outputs.

A key innovation is the distinction between "anchoring" data types, which dictate loop order, and "auxiliary" data types, which are stashed in remaining SIMD registers. This "stashing" technique treats registers as a manually managed cache, significantly reducing expensive memory read/write operations. The automated code generator produces optimized C++ code for ARM or x86, incorporating techniques like loop unrolling and operator fusion to ensure high performance without the errors associated with manual intrinsic programming.

Key Results

Evaluation on ResNet, VGG, and DenseNet models using INT8 and binary quantization demonstrates significant performance gains. For INT8 networks, YFlows achieved a median speedup of 1.93x to 3.5x over Apache TVM. For Binary Neural Networks (BNNs), speedups reached up to 4.8x compared to state-of-the-art SIMD implementations and over 10x compared to optimized bitserial methods.

Relative latency heatmaps comparing OS, IS, and WS dataflows across various configurations. The OS dataflow consistently shows the lowest relative latency.

A critical finding was that Output Stationary (OS) consistently outperformed IS and WS. By keeping output values in registers until fully computed, the system avoids frequent, redundant writes to memory and simplifies the reduction-sum operations that often bottleneck SIMD performance. The framework proved effective on both ARM (Neoverse-N1) and x86 architectures, confirming that the bottleneck was the dataflow logic rather than hardware limitations.

Conclusion

YFlows demonstrates that systematic dataflow optimization can unlock significant performance on standard CPU hardware. By treating SIMD registers as a precious resource and prioritizing Output Stationary flows, the framework achieves substantial speedups over industry-standard compilers. Future work will explore extending these optimizations to Transformer architectures and leveraging newer hardware extensions like Intel AMX (Advanced Matrix Extensions).

Summary updated

BibTeX
@inproceedings{zhou2024simd,
  author = {Cyrus Zhou and Zack Hassman and Ruize Xu and Dhirpal Shah and Vaughn Richard and Yanjing Li},
  title = {{SIMD Dataflow Co-optimization for Efficient Neural Networks Inferences on CPUs}},
  booktitle = {CC},
  year = {2024},
  doi = {10.1145/3640537.3641566},
}
Figure