arXiv:2610.12940cs.AROct 2026

Manuscript Offprint

arXiv:2610.12940

CacheFlex: Direct Software-Managed Access to Higher-Level Cache for Scalable Vector Support

Jingqun Zhang, Maohua Nie, Jiayi Wang, Weihang Li, Rishi Sappidi, Shwet Chitnis, Ang Li

Jingqun Zhang*, Maohua Nie*, Jiayi Wang*, Weihang Li†, Rishi Sappidi*, Shwet Chitnis*, Ang Li*

*University of Washington, Seattle, WA, USA †Rutgers University, New Brunswick, NJ, USA

{jq86, mhnie, jwang710, rsappidi, s2chitni, angliz}@uw.edu, weihang.li@rutgers.edu

Abstract—Modern CPUs demand urgent upgrades to keep up with the AI revolution. While peak compute throughput can be multiplied by widening vector/SIMD lanes, significant improvements of the cache system remain challenging. We pinpoint L1 data cache capacity as the single design parameter that yields the highest performance and efficiency gains. However, L1 capacity is constrained by its tight coupling within the core pipeline and the single-digit-cycle latency requirement, so we turn to the private L2 cache that provides an order of magnitude more capacity but is conventionally inaccessible from software. This work proposes CacheFlex, an ISA and microarchitecture co-design that enables software-managed, direct access to private L2 SRAM by allowing runtime conversion of parts of L2 into a scratchpad memory (SPM). Through a lightweight ISA extension, software explicitly controls data placement and lifetime within the L2. CacheFlex integrates into an out-of-order pipeline with cross-domain memory consistency and OS context-switch support, with merely 2.02% area overhead relative to the L2 in a post-layout 12 nm implementation. We prototype CacheFlex based on the Armv8-A SVE ISA, model it in gem5, and evaluate it using optimized general matrix multiplication (GEMM) kernels with diverse model-derived shapes, FlashAttention-based fused attention, and full-layer workloads from LLaMA-3.2-1B and BERT-Base in the prefill phase. As the vector length (VL) scales from VL=4 (512-bit) to VL=16 (2048-bit), CacheFlex's kernel-level geometric-mean speedup and memory-subsystem energy reduction grow from 1.12× and 26% to 1.44× and 40%, respectively, bridging the widening gap between per-instruction data demand and memory performance. On full transformer layers combining CacheFlex with FlashAttention, the design delivers up to 1.78× speedup and 45% memory-subsystem energy savings (BERT-Base, sequence length T=4096, VL=16; LLaMA-3.2-1B: 1.64× and 38%). CacheFlex is complementary to hardware prefetching, and its benefit grows as vector width and peak compute throughput increase for compute-intensive AI kernels.

Index Terms—processor microarchitecture, instruction set extension, scalable SIMD/vector processing, reconfigurable cache, scratchpad memory

I. INTRODUCTION

Specialized AI accelerators such as GPUs and TPUs dominate the training and serving of large AI models, yet general-purpose CPUs remain indispensable in the AI stack for two reasons. First, besides orchestrating accelerators and system I/O, CPUs take on many compute- and memory-intensive tasks such as pre-processing multi-modal data, post-processing generated tokens, and performing non-AI tasks in agentic AI workflows. Second, CPUs are increasingly compelling for direct AI inference under tight on-device latency, power, and thermal constraints [1], [2] and in on-premises enterprise deployments, where aggregating suitable AI workloads onto CPUs can lower total cost of ownership [3]. Both roles demand higher compute throughput from CPU cores.

Modern vector and packed single-instruction, multiple-data (SIMD) architectures leave ample headroom for scaling compute throughput by widening SIMD lanes and replicating SIMD functional units, yet the memory system cannot keep up. Specifically, CPUs' hardware-managed cache hierarchy optimized for minimal random-access latency is a poor match for AI kernels' highly regular, predictable memory access patterns.

