Skip to main content
QUICK REVIEW

[Paper Review] Optimizing CNN Model Inference on CPUs

Yizhi Liu, Yao Wang|arXiv (Cornell University)|Sep 7, 2018
Advanced Neural Network ApplicationsComputer Science46 references48 citations
TL;DR

NeoCPU presents a framework that optimizes CNN inference end-to-end on CPUs without third-party libraries, achieving up to 3.45x latency reduction over state-of-the-art. It performs operation- and graph-level optimization on x86 and ARM architectures and is open-sourced as part of TVM.

ABSTRACT

The popularity of Convolutional Neural Network (CNN) models and the ubiquity of CPUs imply that better performance of CNN model inference on CPUs can deliver significant gain to a large number of users. To improve the performance of CNN inference on CPUs, current approaches like MXNet and Intel OpenVINO usually treat the model as a graph and use the high-performance libraries such as Intel MKL-DNN to implement the operations of the graph. While achieving reasonable performance on individual operations from the off-the-shelf libraries, this solution makes it inflexible to conduct optimizations at the graph level, as the local operation-level optimizations are predefined. Therefore, it is restrictive and misses the opportunity to optimize the end-to-end inference pipeline as a whole. This paper presents \emph{NeoCPU}, a comprehensive approach of CNN model inference on CPUs that employs a full-stack and systematic scheme of optimizations. \emph{NeoCPU} optimizes the operations as templates without relying on third-parties libraries, which enables further improvement of the performance via operation- and graph-level joint optimization. Experiments show that \emph{NeoCPU} achieves up to 3.45$ imes$ lower latency for CNN model inference than the current state-of-the-art implementations on various kinds of popular CPUs.

Motivation & Objective

  • Motivate efficient CNN inference on general-purpose CPUs due to wide CPU deployment and rising CNN use in servers, edge, and client devices.
  • Propose a framework that combines operation- and graph-level optimizations without reliance on third-party libraries.
  • Demonstrate end-to-end optimization across diverse CPU architectures (x86 and ARM).
  • Show that joint layout and operation templating yields superior end-to-end performance over existing solutions.

Proposed method

  • Develop NeoCPU as a full-stack, template-based convolution (CONV) implementation that leverages SIMD/FMA without third-party kernels.
  • Introduce a graph-level optimization that eliminates unnecessary data layout transformations by maintaining an optimized NCHW[x]c layout across CONV layers wherever possible.
  • Implement a two-stage optimization scheme search: local per-CONV schedule search and global graph-level DP-based or PBQP-approximate search to select end-to-end layouts.
  • Integrate with TVM to enable own operation templates and graph-level optimizations while pre-transforming invariant kernel weights at compile time.
  • Compare against framework-based (MXNet/TensorFlow) and framework-agnostic (OpenVINO) baselines across multiple CPU vendors.

Experimental results

Research questions

  • RQ1Can end-to-end CNN inference on CPUs be significantly accelerated without relying on third-party high-performance libraries?
  • RQ2What is the impact of joint operation- and graph-level optimizations on end-to-end latency across diverse CPU architectures?
  • RQ3How does data layout management (NCHW[x]c) and layout transformations affect overall performance and overhead?
  • RQ4What is the effectiveness of local vs global optimization searches in achieving near-best end-to-end performance?

Key findings

  • NeoCPU achieves up to 3.45x lower latency for CNN model inference versus current state-of-the-art implementations on various CPUs.
  • It delivers high performance for 13/15 networks on Intel Skylake, 14/15 on AMD EYPC, and all 15 on ARM Cortex-A72 CPUs.
  • A standalone, framework-agnostic module with minimal dependency footprints is produced, enabling easy deployment across platforms.
  • Open-source release of the approach is integrated with the TVM project, promoting broader adoption.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.