[논문 리뷰] Taming Throughput-Latency Tradeoff in LLM Inference with Sarathi-Serve
Sarathi-Serve는 stall-free, chunked-prefill 배치를 도입하여 LLM 추론 처리량을 향상시키면서 토큰 간 시간 지연을 낮게 유지하고, 여러 모델과 GPU에서 Orca/vLLM에 비해 최대 2.6x–6.9x의 속도 향상을 달성합니다.
Each LLM serving request goes through two phases. The first is prefill which processes the entire input prompt and produces the first output token and the second is decode which generates the rest of output tokens, one-at-a-time. Prefill iterations have high latency but saturate GPU compute due to parallel processing of the input prompt. In contrast, decode iterations have low latency but also low compute utilization because a decode iteration processes only a single token per request. This makes batching highly effective for decodes and consequently for overall throughput. However, batching multiple requests leads to an interleaving of prefill and decode iterations which makes it challenging to achieve both high throughput and low latency. We introduce an efficient LLM inference scheduler, Sarathi-Serve, to address this throughput-latency tradeoff. Sarathi-Serve introduces chunked-prefills which splits a prefill request into near equal sized chunks and creates stall-free schedules that adds new requests in a batch without pausing ongoing decodes. Stall-free scheduling unlocks the opportunity to improve throughput with large batch sizes while minimizing the effect of batching on latency. Furthermore, uniform batches in Sarathi-Serve ameliorate the imbalance between iterations resulting in minimal pipeline bubbles. Our techniques yield significant improvements in inference performance across models and hardware under tail latency constraints. For Mistral-7B on single A100 GPUs, we achieve 2.6x higher serving capacity and up to 3.7x higher serving capacity for the Yi-34B model on two A100 GPUs as compared to vLLM. When used with pipeline parallelism on Falcon-180B, Sarathi-Serve provides up to 5.6x gain in the end-to-end serving capacity. The source code for Sarathi-Serve is available at https://github.com/microsoft/sarathi-serve.
연구 동기 및 목표
- 온라인 LLM 제공에서 처리량-지연 트레이드오프를 줄이는 것을 목표로 한다.
- 새로운 요청이 디코드를 지연시키지 않으면서 진행 중인 배치에 합류할 수 있는 stall-free 스케줄러를 개발한다.
- chunked-prefills를 활용하여 디코드 배치 활용도를 극대화하고 각 반복의 지연을 한정한다.
- 다양한 모델과 하드웨어 구성에서 처리량과 지연을 평가한다.
- chunked-prefills가 주요 성능 지표(TTFT, TBT, 용량)에 미치는 영향을 정량화한다.
제안 방법
- 기존 스케줄러를 prefill-우선형 또는 decode-우선형으로 분류하고 그 한계를 확인한다.
- chunked-prefills와 decode-합치화를 기반으로 한 stall-free, 반복 단위 스케줄러인 Sarathi-Serve를 도입한다.
- 길은 prefill 작업을 반복 간에 나누되 진행 중인 디코드와 함께 합치도록 chunked-prefills를 사용한다.
- 지연을 한정하고 처리량을 극대화하기 위해 스케줄링 반복당 토큰 예산을 정의한다.
- decode 진행을 유지하면서 기회가 있을 때 prefill 청크를 처리하는 하이브리드 배칭 전략을 채택한다.
- 다양한 모델(Mistral-7B, Yi-34B, LLaMA2-70B, Falcon-180B)과 하드웨어(A100, A40)에서 실제 트레이스로 평가한다.
실험 결과
연구 질문
- RQ1다양한 SLO에 대해 Sarathi-Serve가 상태 극성 schedulers에 비해 얼마나 큰 처리량 용량을 제공할 수 있는가?
- RQ2chunked-prefills가 latency 및 KV 캐시 접근 측면에서 어떤 오버헤드를 도입하는가?
- RQ3정지 없는 배칭이 prefill- 또는 decode-우선 스킴에 비해 TBT와 TTFT에 미치는 영향은 어떠한가?
- RQ4chunked-prefills와 stall-free 배칭은 다른 모델 크기와 하드웨어 구성에서 어떻게 수행되는가?
주요 결과
- Sarathi-Serve는 엄격한 SLO와 느슨한 SLO 모두에서 모델과 워크로드 전반에 걸쳐 Orca 및 vLLM보다 지속적으로 우수한 성능을 보인다.
- Mistral-7B는 Sarathi-Serve를 사용할 때 단일 A100에서 최대 2.6x의 높은 서비스 능력을 달성한다.
- Yi-34B는 새로운 스케줄러 하에서 최대 2.8x의 처리 용량 향상을 달성한다.
- Falcon-180B는 8개의 A100 GPU를 사용하여 Sarathi-Serve로 최대 6.9x의 높은 용량을 보여준다.
- Chunked-prefills는 지연 증가를 억제하고 더 높은 decode 배치 처리량을 가능하게 하여 생성 지연을 줄인다.
- 전반적으로 stall-free 배칭은 TBT 급증을 최소화하면서 높은 처리량을 유지하는 반면, chunking으로 인해 TTFT에 소폭의 오버헤드가 발생할 수 있다.
더 나은 연구,지금 바로 시작하세요
연구 설계부터 논문 작성까지, 연구 시간을 획기적으로 줄여보세요.
카드 등록 없음 · 무료 플랜 제공
이 리뷰는 AI가 만들고, 인간 에디터가 검토했습니다.