CPUs’ memory performance is the result of the complex interplay among the instruction-issuing frontend, the retiring backend, the load/store unit (LSU), the cache hierarchy, and more. Synergistically upgrading multiple components is extremely challenging for high-performance CPUs that have already been meticulously optimized. In this work, we pinpoint L1 data (L1D) cache capacity as the single design parameter that yields the highest performance and efficiency gains (§II). This is because a larger L1D cache improves data reuse, which raises attainable throughput for dense tensor operations and reduces memory traffic. Cache bandwidth is less impactful because optimized kernels such as those in the Arm Compute Library (ACL) [4] use registers as a scratchpad for the innermost loops, and register bandwidth scales easily with vector width. Cache latency also has limited impact when it can be effectively hidden by the reorder buffer (ROB) and LSU.

However, directly enlarging the L1D cache is impractical. The L1D cache is typically integrated into the core execution pipeline, so any additional access latency or increased silicon area would require significant changes to the core microarchitecture. In contrast, a private L2 cache provides an order of magnitude more on-chip storage than the L1D cache, yet it is not directly accessible in software due to hardware-managed cache coherence, virtual memory, and the lack of instruction set architecture (ISA) support.

A question then arises: can we provide on-demand, software-managed access to a CPU’s private L2 cache while maintaining full compatibility with high-performance CPUs’ defining features such as speculative, out-of-order (OoO), superscalar execution and operating-system (OS) support?

This work presents an affirmative answer: CacheFlex, an ISA and microarchitecture co-design that dynamically converts a configurable subset of private L2 cache ways into a software-managed scratchpad memory (SPM).

© 2026 IEEE. Personal use of this material is permitted. Permission from IEEE must be obtained for all other uses, in any current or future media, including reprinting/republishing this material for advertising or promotional purposes, creating new collective works, for resale or redistribution to servers or lists, or reuse of any copyrighted component of this work in other works.

An ISA extension with SPM management and access instructions enables explicit software control of data placement and lifetime within the L2 cache. SPMs are created at runtime, private to a thread, and their L2 usage can be returned to hardware-managed cache mode when SPMs are explicitly deallocated or their owner thread is preempted. The non-SPM ways remain fully functional as a standard cache. A dedicated SPM LSU, with its own SPM load/store queue (LSQ), integrates CacheFlex into the OoO pipeline with full speculative/superscalar execution support and OS compatibility. The dedicated SPM LSU decouples register-facing SPM accesses (spm_ld/spm_st) from cross-domain transfers (spm_cp/spm_wb), allowing data movement to overlap computation and helping hide L2 latency. CacheFlex also synergizes well with other cache optimizations such as hardware prefetchers.

Scope. CacheFlex is a per-core memory mechanism, and we evaluate it on the compute-intensive general matrix multiplication (GEMM) and attention kernels that dominate the prefill (compute) phase of AI inference.

To summarize, this work makes the following contributions:

• Characterizing the CPU compute-memory gap. We show that widening SIMD vectors makes L1 capacity the primary bottleneck of GEMM throughput, driving persistent L1–L2 data movement and energy overhead.

  • CacheFlex architecture. We propose CacheFlex, an ISA and microarchitecture co-design that enables software-managed, direct access to the private L2 cache. We present a concrete realization on the Armv8-A ISA with Scalable Vector Extension (SVE), though the design principles are ISA-agnostic.

• Evaluating CacheFlex’s microarchitecture overheads and performance/efficiency gains across kernels and workloads. We synthesize CacheFlex component RTL in a commercial 12 nm FinFET technology for accurate power and area measurements. We then model CacheFlex in gem5 and evaluate it (single-core) across a wide range of GEMM dimensions and tiling configurations, fused kernels (FlashAttention-like [5], [6]), and full-layer workloads from LLaMA-3.2-1B and BERT-Base in the prefill phase. At the kernel level, CacheFlex achieves a geometric-mean 1.12×1.12\times speedup with 26% memory-subsystem energy reduction at vector length (VL)=4 (512-bit), scaling to 1.44×1.44\times with 40% energy reduction at VL=16 (2048-bit). On full transformer layers with FlashAttention, it delivers up to 1.78×1.78\times speedup and 45% memory-subsystem energy savings, at 2.02% area overhead relative to the L2.

References (56)