Inference Acceleration for Large Language Models on CPUs

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: PS, Ditto, VG, Jithin, MS, Adarsh
Format: Preprint
Published: 2024
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866916283435450368
author PS, Ditto
VG, Jithin
MS, Adarsh
author_facet PS, Ditto
VG, Jithin
MS, Adarsh
contents In recent years, large language models have demonstrated remarkable performance across various natural language processing (NLP) tasks. However, deploying these models for real-world applications often requires efficient inference solutions to handle the computational demands. In this paper, we explore the utilization of CPUs for accelerating the inference of large language models. Specifically, we introduce a parallelized approach to enhance throughput by 1) Exploiting the parallel processing capabilities of modern CPU architectures, 2) Batching the inference request. Our evaluation shows the accelerated inference engine gives an 18-22x improvement in the generated token per sec. The improvement is more with longer sequence and larger models. In addition to this, we can also run multiple workers in the same machine with NUMA node isolation to further improvement in tokens/s. Table 2, we have received 4x additional improvement with 4 workers. This would also make Gen-AI based products and companies environment friendly, our estimates shows that CPU usage for Inference could reduce the power consumption of LLMs by 48.9% while providing production ready throughput and latency.
format Preprint
id arxiv_https___arxiv_org_abs_2406_07553
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle Inference Acceleration for Large Language Models on CPUs
PS, Ditto
VG, Jithin
MS, Adarsh
Distributed, Parallel, and Cluster Computing
Computation and Language
In recent years, large language models have demonstrated remarkable performance across various natural language processing (NLP) tasks. However, deploying these models for real-world applications often requires efficient inference solutions to handle the computational demands. In this paper, we explore the utilization of CPUs for accelerating the inference of large language models. Specifically, we introduce a parallelized approach to enhance throughput by 1) Exploiting the parallel processing capabilities of modern CPU architectures, 2) Batching the inference request. Our evaluation shows the accelerated inference engine gives an 18-22x improvement in the generated token per sec. The improvement is more with longer sequence and larger models. In addition to this, we can also run multiple workers in the same machine with NUMA node isolation to further improvement in tokens/s. Table 2, we have received 4x additional improvement with 4 workers. This would also make Gen-AI based products and companies environment friendly, our estimates shows that CPU usage for Inference could reduce the power consumption of LLMs by 48.9% while providing production ready throughput and latency.
title Inference Acceleration for Large Language Models on CPUs
topic Distributed, Parallel, and Cluster Computing
Computation and Language
url https://arxiv.org/abs/2406.07553