UC Berkeley researchers solved the biggest bottleneck in LLM inference.
85K stars. 2,861 contributors.
It's called vLLM, and it completely rethinks how memory is allocated during generation.
Traditional serving wastes VRAM due to fragmented key-value states. vLLM fixes this with PagedAttention. It efficiently manages attention key and value memory just like an operating system manages virtual memory.
What this architecture delivers:
→ 24x better memory efficiency
→ Continuous batching of incoming requests
→ Fast model execution with CUDA/HIP graphs
→ State-of-the-art serving throughput
pip install vllm
Open-source. Apache-2.0 license.
If you're serving LLMs without this, you're burning money.
용어 사전
LLM 추론 (LLM Inference)
대규모 언어 모델(Large Language Model)이 입력 프롬프트를 받아 텍스트를 생성하는 실행 과정. GPU 메모리와 연산 자원을 집중적으로 소비하는 작업으로, 고효율 서빙 시스템의 핵심 병목 지점이다. 출처
VRAM (Video Random Access Memory)
GPU에 탑재된 고속 메모리. LLM 서빙 시 모델 가중치와 KV 캐시를 저장하며, 용량이 제한적이어서 메모리 단편화(fragmentation)가 발생하면 실제 사용 가능한 용량이 크게 줄어든다. 출처
KV 캐시 (Key-Value Cache)
트랜스포머 어텐션 레이어가 각 토큰에 대해 생성하는 Key·Value 텐서를 저장해두는 메모리 공간. 반복 연산을 줄여 생성 속도를 높이지만, 시퀀스마다 비연속적으로 할당되면 메모리 단편화를 유발한다. 출처
PagedAttention
UC Berkeley가 vLLM에서 고안한 메모리 관리 기법. 운영체제의 가상 메모리 페이징 방식을 어텐션 KV 캐시에 적용해, 비연속적인 물리 메모리 블록을 논리 블록 테이블로 매핑함으로써 단편화를 제거하고 메모리 효율을 획기적으로 높인다. 출처
연속 배칭 (Continuous Batching)
들어오는 요청을 매 포워드 패스(iteration) 단위로 동적으로 묶어 GPU를 쉬지 않고 가동시키는 스케줄링 기법. 기존의 정적 배칭(static batching)과 달리, 한 요청이 끝나는 즉시 새 요청을 삽입해 처리량(throughput)을 크게 향상시킨다. 출처
CUDA/HIP 그래프 (CUDA/HIP Graphs)
GPU에서 실행되는 연산 흐름 전체를 DAG(방향 비순환 그래프) 형태로 미리 기록해 두고, 추론 시 재생(replay)하는 최적화 기법. 커널 실행 오버헤드를 줄여 레이턴시를 낮춘다. CUDA는 NVIDIA GPU용, HIP은 AMD GPU용 인터페이스다. 출처
출처: