LoL-PIM: Long-Context LLM Decoding with Scalable DRAM-PIM System

Hyucksung Kwon, Kyungmo Koo, Janghyeon Kim, Woongkyu Lee, Minjae Lee, Hyungdeok Lee, Yousub Jung, Jaehan Park, Yosub Song, Byeongsu Yang, Haerang Choi, Guhyun Kim, Jongsoon Won, Woojae Shin, Changhyun Kim, Gyeongcheol Shin, Yongkee Kwon, Ilkon Kim, Euicheol Lim, John Kim, Jungwook ChoiarXiv 2024 · DOI

Introduction

As Large Language Models (LLMs) move toward handling million-token context windows, they encounter a severe "memory wall." The autoregressive decoding phase is inherently memory-bound, making Processing-in-Memory (PIM)—where compute units are integrated directly into DRAM—an attractive solution. However, standard PIM systems struggle with long-context efficiency. This paper introduces PIMphony, an orchestration framework that optimizes PIM for massive context lengths through token-centric partitioning and dynamic scheduling.

The Memory Wall in Long-Context LLMs

The primary challenge in scaling LLM context length is the exponential growth of the Key-Value (KV) cache. Traditional GPU-based systems quickly run out of memory as context length increases, as shown in the scaling trends below.

GPU memory footprint vs. context length, illustrating the "Out of Memory" threshold.

Existing PIM systems, while promising, suffer from three major inefficiencies when handling long contexts:

  1. Channel Underutilization: Static partitioning by head or batch leaves memory channels idle when batch sizes are small due to high memory pressure.
  2. I/O Bottlenecks: Rigid, in-order command scheduling creates "bubbles" in the compute pipeline while waiting for internal data movement.
  3. Static Memory Waste: Pre-allocating KV cache for maximum context length wastes over 60% of memory capacity for shorter requests.

PIMphony: Orchestrating for Efficiency

PIMphony addresses these gaps with three co-designed techniques integrated into a unified architecture, managed by an MLIR-based compiler.

Overview of the PIMphony architecture, highlighting Token-Centric Partitioning (TCP), Dynamic PIM Access (DPA), and Dynamic Command Scheduling (DCS).

1. Token-Centric PIM Partitioning (TCP)

TCP shifts the parallelization strategy from the batch/head dimension to the token dimension. By distributing segments of a single head's tokens across all available PIM channels, TCP ensures high hardware utilization even with a batch size of one, which is common in memory-constrained long-context scenarios.

2. Dynamic PIM Command Scheduling (DCS)

DCS implements an out-of-order execution engine for PIM. By tracking data readiness via a hardware dependency table, it overlaps data transfers with computation, effectively hiding internal bus latency and eliminating pipeline bubbles.

3. Dynamic PIM Access (DPA)

DPA acts as a lightweight Memory Management Unit (MMU) for PIM. It enables "lazy" allocation of the KV cache in 1MB chunks. By embedding virtual-to-physical address translation directly into the PIM hub, it breaks the requirement for contiguous static allocation and significantly improves memory utilization.

Key Results and Impact

Evaluated using cycle-accurate simulations across benchmarks like LongBench and LV-Eval, PIMphony demonstrates substantial performance gains:

  • Throughput: Achieves up to 11.3× speedup over baseline PIM systems and 8.4× over heterogeneous NPU+PIM systems.
  • Memory Utilization: Increases average capacity utilization from 36.2% to 75.6%, effectively doubling the number of concurrent requests the system can handle.
  • Scalability: Maintains high performance up to 1 million tokens, outperforming baselines by 46.6× at extreme scales.
  • Efficiency: Reduces total energy consumption by 3.46× by accelerating attention layers and minimizing background power waste.

Conclusion

PIMphony bridges the gap between PIM hardware capabilities and the demands of million-token LLMs. By rethinking partitioning, scheduling, and memory management, it enables efficient long-context decoding with a modest 4% area overhead. Future work will explore its application to multi-modal models and physical silicon implementation.

Summary updated

BibTeX
@misc{kwon2024lol,
  author = {Hyucksung Kwon and Kyungmo Koo and Janghyeon Kim and Woongkyu Lee and Minjae Lee and Hyungdeok Lee and Yousub Jung and Jaehan Park and Yosub Song and Byeongsu Yang and Haerang Choi and Guhyun Kim and Jongsoon Won and Woojae Shin and Changhyun Kim and Gyeongcheol Shin and Yongkee Kwon and Ilkon Kim and Euicheol Lim and John Kim and Jungwook Choi},
  title = {{LoL-PIM: Long-Context LLM Decoding with Scalable DRAM-PIM System}},
  year = {2024},
  eprint = {2412.20166},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2412.20166},
}
Figure