ChatPaper.aiChatPaper

PowerInfer: Servizio Rapido per Modelli Linguistici di Grandi Dimensioni con una GPU di livello consumer

PowerInfer: Fast Large Language Model Serving with a Consumer-grade GPU

December 16, 2023
Autori: Yixin Song, Zeyu Mi, Haotong Xie, Haibo Chen
cs.AI

Abstract

Questo articolo introduce PowerInfer, un motore di inferenza ad alta velocità per Large Language Model (LLM) su un personal computer (PC) dotato di una singola GPU di livello consumer. Il principio chiave alla base del design di PowerInfer è lo sfruttamento dell'elevata località intrinseca nell'inferenza di LLM, caratterizzata da una distribuzione a legge di potenza nell'attivazione dei neuroni. Questa distribuzione indica che un piccolo sottoinsieme di neuroni, denominati neuroni caldi, viene attivato in modo consistente su diversi input, mentre la maggior parte, i neuroni freddi, varia in base agli input specifici. PowerInfer sfrutta questa intuizione per progettare un motore di inferenza ibrido GPU-CPU: i neuroni caldi vengono precaricati sulla GPU per un accesso rapido, mentre i neuroni freddi vengono calcolati sulla CPU, riducendo significativamente le richieste di memoria della GPU e i trasferimenti di dati tra CPU e GPU. PowerInfer integra inoltre predittori adattativi e operatori sparsi consapevoli dei neuroni, ottimizzando l'efficienza dell'attivazione dei neuroni e della sparsità computazionale. Le valutazioni mostrano che PowerInfer raggiunge una velocità media di generazione di token di 13,20 token/s, con un picco di 29,08 token/s, su vari LLM (incluso OPT-175B) utilizzando una singola GPU NVIDIA RTX 4090, solo il 18% inferiore rispetto a quella ottenuta con una GPU server di fascia alta A100. Questo risultato supera significativamente llama.cpp fino a 11,69x, mantenendo l'accuratezza del modello.
English
This paper introduces PowerInfer, a high-speed Large Language Model (LLM) inference engine on a personal computer (PC) equipped with a single consumer-grade GPU. The key underlying the design of PowerInfer is exploiting the high locality inherent in LLM inference, characterized by a power-law distribution in neuron activation. This distribution indicates that a small subset of neurons, termed hot neurons, are consistently activated across inputs, while the majority, cold neurons, vary based on specific inputs. PowerInfer exploits such an insight to design a GPU-CPU hybrid inference engine: hot-activated neurons are preloaded onto the GPU for fast access, while cold-activated neurons are computed on the CPU, thus significantly reducing GPU memory demands and CPU-GPU data transfers. PowerInfer further integrates adaptive predictors and neuron-aware sparse operators, optimizing the efficiency of neuron activation and computational sparsity. Evaluation shows that PowerInfer attains an average token generation rate of 13.20 tokens/s, with a peak of 29.08 tokens/s, across various LLMs (including OPT-175B) on a single NVIDIA RTX 4090 GPU, only 18% lower than that achieved by a top-tier server-grade A100 GPU. This significantly outperforms llama.cpp by up to 11.69x while retaining model accuracy.
PDF444December 15, 2024