Back to search

Chalmers University of Technology

Profiling and Visualizing CPU-Based LLM Inference in llama.cpp

Abstract

dc:description.abstract

Large language models (LLMs) are increasingly deployed on local hardware rather than through cloud services, motivated by concerns around data privacy, network dependence, and operational cost. In many local deployments, the CPU serves as the primary or sole compute resource, since dedicated accelerators such as GPUs are not always available. Running LLMs on CPUs is technically demanding, as in ference performance is shaped by complex interactions between the workload and the underlying hardware. Identifying performance bottlenecks is therefore essential for improving local LLM inference, but is difficult without structured measurement and analysis. This bachelor’s thesis presents a profiling and visualization tool for characterizing LLM inference on CPUs using an inference serving framework called llama.cpp. The tool collects hardware performance counters, which are low-level CPU metrics such as cache accesses and floating-point operations, at four levels of granularity: the entire inference run, the prefill phase in which the user’s input prompt is processed and the decode phase in which the response is generated token by token, individual decoder blocks, and individual tensor operations. Measurements are stored in a structured database and can be explored through a graphical dashboard, allowing users to inspect runtime, memory traffic, cache behavior, and other metrics across different quantization formats and model sizes. By applying roofline analysis, the tool distinguishes between compute-bound and memory-bound behavior and supports the identification of performance bottlenecks during local LLM inference.

Degree

thesis:*
Level thesis:degree_level
M2
Department dc:contributor.department
Chalmers tekniska högskola / Institutionen för data och informationsteknik
Year dc:date.issued
2026

Author and committee

dc:creator, dc:contributor.*
Authors dc:creator
  • Bohman, David
  • Krümmel, August
  • Mohammadi, Mirveys
  • Shehada, Stevan
  • Tervo, Emil

Subjects

dc:subject × 1

Rights

Language dc:language.iso
eng

Identifiers

dc:identifier.*

Chain of custody

source
Harvested from
Chalmers University of Technology
Base URL
odr.chalmers.se/oai/request
Last updated
2026-11-19
Source record
OAI-PMH GetRecord
citation

Bohman, David; Krümmel, August; Mohammadi, Mirveys; Shehada, Stevan; Tervo, Emil. Profiling and Visualizing CPU-Based LLM Inference in llama.cpp. M2 thesis, 2026. https://hdl.handle.net/20.500.12380/311717