Manuscript Offprint

arXiv:2611.07707

CAMP: Context-Aware Mapping and Placement for LLMs on 3D-IMC Arrays

Orhun Görkem, Athanasios Vasilopoulos, Georgios Pagonis, Victoria Clerico, Hadjer Benmeziane, Irem Boybat, Hsinyu Tsai, Abu Sebastian, William Andrew Simon

Orhun Görkem

IBM Research

Rüschlikon, Switzerland

orhun.goerkem1@ibm.com

Athanasios Vasilopoulos

IBM Research

Rüschlikon, Switzerland

ATV@zurich.ibm.com

Georgios Pagonis

IBM Research

Rüschlikon, Switzerland

Georgios.Pagonis@ibm.com

Victoria Clerico

IBM Research

Rüschlikon, Switzerland

Victoria.Clerico.Da.Costa@ibm.com

Hadjer Benmeziane

IBM Research

Rüschlikon, Switzerland

Hadjer.Benmeziane@ibm.com

Irem Boybat

IBM Research

Rüschlikon, Switzerland

IBO@zurich.ibm.com

Hsinyu Tsai

IBM Research

San Jose, CA, USA

htsai@us.ibm.com

Abu Sebastian

IBM Research

Rüschlikon, Switzerland

ASE@zurich.ibm.com

William Andrew Simon

IBM Research

Rüschlikon, Switzerland

William.Simon1@ibm.com

Abstract

Large Language Models (LLMs) incur severe memory-access overheads due to the cost of loading large weight matrices and Key-Value (KV) caches. Analog In-Memory Computing (AIMC) is an emerging solution that enables computation directly on static weights stored in memory, substantially reducing energy and latency. 3D-IMC further stacks memory arrays into vertical tiers, increasing capacity but revealing a new challenge: how weights are placed in memory determines which Matrix-Vector Multiplications (MVMs) can execute concurrently, affecting latency and throughput. The concurrency aspect of 3D-IMC weight-mapping remains underexplored in the literature, leading to sub-optimal utilization of compute resources on 3D-IMC chips.

In this context we propose Context-Aware Mapping and Placement (CAMP), an inference-context-aware weight mapping algorithm for 3D-IMC-based LLM accelerators. CAMP captures the potential resource contention resulting from the architecture, targeted network, and runtime context in a conflict matrix, enabling throughput-optimized weight mapping. This mapping is refined through a profiling-driven feedback loop that efficiently prunes the search space and returns optimized mappings within practical runtimes. CAMP is an offline, software-based solution requiring no hardware changes and improving 3D-IMC compute utilization from 42.4% to 60.3%, delivering up to 2.0× higher 3D-IMC throughput and 1.74× higher end-to-end throughput over state-of-the-art mapping algorithms.

CCS Concepts: • Computer systems organization → Heterogeneous (hybrid) systems; Parallel architectures; • Hardware → Emerging architectures.

Keywords: In-memory computing; LLM inference; batch-parallelism; weight mapping; 3D-IMC

1 Introduction

Large Language Models (LLMs) have recently demonstrated remarkable capabilities across natural language processing and beyond [27], making them widely adopted in industry and everyday life. Serving LLMs efficiently is therefore an important but challenging goal, made harder by growing parameter counts [24, 27, 44].

The mainstream hardware for LLM inference is the Graphics Processing Unit (GPU). While well suited to the compute-heavy prefill phase, GPU compute resources are underutilized during the memory-bound decode phase [15, 22, 24], where limited memory bandwidth results in Key-Value (KV) cache and weight loading dominating inference time. Prior works target the KV-loading bottleneck via software techniques such as KV compression [38, 45, 48], new models such as State-Space Models (SSMs) [11], or memory-centric hardware such as Dynamic Random-Access Memory (DRAM)-based Processing-In-Memory (PIM) [12, 22, 32, 46]. Meanwhile, the weight loading bottleneck can be mitigated with sparsity and quantization [13, 26], or eliminated altogether via Non-Volatile Memory (NVM)-based Analog In-Memory Computing (AIMC) accelerators [3–5, 9, 25, 41].

AIMC accelerators eliminate weight movement by executing Matrix-Vector Multiplications (MVMs) involving static weights directly within the memory array. However, NVM's poor write and endurance characteristics [19] require all network weights to fit on-chip. As model size grows, this constraint has encouraged research into 3D AIMC devices, whose memory arrays consist of vertically stacked tiers, enabling high storage density [5, 9, 25, 41].

An open-source script for simulations can be found at https://anonymous.4open.science/r/3DIMC_CM_Mapping-904D/.

Orhun Görkem, Athanasios Vasilopoulos, Georgios Pagonis, Victoria Clerico, Hadjer Benmeziane, Irem Boybat, Hsinyu Tsai, Abu Sebastian, and William Andrew Simon

