Heterogeneous LLM Serving with General-Purpose Processing-Near-Memory for Retrieval-Based Sparse Attention

TL;DR

Proposes KARAT heterogeneous system with general-purpose near-memory processing, boosting sparse attention throughput by up to 6.13× for long-context LLMs.

cs.AR 🔴 Advanced 2026-08-04 61 views
Hyungkyu Ham Junhyeong Bae Seungheon Lee Myeongjae Jeon Gwangsun Kim
Large Language Models Sparse Attention Heterogeneous Hardware Near-Memory Processing System Optimization

Key Findings

Methodology

This work analyzes the hardware bottlenecks in long-context LLMs employing retrieval-based sparse attention, proposing a heterogeneous decode system that relocates KV caches outside GPU memory. The system divides decode steps into GPU and PNM (Processing Near Memory) operations: GPUs handle dense computations like projections and MoE layers, while KARAT nodes store KV caches and execute read operations. The design is driven by four key requirements: capacity, bandwidth, compute, and generality. The authors introduce KARAT, a hardware architecture combining large LPDDR memory with general-purpose GPNM cores, supporting diverse sparse algorithms. Micro-batch scheduling (OFMS) and context-aware rebalancing (CMR) are integrated to optimize pipeline efficiency. Experiments on three state-of-the-art models demonstrate throughput improvements of 2.09× to 6.13×, and energy efficiency gains of 1.36× to 3.21×, validating the approach.

Key Results

  • Across models like GLM-5.2, MiniMax-M3, and DeepSeek-V3.2, the system achieves 2.09–6.13× throughput gains under service-level objectives (e.g., 100ms per token), significantly alleviating capacity and bandwidth bottlenecks.
  • The hardware supports multiple sparse attention algorithms, avoiding fixed-function limitations, and adapts to algorithm evolution.
  • Micro-batch scheduling and context-aware rebalancing substantially reduce pipeline bubbles, enhancing resource utilization and overall throughput.

Significance

This research addresses critical bottlenecks in deploying large-scale long-context models, offering a scalable hardware solution that balances capacity, bandwidth, and compute. It enables efficient multi-turn dialogue and long-text understanding, facilitating real-world deployment of massive models. The heterogeneous approach improves performance and energy efficiency, paving the way for more practical AI applications. Its flexibility supports algorithm innovation, fostering future advancements in sparse attention mechanisms and hardware design, thus significantly impacting both academia and industry.

Technical Contribution

The paper introduces KARAT, a novel hardware architecture that combines large-capacity LPDDR memory with general-purpose GPNM cores, supporting diverse sparse attention algorithms. It departs from fixed-function PIM/PNM units, providing a flexible, scalable solution for long-context processing. The integration of micro-batch scheduling (OFMS) and context-aware rebalancing (CMR) optimizes pipeline efficiency. The system demonstrates how heterogeneous devices can collaborate seamlessly, achieving high throughput and energy efficiency in long-context scenarios, thus advancing hardware design for large models.

Novelty

This is the first work to develop a general-purpose PNM architecture supporting multiple retrieval-based sparse attention algorithms, overcoming fixed-function limitations. It innovatively combines large LPDDR storage with flexible GPNM cores, enabling capacity, bandwidth, and compute to be balanced simultaneously. The introduction of fine-grained micro-batch scheduling and context-aware rebalancing further distinguishes this approach, setting a new standard for hardware support of evolving sparse attention methods.

Limitations

  • The system relies on high-speed network connections; network latency could impact micro-batch scheduling efficiency, especially in extremely long contexts or high concurrency scenarios.
  • Hardware complexity and cost are significant, involving integration of large memory modules and flexible cores, which may limit large-scale deployment in cost-sensitive environments.
  • Supporting a broad range of algorithms requires continuous hardware and software co-design, posing challenges for future scalability and adaptability.

Future Work

Future directions include optimizing micro-batch scheduling algorithms to further reduce pipeline bubbles, developing cost-effective hardware implementations, and extending support to emerging sparse attention variants. Additionally, integrating custom AI accelerators and exploring hardware-software co-design will enhance system flexibility and scalability, enabling deployment in diverse AI workloads and real-time applications.

AI Executive Summary

The rapid growth of large language models (LLMs) has revolutionized natural language processing, yet deploying these models with long contexts remains a significant challenge. Traditional GPU architectures face bottlenecks in memory capacity, bandwidth, and compute, especially when handling millions of tokens. To address this, the authors propose a heterogeneous decode system that relocates KV caches from GPU memory to dedicated near-memory processing (PNM) devices, significantly alleviating storage and bandwidth constraints.

