SparQ Attention: Bandbreiteneffiziente LLM-Inferenz
SparQ Attention: Bandwidth-Efficient LLM Inference
December 8, 2023
Autoren: Luka Ribar, Ivan Chelombiev, Luke Hudlass-Galley, Charlie Blake, Carlo Luschi, Douglas Orr
cs.AI
Zusammenfassung
Generative große Sprachmodelle (LLMs) haben zahlreiche neue Möglichkeiten eröffnet, doch aufgrund ihrer erheblichen Rechenanforderungen bleibt ihre allgegenwärtige Nutzung eine Herausforderung. Einige der nützlichsten Anwendungen erfordern die Verarbeitung einer großen Anzahl von Proben gleichzeitig und die Nutzung langer Kontexte, was den Speicherkommunikationsbedarf der Modelle erheblich erhöht. Wir stellen SparQ Attention vor, eine Technik zur Steigerung des Inferenzdurchsatzes von LLMs, indem die Speicherbandbreitenanforderungen innerhalb der Attention-Blöcke durch selektives Abrufen des gespeicherten Verlaufs reduziert werden. Unsere vorgeschlagene Technik kann direkt auf handelsübliche LLMs während der Inferenz angewendet werden, ohne dass Änderungen am Pre-Training-Setup oder zusätzliches Fine-Tuning erforderlich sind. Wir zeigen, wie SparQ Attention die Speicherbandbreitenanforderungen für Attention um das Achtfache reduzieren kann, ohne Genauigkeitsverluste, indem wir Llama 2 und Pythia Modelle auf einer Vielzahl von Downstream-Aufgaben evaluieren.
English
Generative large language models (LLMs) have opened up numerous novel
possibilities, but due to their significant computational requirements their
ubiquitous use remains challenging. Some of the most useful applications
require processing large numbers of samples at a time and using long contexts,
both significantly increasing the memory communication load of the models. We
introduce SparQ Attention, a technique for increasing the inference throughput
of LLMs by reducing the memory bandwidth requirements within the attention
blocks through selective fetching of the cached history. Our proposed technique
can be applied directly to off-the-shelf LLMs during inference, without
requiring any modification to the pre-training setup or additional fine-tuning.
We show how SparQ Attention can decrease the attention memory bandwidth
requirements up to eight times without any loss in accuracy by evaluating Llama
2 and Pythia models on a wide range of downstream tasks.