기술 가이드

연속 배치

연속 일괄 처리는 모든 요청이 완료될 때까지 하나의 고정 일괄 처리를 유지하는 대신 생성 반복 간에 활성 요청 세트를 업데이트합니다.

이 가이드를 들어보세요AI 내레이션 · ~2 min

이 페이지에서2분 읽기
  1. 개요
  2. 심층 분석
  3. 실제 구현
  4. 연속 배치의 미래
  5. 실천에 옮기기
  6. 계속 탐색하세요
  7. 자주 묻는 질문

개요

It can improve serving utilization, while capacity limits and scheduling policy still govern latency.

심층 분석

GPUs are fastest when they process many requests together in a batch. The naive approach, static batching, groups a fixed set of requests, runs them all to completion, then starts the next batch. The problem: language model outputs vary wildly in length, so short requests finish early and their slots sit idle while the batch waits for the longest one, wasting GPU cycles and delaying new arrivals. Continuous batching (also called in-flight or iteration-level batching, popularized by the Orca paper and used in vLLM, TensorRT-LLM, and TGI) operates at the granularity of a single decoding step. After each token is generated, finished sequences exit the batch and queued requests can be admitted when the scheduler has capacity. Iteration-level admission can improve utilization and reduce avoidable waiting compared with fixed batches; the measured effect depends on request lengths, capacity, and scheduling.

실제 구현

새로 도착한 사용자 메시지를 다음 배치를 위해 대기열에 넣지 않고 즉시 실행 중인 배치에 허용하는 채팅 API

배치 중간에 완성된 짧은 답변을 제거하고 슬롯을 다시 채워 GPU가 오랜 세대를 기다리며 유휴 상태가 되지 않도록 합니다.

지속적인 일괄 처리와 vLLM의 PagedAttention을 결합하여 각 디코딩 단계에서 시퀀스를 저렴하게 삽입 및 제거

배치를 전체 상태로 유지하여 폭주하는 가변 길이 트래픽에서 초당 높은 토큰을 유지하는 코드 완성 서비스

연속 배치의 미래

Serving teams balance throughput with time to first token and time between generated tokens. Long prefill work can delay decoding unless the scheduler splits or otherwise manages it. Capacity budgets, request priorities, and fairness policies determine which work is admitted. Continuous batching can be combined with paged caches, chunked prefill, and speculative decoding, but each combination should be measured on the actual traffic and hardware.

실천에 옮기기

왜 중요한가요?

  • 비용 및 예산. 아키텍처 결정은 수년 동안 성능과 운영 비용을 결정합니다.
  • 더 명확한 결정들. 기술 교육은 팀이 최신 스택뿐만 아니라 올바른 스택을 선택하는 데 도움이 됩니다.
  • 품질 관리. 더 나은 엔지니어링 선택은 생산 시 신뢰성 사고를 줄입니다.

조심하세요

  • 하나의 벤치마크를 최적화하면 더 광범위한 시스템 약점을 숨길 수 있습니다.
  • 인프라 및 유지 관리 비용은 종종 과소평가됩니다.
  • 시스템이 더욱 복잡해짐에 따라 보안 및 관찰 가능성의 격차가 커질 수 있습니다.

다음 단계

  1. 구현하기 전에 지연 시간, 품질, 비용 목표를 정의하세요.
  2. 현실적인 로드 및 데이터 조건에서 벤치마킹합니다.
  3. 오류, 드리프트 및 사용자 영향에 대한 계측기 모니터링.
  4. 확장하기 전에 롤백 및 사고 대응 경로를 준비하세요.

계속 탐색하세요

무료 뉴스레터

일일 AI 브리핑 받기

매주 평일 아침마다 3개의 검증된 AI 스토리를 일반 영어로 작성합니다. 무료이며, 광고 없음.

매주 평일마다 한 번 이메일을 받습니다. 한 번 클릭으로 구독 해지. 주소를 판매하거나 공유하지 않습니다.

자신을 테스트해 보세요

Take the Continuous Batching quiz

모든 답변에 즉각적인 피드백과, 과정을 통과하면 검증 가능한 ID가 있는 공유 가능한 인증서를 제공합니다.

퀴즈 시작

무료 AI 교육을 지원합니다. AI Understanding는 501(c)(3) 비영리 단체입니다 — 광고 없음, 유료 장벽 없음, 영원히. 기부하기

자주 묻는 질문

연속 배치란 무엇입니까?

Continuous batching updates the active request set between generation iterations instead of holding one fixed batch until every request finishes. It can improve serving utilization, while capacity limits and scheduling policy still govern latency.

LLM 제공을 위한 정적(고정) 일괄 처리의 주요 약점은 무엇입니까?

출력 길이가 다양하기 때문에 완료된 시퀀스는 가장 느린 시퀀스가 ​​완료될 때까지 유휴 상태로 유지되어 GPU 주기를 낭비하고 새 요청이 지연됩니다.

지속적인 일괄 처리는 요청을 어떤 단위로 추가하고 제거합니까?

지속적인(반복 수준) 일괄 처리는 모든 단일 디코드 단계 후에 활성 세트를 업데이트하므로 전체 요청이 아닌 토큰별로 작동합니다.

A continuous-batching request finishes and frees capacity. What can the scheduler do next?

Iteration-level scheduling can refill available capacity subject to memory, token, and other limits.

시퀀스 삽입/제거를 저렴하게 만들기 위해 연속 일괄 처리와 자연스럽게 결합되는 기술은 무엇입니까?

PagedAttention은 각 시퀀스의 KV 캐시를 독립적인 블록에 저장하므로 비행 중에 시퀀스를 추가하거나 제거해도 다른 사람의 메모리가 방해받지 않습니다.

반복 수준(연속) 일괄 처리를 대중화한 것으로 일반적으로 인정받는 연구 논문은 무엇입니까?

Orca 문서에서는 반복 수준 스케줄링을 소개했으며 이 아이디어는 vLLM, TGI 및 TensorRT-LLM과 같은 서비스 시스템에 채택되었습니다.