This system divides the decode process into two parts: GPU handles dense computations like projections and MoE layers, while KARAT nodes, equipped with large LPDDR memory and general-purpose cores, manage KV cache storage and read operations. The design is driven by four core requirements: high capacity, high bandwidth, sufficient compute, and algorithmic flexibility. To optimize pipeline efficiency, the authors introduce two scheduling techniques: opportunistic micro-batch scheduling (OFMS), which overlaps communication with computation, and context-length-aware rebalancing (CMR), which balances token counts across micro-batches.

Extensive experiments on three state-of-the-art models demonstrate that this architecture achieves 2.09× to 6.13× throughput improvements under service-level objectives, with energy efficiency gains of 1.36× to 3.21×. These results validate the effectiveness of heterogeneous hardware collaboration in long-context LLM deployment. The approach not only enhances performance but also supports algorithm evolution, offering a scalable, flexible solution for future AI systems.

Looking ahead, future work will focus on refining scheduling algorithms, reducing hardware costs, and supporting emerging sparse attention variants. The proposed architecture paves the way for more efficient, adaptable, and scalable deployment of massive language models, impacting both research and industry by enabling practical long-context AI applications.

Deep Analysis

Background

Recent advances in LLMs like GPT-4, GLaM, and PaLM have demonstrated unprecedented capabilities in NLP tasks. However, scaling these models to handle long contexts (millions of tokens) introduces hardware bottlenecks, especially in memory capacity and bandwidth. Traditional GPU-based systems struggle with storing and accessing large KV caches, which are essential for efficient attention mechanisms. Sparse attention algorithms, such as retrieval-based methods like GQA, DeepSeek, and MLA, have been proposed to reduce computational load by selectively attending to relevant tokens. Despite these innovations, existing hardware solutions—such as offloading KV caches to host memory or employing fixed-function PIM/PNM units—fail to meet the combined demands of capacity, bandwidth, and algorithmic flexibility. This gap motivates the development of a heterogeneous system that can adapt to diverse algorithms and long contexts, ensuring scalable and efficient deployment of future large models.

Core Problem

The core challenge lies in balancing the conflicting demands of large KV cache storage, high bandwidth for retrieval operations, and flexible computation to support evolving sparse attention algorithms. GPU memory limitations restrict batch sizes and increase latency, while fixed-function near-memory units cannot accommodate algorithmic diversity. Existing solutions either sacrifice capacity or flexibility, leading to performance bottlenecks. The problem becomes more acute with multi-turn agentic workloads, where context length can reach hundreds of thousands of tokens, demanding hardware that can sustain high operational intensity without compromising energy efficiency. Designing a system that integrates large-capacity memory, high-bandwidth access, and general-purpose compute remains an open and pressing issue.

Innovation

This work introduces KARAT, a novel heterogeneous hardware architecture that combines large LPDDR memory modules with general-purpose GPNM cores, supporting diverse retrieval-based sparse attention algorithms. Unlike prior fixed-function PIM/PNM units, KARAT's cores are programmable, enabling adaptation to algorithmic variations. The system employs micro-batch scheduling (OFMS) to overlap communication and computation, reducing pipeline stalls, and context-aware rebalancing (CMR) to equalize token counts across micro-batches, minimizing idle time. The architecture facilitates seamless collaboration between GPU and KARAT devices, with data placement strategies ensuring minimal communication overhead. These innovations collectively address the core bottlenecks of capacity, bandwidth, compute, and flexibility, enabling efficient long-context processing at scale.

Methodology

  • �� System architecture: Decouples dense and sparse operations, assigning dense projections and MoE layers to GPU nodes, while KARAT nodes handle KV cache storage and retrieval operations.
  • �� Hardware design: Each KARAT device integrates large LPDDR memory with GPNM cores capable of executing diverse sparse attention algorithms.
  • �� Scheduling strategies: OFMS overlaps micro-batch communication with computation by interleaving tasks; CMR balances token counts across micro-batches based on context length, reducing pipeline bubbles.
  • �� Data flow: During prefill, KV caches are transferred to KARAT nodes; during decode, GPU constructs index queries, KARAT performs index scan, gather, and attention, then results are sent back to GPU.
  • �� Optimization: Data placement ensures requests are localized, minimizing cross-device communication; pipeline is optimized by dynamic scheduling to adapt to workload variance.

Experiments

Using three models—GLM-5.2, MiniMax-M3, DeepSeek-V3.2—the authors evaluate throughput, energy efficiency, and latency under real agentic traces with context lengths up to 1 million tokens. Baseline comparisons involve GPU-only systems running the same models with native sparse attention methods. The experiments test the impact of OFMS and CMR, measuring micro-batch throughput, pipeline bubbles, and resource utilization. Hyperparameters include micro-batch sizes from 1 to 16, with service-level objectives set at 100ms per token. Results demonstrate consistent performance gains, validating the effectiveness of the heterogeneous approach and scheduling techniques.

