정의
LLM inference의 latency는 compute time (t_compute)과 memory time (t_memory)의 최댓값으로 결정된다. 이 두 요소의 균형이 최적 배치 크기(batch size)를 결정하며, 모든 현대 LLM 서빙 시스템의 경제성과 아키텍처 설계의 기초가 된다.
핵심 속성
- t_compute: batch × N_active ÷ FLOPs. N_active는 MoE 구조에서 활성화되는 파라미터 수 (sparsity에 비례).
- t_memory: (N_total × bytes_per_param + batch × avg_seq_len × bytes_per_kv) ÷ HBM_bandwidth.
- Latency bound: t = max(t_compute, t_memory). 배치가 작으면 memory-bound, 크면 compute-bound.
- Drain time: HBM 전체 용량 ÷ 대역폭. 최신 GPU에서 약 15~20ms로, inference cycle의 기준 시간.
- Optimal batch: FLOPs/bandwidth ratio × (1/sparsity). DeepSeek V3 기준 약 2400.
관계
- 20260607-batch-filling-economics — 배치 최적화가 서비스 경제성에 직접 연결됨.
- 20260607-200k-context-threshold — memory-bound 전환점과 가격 티어의 관계.
- MoE Sparsity — sparsity가 t_compute와 t_memory의 비율을 결정.
- KV Cache PagedAttention — memory time 중 KV cache 부분을 최적화하여 t_memory 감소.
인용
“t_compute는 batch 곱하기 active parameters의 number에 bound된다. t_memory는 batch와 sequence length에 큰 영향을 받는다. 결국 두 시간 중 더 큰 쪽이 latency를 결정한다.”
출처
- 📎 클리핑: 20260613-ep96-ko-transcript