Figure

Figure 1. (a) Static weights may be mapped to improve the latency of an individual MVM (TP) or enable MVMs to execute concurrently (BP). (b) Existing algorithms always maximize TP agnostically to inference context. (c) In contrast, CAMP maps in a context-aware manner by first encoding the context in a conflict matrix. (d) A refinement loop converges to a mapping with an optimized balance of TP, BP, and EP, (e) improving runtime efficiency via better utilization of 3D-IMC compute resources.

While 3D AIMC (3D-IMC) increases storage capacity via vertical integration, compute capability remains static, as multiple tiers within the same array cannot be accessed simultaneously. This limitation creates a trade-off between prioritizing single-MVM latency and enabling inter-MVM concurrency, which can be tuned through the weight mapping as illustrated in Figure 1a. Weight mapping determines the degree of Tensor Parallelism (TP) by fixing how many compute resources are allocated to a single MVM, tuning its latency. It also determines the degree of Batch Parallelism (BP), the ability of the accelerator to process multiple tokens within a batch concurrently by assigning MVMs to disjoint resources and enabling inter-token computation overlap. Finally, for Mixture-of-Experts (MoE) models, weight mapping defines Expert Parallelism (EP), or how compute resources are allocated to experts within an MoE layer.

Although optimized weight mapping benefits runtime performance due to better compute utilization, optimizing 3D-IMC weight mapping is challenging:

Optimizing individual parallelism dimensions by finding a mapping that maximizes even a single form of parallelism is difficult due to varying LLM workload structures, runtime contexts, and accelerator architectures.

Balancing parallelism across the TP, BP, and EP paradigms is another challenge, as optimizing one form of parallelism can directly constrain the others [16]. For example, increasing TP allocates more resources to a single MVM, reducing available resources for concurrently executing other MVMs and thereby limiting BP. Similarly, increasing EP concentrates resources in experts, allowing experts to run concurrently but reducing availability to other MVMs.

Robustness across inference contexts consisting of system architectures, varying workloads, and expected runtime contexts is necessary to develop a generally applicable performant mapping solution.

Finally, mapping-space complexity precludes exhaustive search due to the enormous weight mapping search space, which grows rapidly with the number of MVMs to be mapped and the number of available resource configurations along both the planar and vertical dimensions. State-of-the-art mapping methods [3, 5] overcome this by greedy mapping procedures only maximizing TP, at the expense of BP, EP, and robustness against varying inference contexts.

To address these challenges, we propose Context-Aware Mapping and Placement (CAMP), an inference-context-aware mapping algorithm for 3D-IMC-based LLM accelerators. Figure 1 provides an overview of CAMP. CAMP addresses the challenges of weight mapping as follows:

(1) First, a profiling phase analyzes the workload under the expected inference context — the system architecture, target LLM, and runtime context — and encodes the probability of resource conflicts between pairs of static MVMs into a conflict matrix. The mapping process then uses this matrix to adapt automatically and robustly to the given circumstances.

(2) Next, an initial mapping phase maps all static MVMs to the 3D-IMC accelerator, using the conflict matrix to map MVMs likely to contend for resources to disjoint resource groups, improving BP and EP.

(3) Finally, the mapping is refined via a profile-guided, feedback-driven pruned search, which utilizes the projected latency of varied candidate mappings to guide refinement toward operating points at which the balance between TP, BP, and EP is tuned for maximum resource utilization.

The exact planar and vertical weight placements are obtained efficiently through a proxy penalty computed from the conflict matrix, which prunes a large region of the search space. A beam search strategy trades solution optimality against optimization time, placing CAMP between a fully greedy heuristic and globally optimal methods, while yielding near-optimal mappings within acceptable runtimes.

The contributions of this paper are thus:

  • We analyze how system architecture, LLM model, and runtime characteristics, collectively referred to as the inference context, impact runtime throughput and latency.
  • We introduce the conflict matrix, a compact abstract representation that encodes the inference context in a single structure amenable to efficient optimization.
  • We propose Context-Aware Mapping and Placement (CAMP), an inference-context-aware weight-mapping algorithm built on this abstraction, which first determines each weight tensor's placement shape and assignment to 3D-IMC, then refines placement via a pruned search over reshapings, guided by profiling-in-the-loop feedback.
  • We demonstrate cross-regime adaptivity, as CAMP produces markedly different mappings across runtime contexts, networks, and hardware, minimizing latency at low batch sizes, maximizing throughput at high batch sizes, and natively enabling EP in MoE LLMs.

Thorough evaluations demonstrate up to 2.0× higher 3D-IMC runtime throughput, 1.74× higher end-to-end throughput, and a 42% increase in 3D-IMC compute utilization, validating CAMP's 3D-IMC weight mapping effectiveness.

References (16)