HGCA: Hybrid GPU-CPU Attention for Long Context LLM Inference

Weishu Deng, Yujie Yang, Peiran Du, Lingfeng Xiang, Zhen Lin +4 more
7/3/2025
cs.LG

No confident code implementation found for this paper. 1 possible match can be shown below.

Abstract

Scaling inference for large language models (LLMs) is increasingly constrained by limited GPU memory, especially due to growing key-value (KV) caches required for long-context generation. While existing approaches offload KV caches to CPU memory or apply sparse attention to reduce GPU load, they often underutilize CPU compute resources and compromise accuracy. We present HGCA, a hybrid CPU-GPU attention mechanism that enables scalable, high-throughput LLM inference with near-full attention quality. HGCA performs dense attention on recently generated KV entries retained in GPU memory and parallel sparse attention on selected, salient KV entries in CPU memory. The attention outputs are efficiently merged using log-sum-exp fusion, minimizing PCIe transfer overhead. HGCA also introduces a finegrained, per-head sparsification strategy optimized for CPU execution, preserving contextual relevance while reducing computation. Our implementation seamlessly integrates into existing LLM frameworks without requiring model retraining. Experiments across diverse models and workloads show that HGCA achieves superior scalability, supports longer sequences and larger batch sizes, and outperforms existing sparse attention baselines in both performance and accuracy -- all on commodity GPU hardware.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. 1 weaker match is hidden by default — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{deng2025hgca,
  title  = {HGCA: Hybrid GPU-CPU Attention for Long Context LLM Inference},
  author = {Weishu Deng and Yujie Yang and Peiran Du and Lingfeng Xiang and Zhen Lin and Chen Zhong and Song Jiang and Hui Lu and Jia Rao},
  year   = {2025},
  eprint = {2507.03153},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2507.03153v1}
}

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/2507.03153.svg)](https://codeofpaper.com/paper/2507.03153)

Discussion