py-kvcache 구축: NVMe SSD를 이용한 vLLM 외부 KV 캐싱의 성능 특성 분석
Building py-kvcache: A Performance Characterization of External KV Caching for vLLM with NVMe SSDs
한국어 초록
접두 문맥(prefix) 캐싱은 이전에 계산한 key-value(KV) 상태를 재사용하여 장문맥 LLM 요청의 첫 토큰까지 시간(TTFT)을 줄일 수 있지만, 짧은 접두 문맥이거나 빠른 GPU에서는 외부 캐시에서 불러오는 것보다 재계산이 더 빠를 수 있다. 우리는 합성 워크로드, 장문맥 벤치마크, 프로덕션 트레이스를 사용해 GPU, CPU, NVMe 계층에 걸친 vLLM에서 이러한 트레이드오프를 특성화하고, 캐시 성능이 장치 대역폭뿐 아니라 전송 세분성(transfer granularity), 중간 메모리 사용, 전송이 요청 스케줄에 진입하는 시점에 따라 달라짐을 밝힌다. 이러한 결과는 비동기 direct I/O, 제한된 공유 스테이징(bounded shared staging), 스케줄러 인지 프리로딩(scheduler-aware preloading)을 갖춘 vLLM KV Offload 커넥터인 py-kvcache를 제안하게 한다. py-kvcache는 요청이 아직 대기 중일 때 디스크 읽기를 시작하여 계산과 겹친다. 80k 토큰에서 디스크로부터의 py-kvcache 로딩은 LMCache보다 2.0배 빠르며, 프리로딩이 1.34배를 기여한다. GPU, CPU, 디스크 캐싱을 모두 활성화하면 LMCache보다 1.23배 빠르고 네이티브 vLLM KV Offload 구현과 약 4% 이내다. LongBench와 SCBench는 이러한 이점이 불규칙한 접두 문맥 체인과 다턴(multi-turn) 워크로드까지 확장됨을 보여준다. Bailian 트레이스 재현은 약한 GPU에서 TTFT를 개선하지만, H100에서는 평균 요청이 손익분기점 아래로 내려가 GPU 메모리만으로도 충분한 접두 문맥을 유지한다. 따라서 외부 KV 캐싱은 설정별 어드미션(admission) 결정으로 다루어야 한다. py-kvcache 구현은 https://github.com/atlarge-research/py-kvcache 에서 이용할 수 있다.
원문 초록
Prefix caching can reduce the time to first token (TTFT) of long-context LLM requests by reusing previously computed key-value (KV) states, but for short prefixes or fast GPUs, recomputation can be faster than loading from an external cache. We characterize this tradeoff in vLLM across GPU, CPU, and NVMe tiers using synthetic workloads, long-context benchmarks, production traces, and find that cache performance depends on transfer granularity, intermediate memory use, and when transfers enter the request schedule, not only on device bandwidth. These findings motivate py-kvcache, a vLLM KV Offload connector with asynchronous direct I/O, bounded shared staging, and scheduler-aware preloading, which starts disk reads while requests are still waiting, overlapping with compute. At 80k tokens, py-kvcache loading from disk is 2.0x faster than LMCache, with preloading contributing 1.34x. With GPU, CPU, and disk caching enabled, it is 1.23x faster than LMCache and within approximately 4% of the native vLLM KV Offload implementation. LongBench and SCBench show that these benefits extend to irregular prefix chains and multi-turn workloads. Bailian trace replays improve TTFT on a weaker GPU, but on an H100 the average request falls below the break-even point and GPU memory alone retains enough prefixes. External KV caching should therefore be treated as a setup specific admission decision. The py-kvcacheimplementation is available at: https://github.com/atlarge-research/py-kvcache.
제출 이력
확인된 버전만 표시합니다. 전체 제출 이력은 arXiv 원문에서 확인하세요.
- arXiv:2609.11744v1제출 시각 미확인
함께 살펴볼 논문
공통 태그를 근거로 연결했습니다. 실제 인용 관계나 논문의 우수성을 뜻하지 않습니다.
공통 태그로 연결된 공개 논문이 아직 없습니다.
토론
이 논문과 연결된 포럼 글이 아직 없습니다.