Skip to main content
QUICK REVIEW

[논문 리뷰] From Words to Watts: Benchmarking the Energy Costs of Large Language Model Inference

Siddharth Samsi, Dan Zhao|arXiv (Cornell University)|2023. 10. 04.
Topic ModelingComputer Science인용 수 12
한 줄 요약

이 논문은 다중 노드 GPU 배포, 데이터셋 및 하드웨어 전반에 걸쳐 LLaMA 모델(7B, 13B, 65B)의 추론 계산 및 에너지 비용을 벤치마킹하여 처리량-에너지 트레이드오프와 공유 기회를 이해한다.

ABSTRACT

Large language models (LLMs) have exploded in popularity due to their new generative capabilities that go far beyond prior state-of-the-art. These technologies are increasingly being leveraged in various domains such as law, finance, and medicine. However, these models carry significant computational challenges, especially the compute and energy costs required for inference. Inference energy costs already receive less attention than the energy costs of training LLMs -- despite how often these large models are called on to conduct inference in reality (e.g., ChatGPT). As these state-of-the-art LLMs see increasing usage and deployment in various domains, a better understanding of their resource utilization is crucial for cost-savings, scaling performance, efficient hardware usage, and optimal inference strategies. In this paper, we describe experiments conducted to study the computational and energy utilization of inference with LLMs. We benchmark and conduct a preliminary analysis of the inference performance and inference energy costs of different sizes of LLaMA -- a recent state-of-the-art LLM -- developed by Meta AI on two generations of popular GPUs (NVIDIA V100 \& A100) and two datasets (Alpaca and GSM8K) to reflect the diverse set of tasks/benchmarks for LLMs in research and practice. We present the results of multi-node, multi-GPU inference using model sharding across up to 32 GPUs. To our knowledge, our work is the one of the first to study LLM inference performance from the perspective of computational and energy resources at this scale.

연구 동기 및 목표

  • GPU와 노드 간 샤딩으로 LLaMA 65B의 추론 성능 및 에너지 사용 특성화.
  • 바람직한 최소 하드웨어에서 더 작은 LLaMA 변형(7B, 13B)의 추론 처리량 및 에너지 비교.
  • 데이터셋 유형(Alpaca vs GSM8K)이 추론 중 계산-에너지 역학에 미치는 영향 평가.
  • 배치 크기, 샤드 수, 생성 길이가 에너지 초당, 토큰당, 응답당에 미치는 영향 탐구.
  • HPC/데이터센터 맥락에서 GPU 전력 제한 및 자원 공유에 대한 시사점 논의.

제안 방법

  • FairScale를 통한 모델 샤딩으로 다중 GPU, 다중 노드 추론을 실행하는 오픈소스 LLaMA 65B 구현 사용.
  • 두 데이터셋(Alpaca 지시-따르기; GSM8K 수학 문제)에서 각 4,096 입력으로 평가.
  • 처리량(초당 단어/토큰/응답) 및 에너지를 nvidia-smi 및 DCGM으로 측정하고 에너지 per second/token/response 정의.
  • 구성은 V100(32 GB) 및 A100(80 GB) GPU를 가로지르며 샤드 수를 최대 32까지 벤치마크.
  • bare-minimum 하드웨어 트레이드를 설명하기 위해 LLaMA 7B, 13B로 기준선 분석.
  • 추론 시간 및 에너지에 대한 파워-캡 효과 보고.
  • 분산 추론에서 SM, 메모리 활용에 대한 이용 노트 제공.
Figure 1 : Development paths of LLMs: A tree diagram illustrating the development of language models and foundation models from 2017 to early 2023. Pink branches indicate encoder-type language models, green indicates encoder-decoder hybrid models, and the dark grey indicates decoder-style models. Th
Figure 1 : Development paths of LLMs: A tree diagram illustrating the development of language models and foundation models from 2017 to early 2023. Pink branches indicate encoder-type language models, green indicates encoder-decoder hybrid models, and the dark grey indicates decoder-style models. Th

실험 결과

연구 질문

  • RQ1여러 GPUs와 노드에 걸친 샤딩 시 LLaMA 65B의 추론 처리량 특성은 무엇인가?
  • RQ2바람직한 최소 하드웨어에서 더 작은 LLaMA 변형(7B, 13B)은 처리량 및 에너지 측면에서 어떻게 차이가 나는가?
  • RQ3배치 크기, 샤드 수, 최대 생성 길이는 초당 에너지, 토큰당 에너지, 응답당 에너지에 어떤 영향을 미치는가?
  • RQ4데이터셋 유형(Alpaca 대 GSM8K)이 추론 중 계산-에너지 역학에 어떤 영향을 미치는가?
  • RQ5전력 제한이 LLM 추론에서 prohibitive latency penalty 없이 에너지 사용을 실질적으로 줄일 수 있는가?

주요 결과

  • 추론 처리량 및 에너지는 모델 크기와 하드웨어에 따라 확장되며; A100은 V100보다 처리량이 더 높지만 초당 에너지가 더 높아질 수 있다.
  • 65B LLaMA 추론은 다중 GPU/샤드 구성(8개의 V100 또는 4개의 A100) 필요, 에너지와 지연에 뚜렷한 영향.
  • 에너지는 초당, 토큰당, 응답당은 일반적으로 샤드가 많아질수록 증가; 더 긴 생성 길이는 초당 에너지를 증가시키는 경향, 데이터세트 의존적 영향.
  • 65B의 경우 샤드가 4에서 32로 증가함에 따라 에너지 소비가 수백 와트에서 약 킬로와트까지 증가하고, 높은 샤드 수에서 처리량 이득은 감소.
  • 전력 제한은 일부 지연 및 처리량 트레이드오프와 함께 에너지 사용을 줄일 수 있음; 중간 캡(예: 175W)은 의미 있는 에너지 감소(~23% 총 에너지)를 달성할 수 있으며 시간 증가도 (약 6-7%)로 나타난다.
  • 샤드 구성이 메모리에 맞으면 GPU 활용도는 여전히 높고 SM 활용도 A100에서 약 95%, V100에서 94-95%로 나타나 같은 GPU에 여러 모델을 공동 배치할 가능성 제시.
(a) Results from the Alpaca dataset.
(a) Results from the Alpaca dataset.

이 논문 읽기

누빈트 뷰어에서 원문을 열고, 읽으면서 궁금한 곳을 바로 물어보세요.

누빈트에서 이 논문 읽기

이 리뷰는 AI가 논문 원문을 바탕으로 만들었습니다. 인용하기 전에 원문을 확인해 주세요.