Fast DistilBERT on CPUs

Haihao Shen, Ofir Zafrir, Bo Dong, Hengyu Meng, Xinyu Ye +5 more
10/27/2022
cs.CLcs.AIcs.LG
transformer-attention

Official code: intel/intel-extension-for-transformers (2,173 stars, Python, Apache-2.0, last commit 2024-10-08).

Abstract

Transformer-based language models have become the standard approach to solving natural language processing tasks. However, industry adoption usually requires the maximum throughput to comply with certain latency constraints that prevents Transformer models from being used in production.

Show full abstract

To address this gap, model compression techniques such as quantization and pruning may be used to improve inference efficiency. However, these compression techniques require specialized software to apply and deploy at scale. In this work, we propose a new pipeline for creating and running Fast Transformer models on CPUs, utilizing hardware-aware pruning, knowledge distillation, quantization, and our own Transformer inference runtime engine with optimized kernels for sparse and quantized operators. We demonstrate the efficiency of our pipeline by creating a Fast DistilBERT model showing minimal accuracy loss on the question-answering SQuADv1.1 benchmark, and throughput results under typical production constraints and environments. Our results outperform existing state-of-the-art Neural Magic's DeepSparse runtime performance by up to 50% and up to 4.1x performance speedup over ONNX Runtime. Source code is publicly available at https://github.com/intel/intel-extension-for-transformers.

View on arXivView PDF

Code Implementations(1)

Apache-2.0

⚡ Build your chatbot within minutes on your favorite device; offer SOTA compression techniques for LLMs; run LLMs efficiently on Intel Platforms⚡

2,173213Python, C++Nov 11, 20222 years agoApache-2.0
4-bitsautoroundchatbotchatpdfgaudi3+11 more

Similar Papers

Cite this paper

@article{shen2022fast,
  title  = {Fast DistilBERT on CPUs},
  author = {Haihao Shen and Ofir Zafrir and Bo Dong and Hengyu Meng and Xinyu Ye and Zhe Wang and Yi Ding and Hanwen Chang and Guy Boudoukh and Moshe Wasserblat},
  year   = {2022},
  eprint = {2211.07715},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2211.07715}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2211.07715.svg)](https://codeofpaper.com/paper/2211.07715)

Discussion