FairKV: Balancing Per-Head KV Cache for Fast Multi-GPU Inference

Fuente: arXiv
Salvato in:
Dettagli Bibliografici
Autori principali: Zhao, Bingzhe, Cheng, Ke, Yuan, Aomufei, Tian, Yuxuan, Zhong, Ruiguang, Hu, Chengchen, Yang, Tong, Yu, Lian
Natura: Preprint
Pubblicazione: 2025
Soggetti:
Accesso online:
Tags: Aggiungi Tag
Nessun Tag, puoi essere il primo ad aggiungerne!!
_version_ 1866909614063222784
author Zhao, Bingzhe
Cheng, Ke
Yuan, Aomufei
Tian, Yuxuan
Zhong, Ruiguang
Hu, Chengchen
Yang, Tong
Yu, Lian
author_facet Zhao, Bingzhe
Cheng, Ke
Yuan, Aomufei
Tian, Yuxuan
Zhong, Ruiguang
Hu, Chengchen
Yang, Tong
Yu, Lian
contents KV cache techniques in Transformer models aim to reduce redundant computations at the expense of substantially increased memory usage, making KV cache compression an important and popular research topic. Recently, state-of-the-art KV cache compression methods implement imbalanced, per-head allocation algorithms that dynamically adjust the KV cache budget for each attention head, achieving excellent performance in single-GPU scenarios. However, we observe that such imbalanced compression leads to significant load imbalance when deploying multi-GPU inference, as some GPUs become overburdened while others remain underutilized. In this paper, we propose FairKV, a method designed to ensure fair memory usage among attention heads in systems employing imbalanced KV cache compression. The core technique of FairKV is Fair-Copying, which replicates a small subset of memory-intensive attention heads across GPUs using data parallelism to mitigate load imbalance. Our experiments on popular models, including LLaMA 70b and Mistral 24b model, demonstrate that FairKV increases throughput by 1.66x compared to standard tensor parallelism inference. Our code will be released as open source upon acceptance.
format Preprint
id arxiv_https___arxiv_org_abs_2502_15804
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle FairKV: Balancing Per-Head KV Cache for Fast Multi-GPU Inference
Zhao, Bingzhe
Cheng, Ke
Yuan, Aomufei
Tian, Yuxuan
Zhong, Ruiguang
Hu, Chengchen
Yang, Tong
Yu, Lian
Distributed, Parallel, and Cluster Computing
Artificial Intelligence
KV cache techniques in Transformer models aim to reduce redundant computations at the expense of substantially increased memory usage, making KV cache compression an important and popular research topic. Recently, state-of-the-art KV cache compression methods implement imbalanced, per-head allocation algorithms that dynamically adjust the KV cache budget for each attention head, achieving excellent performance in single-GPU scenarios. However, we observe that such imbalanced compression leads to significant load imbalance when deploying multi-GPU inference, as some GPUs become overburdened while others remain underutilized. In this paper, we propose FairKV, a method designed to ensure fair memory usage among attention heads in systems employing imbalanced KV cache compression. The core technique of FairKV is Fair-Copying, which replicates a small subset of memory-intensive attention heads across GPUs using data parallelism to mitigate load imbalance. Our experiments on popular models, including LLaMA 70b and Mistral 24b model, demonstrate that FairKV increases throughput by 1.66x compared to standard tensor parallelism inference. Our code will be released as open source upon acceptance.
title FairKV: Balancing Per-Head KV Cache for Fast Multi-GPU Inference
topic Distributed, Parallel, and Cluster Computing
Artificial Intelligence
url https://arxiv.org/abs/2502.15804