정의

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.

관계

인용

“t_compute는 batch 곱하기 active parameters의 number에 bound된다. t_memory는 batch와 sequence length에 큰 영향을 받는다. 결국 두 시간 중 더 큰 쪽이 latency를 결정한다.”

출처

클리핑 · youtube.com