Saved in:
Bibliographic Details
Main Authors: Xiong, Yi, Wu, Hao, Shao, Changxu, Wang, Ziqing, Zhang, Rui, Guo, Yuhong, Zhao, Junping, Zhang, Ke, Pan, Zhenxuan
Format: Preprint
Published: 2024
Subjects:
Online Access:https://arxiv.org/abs/2410.00428
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866914967803920384
author Xiong, Yi
Wu, Hao
Shao, Changxu
Wang, Ziqing
Zhang, Rui
Guo, Yuhong
Zhao, Junping
Zhang, Ke
Pan, Zhenxuan
author_facet Xiong, Yi
Wu, Hao
Shao, Changxu
Wang, Ziqing
Zhang, Rui
Guo, Yuhong
Zhao, Junping
Zhang, Ke
Pan, Zhenxuan
contents The expanding context windows in large language models (LLMs) have greatly enhanced their capabilities in various applications, but they also introduce significant challenges in maintaining low latency, particularly in Time to First Token (TTFT). This paper identifies that the sharp rise in TTFT as context length increases is predominantly driven by queuing delays, which are caused by the growing demands for GPU Key-Value (KV) cache allocation clashing with the limited availability of KV cache blocks. To address this issue, we propose LayerKV, a simple yet effective plug-in method that effectively reduces TTFT without requiring additional hardware or compromising output performance, while seamlessly integrating with existing parallelism strategies and scheduling techniques. Specifically, LayerKV introduces layer-wise KV block allocation, management, and offloading for fine-grained control over system memory, coupled with an SLO-aware scheduler to optimize overall Service Level Objectives (SLOs). Comprehensive evaluations on representative models, ranging from 7B to 70B parameters, across various GPU configurations, demonstrate that LayerKV improves TTFT latency up to 69x and reduces SLO violation rates by 28.7%, significantly enhancing the user experience.
format Preprint
id arxiv_https___arxiv_org_abs_2410_00428
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle LayerKV: Optimizing Large Language Model Serving with Layer-wise KV Cache Management
Xiong, Yi
Wu, Hao
Shao, Changxu
Wang, Ziqing
Zhang, Rui
Guo, Yuhong
Zhao, Junping
Zhang, Ke
Pan, Zhenxuan
Distributed, Parallel, and Cluster Computing
Artificial Intelligence
Machine Learning
I.2.11; C.4
The expanding context windows in large language models (LLMs) have greatly enhanced their capabilities in various applications, but they also introduce significant challenges in maintaining low latency, particularly in Time to First Token (TTFT). This paper identifies that the sharp rise in TTFT as context length increases is predominantly driven by queuing delays, which are caused by the growing demands for GPU Key-Value (KV) cache allocation clashing with the limited availability of KV cache blocks. To address this issue, we propose LayerKV, a simple yet effective plug-in method that effectively reduces TTFT without requiring additional hardware or compromising output performance, while seamlessly integrating with existing parallelism strategies and scheduling techniques. Specifically, LayerKV introduces layer-wise KV block allocation, management, and offloading for fine-grained control over system memory, coupled with an SLO-aware scheduler to optimize overall Service Level Objectives (SLOs). Comprehensive evaluations on representative models, ranging from 7B to 70B parameters, across various GPU configurations, demonstrate that LayerKV improves TTFT latency up to 69x and reduces SLO violation rates by 28.7%, significantly enhancing the user experience.
title LayerKV: Optimizing Large Language Model Serving with Layer-wise KV Cache Management
topic Distributed, Parallel, and Cluster Computing
Artificial Intelligence
Machine Learning
I.2.11; C.4
url https://arxiv.org/abs/2410.00428