A Tensor Compiler for Processing-In-Memory Architectures

Peiming Yang, Sankeerth Durvasula, Ivan Fernandez, Mohammad Sadrosadati, Onur Mutlu, Gennady Pekhimenko, Christina GiannoulaarXiv 2025 · DOI

Abstract

Processing-In-Memory (PIM) architectures offer a promising solution to the "memory wall" by integrating compute units directly into memory banks. However, realizing their potential is hindered by the mismatch between host-centric data layouts and the local-access constraints of PIM cores. This paper presents DCC, a data-centric tensor compiler that jointly optimizes data layout rearrangements and compute code. By treating data movement as a first-class citizen, DCC achieves significant speedups—up to 13.17× for individual kernels and nearly 5× for end-to-end Large Language Model (LLM) inference—compared to traditional GPU-based execution.

Introduction

As Large Language Models (LLMs) like GPT-3 and LLaMA continue to scale, they increasingly encounter the "memory wall," where the energy and time required to move data between off-chip memory and the processor dominate performance. Processing-In-Memory (PIM) addresses this by placing logic units, or PIM cores, directly inside or near memory banks, effectively bringing computation to the data.

Despite its promise, PIM adoption faces a significant hurdle: data layout conflict. High-performance host processors, such as GPUs, interleave data across multiple memory banks to maximize parallel bandwidth. In contrast, a PIM core can typically only access data within its local bank. Consequently, running a kernel on PIM requires extensive data rearrangement. Traditional "compute-centric" compilers optimize mathematical operations first, treating data movement as a secondary concern. However, data rearrangement can account for over 60% of total execution time, making joint optimization essential.

Figure 1: Comparison of Host and PIM data layouts and the internal structure of a PIM device.

The DCC Framework

DCC (Data-Centric Compiler) is designed to bridge the gap between compute and data layout. It elevates data rearrangement to a primary optimization target through four key components:

  1. Multi-Layer Abstraction: DCC employs a three-level hierarchy (System, Group, and Core) to abstract hardware details. This allows it to support diverse PIM backends, from general-purpose designs like Samsung HBM-PIM to specialized accelerators like AttAcc, without requiring backend-specific rewrites.
  2. Data-Centric Schedule Generator: Inverting the traditional compilation flow, DCC first generates all possible data partitioning schemes across PIM resources. It then maps computation loops onto these partitions, ensuring that the resulting code adheres to the strict local-access constraints of PIM banks.
  3. PIM-Specific Code Optimizer: This module applies optimizations tailored for the unique constraints of PIM, such as hierarchical command generation. By broadcasting a single instruction to multiple cores within a group, DCC reduces the control traffic bottleneck at the memory controller.
  4. Coupled Performance Predictor: To navigate the vast search space of potential configurations, DCC uses an XGBoost-based machine learning model. This "coupled" predictor estimates the combined cost of both computation and data rearrangement, identifying the global optimum that balances fast compute with efficient data movement.
Figure 3: The DCC architecture overview, showing the flow from ML kernels to the predicted best-performing schedule.

Evaluation and Results

The researchers evaluated DCC using a range of workloads, including GEMV, Reduction, and Attention kernels, as well as end-to-end inference for GPT-3 (13B) and LLaMA-2 (33B). Performance was measured against high-end GPUs and manually-tuned PIM implementations using high-fidelity simulators like Ramulator 2.0.

DCC demonstrated substantial performance gains. For individual kernels, it achieved up to a 7.68× speedup on HBM-PIM and a 13.17× speedup on AttAcc compared to GPU-only execution. More importantly, for end-to-end LLM inference, DCC on the AttAcc backend provided a 4.88× average speedup over a high-end GPU.

A key insight from the evaluation is the "interdependence trap": a compute schedule that appears optimal in isolation may require a prohibitively expensive data layout. DCC’s joint optimization approach proved superior to compute-centric compilers like ATiM, which were found to be up to 1.26× slower due to the "hidden tax" of ignored data rearrangement costs. The XGBoost predictor achieved ~89% accuracy in picking the absolute best configuration, and even when it missed, the selected configuration was typically within 96% of optimal performance.

Conclusion

DCC represents a paradigm shift in PIM compilation by prioritizing data layout alongside computation. By successfully managing the complex trade-offs between data movement and processing, it unlocks the performance potential of near-bank PIM architectures for modern AI workloads. Future work aims to extend this data-centric approach to other emerging architectures, such as "Processing-Using-Memory" (PUM), and to further optimize runtime estimation for dynamic input shapes in real-time inference scenarios.

Summary updated

BibTeX
@misc{yang2025tensor,
  author = {Peiming Yang and Sankeerth Durvasula and Ivan Fernandez and Mohammad Sadrosadati and Onur Mutlu and Gennady Pekhimenko and Christina Giannoula},
  title = {{A Tensor Compiler for Processing-In-Memory Architectures}},
  year = {2025},
  eprint = {2511.15503},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2511.15503},
}
Figure