Optimizing Inference Performance of Transformers on CPUs
Dave Dice, Alex Kogan

TL;DR
This paper analyzes the inference performance of Transformer models on CPUs, identifies bottlenecks, and proposes three optimizations that double the speed without affecting accuracy.
Contribution
It provides an empirical analysis of Transformer inference on CPUs and introduces three optimizations to significantly improve speed without model modifications.
Findings
Achieved up to 2.37x speedup in inference
Identified key computation bottlenecks in Transformer architecture
Optimizations do not alter model accuracy
Abstract
The Transformer architecture revolutionized the field of natural language processing (NLP). Transformers-based models (e.g., BERT) power many important Web services, such as search, translation, question-answering, etc. While enormous research attention is paid to the training of those models, relatively little efforts are made to improve their inference performance. This paper comes to address this gap by presenting an empirical analysis of scalability and performance of inferencing a Transformer-based model on CPUs. Focusing on the highly popular BERT model, we identify key components of the Transformer architecture where the bulk of the computation happens, and propose three optimizations to speed them up. The optimizations are evaluated using the inference benchmark from HuggingFace, and are shown to achieve the speedup of up to x2.37. The considered optimizations do not require any…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsNon-Destructive Testing Techniques · Topic Modeling · Advanced Neural Network Applications
MethodsLinear Layer · Absolute Position Encodings · Position-Wise Feed-Forward Layer · Label Smoothing · Byte Pair Encoding · Residual Connection · Weight Decay · Refunds@Expedia|||How do I get a full refund from Expedia? · Multi-Head Attention · Dense Connections