Results

The proposed system achieves 2.09× to 6.13× throughput improvements across models under the P99 time-between-tokens constraint, with energy efficiency gains of 1.36× to 3.21×. Micro-batch scheduling (OFMS) effectively overlaps communication with computation, reducing idle time. Context-aware rebalancing (CMR) maintains balanced token counts despite variance in request length, further boosting pipeline efficiency. The hardware supports multiple sparse attention variants, demonstrating flexibility and robustness. Overall, the results confirm that heterogeneous hardware collaboration can overcome traditional bottlenecks in long-context LLM deployment, enabling scalable and energy-efficient inference.

Applications

This architecture is ideal for deploying large-scale, multi-turn conversational AI, long-text summarization, and document understanding systems. It enables efficient inference with millions of tokens, reducing latency and energy consumption. The system's flexibility supports evolving sparse attention algorithms, making it adaptable for future AI models. It can be integrated into data centers and cloud services, facilitating real-time, long-context AI applications across industries such as customer service, content creation, and legal analysis.

Limitations & Outlook

Dependence on high-speed network infrastructure may limit performance in distributed environments with high latency. Hardware complexity and costs are significant, requiring advanced manufacturing and integration. Supporting a broad spectrum of algorithms demands ongoing hardware/software co-design, which could hinder rapid adaptation. Future work must address these challenges to ensure broader adoption and cost-effectiveness.

Plain Language Accessible to non-experts

想象你在一家大型厨房里做饭,厨房里有很多不同的厨具和存储空间。传统上,你用一个大锅(GPU)来煮所有的菜,但当菜变得特别多、特别复杂时,这个锅就不够用了。于是,你决定把一些原料(KV缓存)放到专门的大冰箱(KARAT设备)里,这样可以存放更多的食材,不用担心空间不够。每次做菜时,你会用不同的厨具(硬件)来处理不同的任务:一些厨具专门用来切菜(模型参数计算),而冰箱里的存储空间负责存放和取出食材(KV缓存和索引)。你还设计了一套聪明的调度方法,比如在切菜和煮饭之间穿插,确保厨房的每个角落都在高效工作。这样一来,无论菜多复杂,厨房都能快速完成,节省时间和能源。这就像论文中的系统,把存储和计算分开合作,让大模型处理长文本变得更快、更省力。

ELI14 Explained like you're 14

想象你在玩一个超级复杂的拼图游戏,你需要用很多不同的碎片拼出一幅大画。以前,你把所有碎片都放在一个箱子里,找起来很慢,还容易乱。现在,你的朋友帮你把碎片分类存放在不同的箱子里:一个专门存放大块碎片(模型参数),另一个存放小碎片(KV缓存和索引)。每次拼图时,你只需要从对应的箱子里拿碎片,然后拼在一起。这样一来,你可以更快完成拼图,还能拼出更复杂的图案。这个系统就像论文里的设计,把存储和拼图(计算)分开,让整个过程变得更快、更省力。未来,还可以让更多朋友加入帮忙,拼得更快!

Abstract

This paper presents a heterogeneous decode-phase serving system that relocates the KV cache out of GPU memory, motivated by the retrieval-based sparse attention that recent frontier LLMs adopt to serve million-token contexts. It partitions a decode step by operation type: GPU nodes hold the model weights and execute the projections and MoE layers, while processing-near-memory (PNM) nodes hold the KV cache and index keys and execute every operation that reads them. We first show that the assumptions behind prior PIM and PNM designs no longer hold for these operations, and derive four design requirements for such a node. From these requirements, we propose KARAT (KV-cache-resident Accelerator for Retrieval-based ATtention), a general-purpose PNM design that is the design point meeting all four. A KARAT device combines large LPDDR capacity with general-purpose compute sized for the retrieval indexer, serving an operational intensity beyond what PIM/PNM designs built for low-intensity GEMV target while accommodating diverse sparse attention algorithms that fixed-function units cannot support as they evolve. To reduce pipeline bubbles as the two device types alternate between micro-batches, we further propose opportunistic, fine-grained micro-batch scheduling (OFMS), which hides expert all-to-all behind the other micro-batch's GEMMs, and context-length-aware micro-batch rebalancing (CMR), which equalizes their token counts despite the variance in context length. Across three state-of-the-art models and real agentic traces, our proposed system improves throughput per TDP under a service-level objective by 2.09-6.13x over a GPU-only baseline and runs training-free sparse attention methods with 1.36-3.21x improvements.

cs.AR