CoCoPIE XGen: A Full-Stack AI-Oriented Optimizing Framework

Xiaofeng Li, Bin Ren, Xipeng Shen, Yanzhi WangarXiv 2022 · DOI

Introduction

CoCoPIE XGen is a "full-stack" optimizing framework designed to bridge the growing disparity between the massive computational demands of Deep Neural Networks (DNNs) and the limited capabilities of edge hardware. By unifying model compression, compiler optimizations, and runtime scheduling into a single co-designed pipeline, XGen achieves significant performance gains—up to 16x speedups over industry standards like PyTorch Mobile and TensorFlow Lite—without sacrificing model accuracy.

The DNN-Hardware Speed Gap

The primary motivation for XGen is the "DNN-hardware speed gap." As AI models evolve, their computational requirements are scaling at a rate that far outpaces the performance improvements of the hardware intended to run them, particularly in the context of mobile and IoT devices.

The widening gap between Deep Learning computational demands and hardware performance improvements.

Existing optimization tools (e.g., TVM, TensorRT, MNN) often operate in isolation. A model might be pruned, then compiled, and finally scheduled by separate, uncoordinated tools. This "siloed optimization" fails to capture the synergies possible when these layers communicate, leaving substantial performance potential untapped. XGen aims to replace these silos with a holistic, cross-layer co-design approach.

The CoCoPIE XGen Framework

XGen's "full-stack" approach consists of four primary components that work in a hand-in-hand manner to optimize the entire deployment pipeline.

The CoCoPIE XGen full-stack optimization pipeline, integrating model compression, compilation, and runtime execution.
  1. CoCo Model Optimizer: Instead of traditional pruning, it uses pattern-based and block-based pruning. Pattern-based pruning creates fine-grained, hardware-friendly shapes that fit perfectly into the SIMD (Single Instruction, Multiple Data) units of mobile CPUs and GPUs, providing a "sweet spot" between accuracy and speed.
  2. CoCo DNN Compiler: This features two levels of optimization. High-level optimizations include DNNFusion, which merges operators to reduce memory access. Low-level optimizations include Filter Kernel Reordering, which groups similar kernels to minimize thread divergence.
  3. CoCo DNN Runtime (XEngine): A lightweight system that uses execution "knobs" to adapt to real-time conditions, ensuring efficient co-scheduling of multiple AI tasks (e.g., in autonomous driving scenarios).
  4. CAPS (Compiler-Aware Neural Architecture & Pruning Co-Search): The "brain" of the system, CAPS uses reinforcement learning to search for the best model architecture and pruning strategy specifically tailored for the target compiler and hardware.

Key Insights and Results

A core philosophy of XGen is that compiler-awareness is non-negotiable. Designing a model architecture without considering how the compiler will translate it into machine code is inherently inefficient. By exploiting "Deep Reuse"—identifying and reusing similar activation map vectors—XGen can potentially halve inference time for certain CNNs.

In empirical evaluations, XGen demonstrated dominant performance across various hardware platforms:

  • Mobile Performance: On a Samsung Galaxy S10, XGen outperformed TFLite by 6.8x and PyTorch Mobile by 16.5x on average across multiple models.
  • Energy Efficiency: XGen is 8x more energy-efficient than TVM on mobile devices, even surpassing specialized hardware like Google’s Cloud TPU-V2 in specific scenarios.
  • Real-Time Edge AI: XGen enabled the first real-time activity recognition (S3D model) on a smartphone, achieving 18.31ms per frame (a 22.6x speedup over PyTorch).

Conclusion

CoCoPIE XGen proves that the most significant gains in AI performance come not from individual "tricks," but from full-stack synergy. While the current focus is on inference, the framework's ability to ensure pruning strategies are designed for the compiler, and compiler outputs are optimized for the runtime, sets a new standard for high-performance AI on resource-constrained edge devices.

Summary updated

BibTeX
@misc{li2022cocopie,
  author = {Xiaofeng Li and Bin Ren and Xipeng Shen and Yanzhi Wang},
  title = {{CoCoPIE XGen: A Full-Stack AI-Oriented Optimizing Framework}},
  year = {2022},
  eprint = {2206.10620},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2206.10620},
}
Figure