vTensor: Flexible Virtual Tensor Management for Efficient LLM Serving

Jiale Xu, Rui Zhang, Cong Guo, Weiming Hu, Zihan Liu +9 more
7/22/2024
cs.DCcs.LG

No official code found. Best implementation: antgroup/glake (502 stars, Apache-2.0, PyTorch, last commit 2025-03-24).

Abstract

Large Language Models (LLMs) are widely used across various domains, processing millions of daily requests. This surge in demand poses significant challenges in optimizing throughput and latency while keeping costs manageable. The Key-Value (KV) cache, a standard method for retaining previous computations, makes LLM inference highly bounded by memory. While batching strategies can enhance performance, they frequently lead to significant memory fragmentation. Even though cutting-edge systems like vLLM mitigate KV cache fragmentation using paged Attention mechanisms, they still suffer from inefficient memory and computational operations due to the tightly coupled page management and computation kernels. This study introduces the vTensor, an innovative tensor structure for LLM inference based on GPU virtual memory management (VMM). vTensor addresses existing limitations by decoupling computation from memory defragmentation and offering dynamic extensibility. Our framework employs a CPU-GPU heterogeneous approach, ensuring efficient, fragmentation-free memory management while accommodating various computation kernels across different LLM architectures. Experimental results indicate that vTensor achieves an average speedup of 1.86x across different models, with up to 2.42x in multi-turn chat scenarios. Additionally, vTensor provides average speedups of 2.12x and 3.15x in kernel evaluation, reaching up to 3.92x and 3.27x compared to SGLang Triton prefix-prefilling kernels and vLLM paged Attention kernel, respectively. Furthermore, it frees approximately 71.25% (57GB) of memory on the NVIDIA A100 GPU compared to vLLM, enabling more memory-intensive workloads.

View on arXivView PDF

Code Implementations(1)

antgroup/glakeCommunity100%
PyTorchApache-2.0

GLake: optimizing GPU memory management and IO transmission.

50245C, C++Jun 6, 20231 years agoApache-2.0
deepspeedgpullmmemoryonnx+1 more

Cite this paper

@article{xu2024vtensor,
  title  = {vTensor: Flexible Virtual Tensor Management for Efficient LLM Serving},
  author = {Jiale Xu and Rui Zhang and Cong Guo and Weiming Hu and Zihan Liu and Feiyang Wu and Yu Feng and Shixuan Sun and Changxu Shao and Yuhong Guo and Junping Zhao and Ke Zhang and Minyi Guo and Jingwen Leng},
  year   = {2024},
  eprint = {2407.15309},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2407.15309v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2407.15309.svg)](https://codeofpaper.com/paper/2407.15309)

Discussion