TPI-LLM: 저자원 엣지 장치에서 70B 규모의 LLM 효율적으로 제공하기
TPI-LLM: Serving 70B-scale LLMs Efficiently on Low-resource Edge Devices
October 1, 2024
저자: Zonghang Li, Wenjiao Feng, Mohsen Guizani, Hongfang Yu
cs.AI
초록
대규모 모델 추론은 사용자 상호작용 데이터의 개인 정보 보호 우려로 인해 클라우드에서 엣지로 이동하고 있습니다. 그러나 엣지 장치는 종종 제한된 컴퓨팅 파워, 메모리 및 대역폭으로 고민하며, 여러 장치 간의 협력이 필요하여 LLM 추론을 실행하고 가속화하는 데 어려움을 겪습니다. 주류 솔루션인 파이프라인 병렬성은 단일 사용자 시나리오에 비효율적이며, 텐서 병렬성은 빈번한 통신으로 인해 어려움을 겪습니다. 본 논문에서는 저자들이 저자원 장치에서 파이프라인보다 텐서 병렬성이 더 효과적일 수 있다고 주장하고, 70B 규모 모델을 위한 계산 및 메모리 효율적인 텐서 병렬 추론 시스템인 TPI-LLM을 제시합니다. TPI-LLM은 민감한 원시 데이터를 사용자 장치에 로컬로 유지하고 추론 중에 레이어 가중치를 동적으로 관리하기 위해 슬라이딩 윈도우 메모리 스케줄러를 도입하며, 디스크 I/O 지연을 계산 및 통신과 겹쳐지게 합니다. 이를 통해 더 큰 모델이 메모리 제한 장치에서 원활하게 실행될 수 있습니다. 통신 병목 현상을 분석한 결과 링크 지연이 대역폭이 아닌 주요 문제로 나타나, 스타 기반 allreduce 알고리즘을 구현했습니다. 에뮬레이션 및 실제 테스트베드에서 수행된 광범위한 실험을 통해 TPI-LLM은 Accelerate에 비해 80% 이상의 첫 번째 토큰 시간 및 토큰 지연 시간을 보여주었으며, Transformers 및 Galaxy에 비해 90% 이상을 달성하면서 Llama 2-70B의 최대 메모리 풋프린트를 90% 줄여 70B 규모 모델에 대해 3.1GB의 메모리만 필요로 합니다.
English
Large model inference is shifting from cloud to edge due to concerns about
the privacy of user interaction data. However, edge devices often struggle with
limited computing power, memory, and bandwidth, requiring collaboration across
multiple devices to run and speed up LLM inference. Pipeline parallelism, the
mainstream solution, is inefficient for single-user scenarios, while tensor
parallelism struggles with frequent communications. In this paper, we argue
that tensor parallelism can be more effective than pipeline on low-resource
devices, and present a compute- and memory-efficient tensor parallel inference
system, named TPI-LLM, to serve 70B-scale models. TPI-LLM keeps sensitive raw
data local in the users' devices and introduces a sliding window memory
scheduler to dynamically manage layer weights during inference, with disk I/O
latency overlapped with the computation and communication. This allows larger
models to run smoothly on memory-limited devices. We analyze the communication
bottleneck and find that link latency, not bandwidth, emerges as the main
issue, so a star-based allreduce algorithm is implemented. Through extensive
experiments on both emulated and real testbeds, TPI-LLM demonstrated over 80%
less time-to-first-token and token latency compared to Accelerate, and over 90%
compared to Transformers and Galaxy, while cutting the peak memory footprint of
Llama 2-70B by 90%, requiring only 3.1 GB of memory for 70B-scale models.Summary
AI-Generated Summary