arXiv:2610.38809cs.LGOct 2026

Manuscript Offprint

arXiv:2610.38809

Causal Attention on CPU: A Cache-Aware and Load-Balanced Scheduling Kernel for Prefill

Kwun Fung Lau, Frost Mitchell, Kanya Mo, Emani Ashok

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

ABSTRACT

Agentic AI drives significant productivity gains across diverse domains, but concurrent long-context prefills from multiple agents can saturate GPU compute resources. Although CPUs offer a viable alternative, existing CPU attention kernels fall short in adapting to multi-tier cache hierarchies and lack effective thread scheduling. To address this, we introduce CACPU, a high-performance attention kernel featuring tiered cache blocking and an in-kernel task dispatching mechanism designed for causal full-sequence prefilling. CACPU achieves up to a 2.01x speedup over PyTorch SDPA, FlexAttention, and SGLang attention kernels. Integrated into SGLang, it reduces Time to First Token (TTFT) of Llama-3.1-8B by up to 1.74x while preserving model accuracy.

1 INTRODUCTION

Several recent efforts have explored CPU-based acceleration for large language models (LLMs). Gupta et al. (2026) adapt FlashAttention to scalable vector architectures, so that the kernel scales from short to long vectors on RISC-V CPU. Na et al. (2025) exploit CPU memory and computation alongside GPU resources, while Shen et al. (2023) improve CPU LLM inference through INT4 weight-only quantization and an optimized runtime. At the framework level SGLang and vLLM have introduced CPU-specific kernels (Li, 2026) and scheduler optimizations (Li, 2025). In this work, we specifically target causal attention mechanisms to accelerate the LLM serving pipelines, which will benefit agentic AI workloads on CPU architectures.

Agentic AI workloads require large language models (LLMs) to process extremely long contexts, which include intermediate reasoning steps (Wei et al., 2022) and tool call outputs (Schick et al., 2023). Building upon recent advancements in GPU attention kernels (Dao et al., 2022; Dao, 2024; Shah et al., 2024; Zadouri et al., 2026), we propose an optimized CPU attention kernel tailored specifically for the prefill phase to accelerate long-context processing in LLM serving frameworks. We introduce two core mechanisms: Two-Level Cache-Aware Scheduling and L3-Chunk-Scoped Cost-Prioritized Scheduling. The former minimizes redundant DRAM reads by partitioning sequences according to cache hierarchy budgets, while the latter addresses core workload imbalance through dynamic cost-based task dispatch from a shared task queue. Section 3 details the algo-

rithmic design of both mechanisms, and Section 4 presents their evaluations.

To be specific, our contributions are:

  • We propose a cache-aware scheduling strategy to minimize DRAM traffic, improve cache locality, and reduce latency for long sequences. Additionally, we introduce an analytical model that derives appropriate hyperparameters directly from tensor memory footprints and CPU cache capacities, eliminating the need for empirical per-CPU tuning.
  • We extend longest-processing-time-first (LPT) scheduling into the runtime kernel to dynamically balance workloads across both homogeneous and heterogeneous CPU architectures. By introducing an exact-cost analytical model and implementing a shared work queue in-kernel, our approach bypasses rigid manual thread pinning and delivers seamless portability across serving frameworks.
  • We identify a strong interaction effect between our two proposed optimizations. Microbenchmarks and ablation studies show that cache-aware scheduling alone is counterproductive on heterogeneous cores and provides only marginal benefits on Xeon CPUs. In contrast, integrating both techniques yields significant performance improvements. This provides a design insight for high-performance CPU kernel development.

†Equal second-author contribution. ¹Intel Corp., USA. Correspondence to: Kwun Fung Lau kwun.fung.lau@intel.com.

Preprint.

References (34)