Skip to main content
QUICK REVIEW

[논문 리뷰] Fiddler: CPU-GPU Orchestration for Fast Inference of Mixture-of-Experts Models

Keisuke Kamahori, Tang, Tian|arXiv (Cornell University)|2024. 02. 10.
Gaussian Processes and Bayesian Inference인용 수 4
한 줄 요약

Fiddler는 자원이 제한된 환경에서 압축 해제된 Mixture-of-Experts (MoE) 모델의 효율적인 추론을 위한 CPU-GPU 조율 시스템을 제안한다. 전문가 계산을 CPU로 이관하고 GPU-CPU 간 데이터 이동을 최소화함으로써, 24GB GPU에서 Mixtral-8x7B 모델에 대해 1초당 3개 이상의 토큰을 처리하며, 이는 이전 방법 대비 최대 10.1배 빠른 지연 시간을 기록한다.

ABSTRACT

Large Language Models (LLMs) with the Mixture-of-Experts (MoE) architectures have shown promising performance on various tasks. However, due to the huge model sizes, running them in resource-constrained environments where the GPU memory is not abundant is challenging. Some existing systems propose to use CPU resources to solve that, but they either suffer from the significant overhead of frequently moving data between CPU and GPU, or fail to consider distinct characteristics of CPUs and GPUs. This paper proposes Fiddler, a resource-efficient inference system for MoE models with limited GPU resources. Fiddler strategically utilizes CPU and GPU resources by determining the optimal execution strategy. Our evaluation shows that, unlike state-of-the-art systems that optimize for specific scenarios such as single batch inference or long prefill, Fiddler performs better in all scenarios. Compared against different baselines, Fiddler achieves 1.26 times speed up in single batch inference, 1.30 times in long prefill processing, and 11.57 times in beam search inference. The code of Fiddler is publicly available at https://github.com/efeslab/fiddler.

연구 동기 및 목표

  • 제한된 GPU 메모리가 있는 로컬 단일 GPU 환경에서 대규모 압축 해제된 Mixture-of-Experts (MoE) 모델의 효율적이고 저지연 추론을 가능하게 하기.
  • 기존 MoE 모델을 위한 오프로딩 시스템에서 빈번한 CPU-GPU 데이터 전송으로 인한 높은 런타임 오버헤드 문제를 해결하기.
  • 희박한 MoE 아키텍처에서 데이터 이동을 줄이고 추론 효율을 향상시키기 위해 CPU 계산 자원을 효과적으로 활용할 수 있는지 탐색하기.
  • 모델 양자화나 다중 GPU 설정 없이도 단일 배치, 저지연 추론에 높은 성능을 달성하기.

제안 방법

  • Fiddler는 데이터 전송 지연과 계산 비용을 비교하는 비용 모델을 기반으로 전문가 레이어를 CPU 또는 GPU에 동적으로 할당한다.
  • CPU 계산을 활용해 전문가 레이어를 실행함으로써 CPU 메모리에서 GPU 메모리로의 가중치 전송을 방지함으로써 PCIe 대역폭 제약을 줄인다.
  • 시스템은 계산과 데이터 이동 오버헤드를 균형 잡는 데 사용되는 비용 모델을 활용하여 전문가를 CPU 또는 GPU에서 실행할지 결정한다.
  • Fiddler는 PyTorch와 통합되며, 최적화된 메모리 관리와 실행 스케줄링를 통해 프리필 및 디코딩 단계를 모두 지원한다.
  • 단일 GPU에 일부 전문가만 로드하고 나머지는 CPU에서 계산하는 하이브리드 실행 전략을 채택한다.
  • 시스템은 단일 배치, 로컬 배포 시나리오를 고려하여 설계되었으며, 종단 간 지연 시간을 최소화하는 데 중점을 둔다.
Figure 1: Main idea of Fiddler . a) In existing offloading systems, expert weights are copied from the CPU to the GPU, and the computation happens on the GPU. b) In Fiddler , only the activations are copied between the CPU and GPU, and the computation happens on the CPU, drastically reducing the lat
Figure 1: Main idea of Fiddler . a) In existing offloading systems, expert weights are copied from the CPU to the GPU, and the computation happens on the GPU. b) In Fiddler , only the activations are copied between the CPU and GPU, and the computation happens on the CPU, drastically reducing the lat

실험 결과

연구 질문

  • RQ1MoE 모델 추론에서 GPU-CPU 간 데이터 이동을 줄이기 위해 CPU 계산을 효과적으로 활용할 수 있는가?
  • RQ2PCIe를 통해 전문가 가중치를 전송하는 오버헤드와 비교해 CPU 기반 전문가 실행의 지연 시간은 어떻게 되는가?
  • RQ3GPU 메모리나 데이터 전송에 의존하는 것 대비 CPU로 전문가 계산을 오프로딩함으로써 얻는 성능 향상은 어느 정도인가?
  • RQ4제한된 GPU 메모리가 있는 다양한 하드웨어 구성에서 Fiddler의 조율 전략은 어떻게 스케일링되는가?
  • RQ5모델 양자화나 다중 GPU 설정 없이도 Fiddler가 압축 해제된 MoE 모델에 대해 높은 처리량을 달성할 수 있는가?

주요 결과

  • Fiddler는 단일 24GB GPU에서 압축 해제된 Mixtral-8x7B 모델에 대해 1초당 3개 이상의 토큰을 처리하여 로컬 환경에서 실시간 추론을 가능하게 한다.
  • Quadro RTX 6000에서 Fiddler는 Eliseev & Mazur (2023) 대비 8.2배, DeepSpeed-MII 대비 19.4배의 단일 배치 추론 지연 시간 감소를 기록한다.
  • L4 GPU에서 Fiddler는 Eliseev & Mazur (2023) 대비 10.1배, DeepSpeed-MII 대비 22.5배의 성능 향상을 달성한다.
  • 성능 향상은 특히 긴 생성 길이에서 두드러지며, 이는 프리필 지연 시간이 분할되어 지속적으로 감소하기 때문이다.
  • PCIe 대역폭 제약으로 인해 CPU의 계산 처리 능력이 낮더라도, Fiddler의 CPU 기반 전문가 실행 전략이 GPU 데이터 전송보다 뛰어난 성능을 보인다.
  • 시스템은 양자화나 다중 GPU 설정 없이도 소비자용 GPU에서 90GB 이상의 모델, 예를 들어 Mixtral-8x7B를 배포할 수 있도록 한다.
Figure 2: The performance of Fiddler and baseline methods measured by the number of tokens generated per second, with 24 different configurations of input/output length. The rightmost set of bars shows the average of 24 configurations.
Figure 2: The performance of Fiddler and baseline methods measured by the number of tokens generated per second, with 24 different configurations of input/output length. The rightmost set of bars shows the average of 24 configurations.

더 나은 연구,지금 바로 시작하세요

논문 읽기부터 검토까지, 연구 시간을 획기적으로 줄여보세요.

카드 등록 없음 · 무료 플랜 제공

이 리뷰는 AI가 만들고, 인간 에디터가 검토했습니다.