Local Inference of LLMs on Long Contexts: A Data Systems Perspective
Organizations: University of Fribourg, Fribourg, Switzerland · Computing Flows GmbH, Fribourg, Switzerland
Abstract
Large language models can solve complex problems across a variety of subjects, such as mathematics and coding. For such complex analytical tasks, models with a long context perform better. Serving models with long context is currently mostly done on powerful systems with multiple GPUs, which are too expensive for most users. An alternative is local inference, or serving a model on a user's own machine, which removes per-token costs and rate limits, besides keeping sensitive data private and giving users full control over the models they run. The common understanding, however, is that local LLMs need compression (e.g., quantization) to run on a single GPU. In this paper, we set out to study the limitations that prevent serving long-context models for single users, besides the capacity issue. Rather than characterizing a single model on one GPU, we analyze how different models behave across several GPU generations. This lets us uncover not just individual bottlenecks but broader trends in where inefficiencies arise. Our analysis confirms that, as expected, self-attention dominates the runtime for long-context inference. More unexpectedly, our evaluation reveals that the current structure of self-attention leaves key GPU resources significantly underutilized, and the newest GPU is often the least well served. Many of these findings are fundamentally data management problems, from paging the KV cache to improving cache utilization and synchronization in the GPU, which is why we bring this study to the Data Systems community. To engage this community, we present our findings as a series of experimental observations and formulate recommendations for future work.
Figures & tables
| Model | Context | ||||
|---|---|---|---|---|---|
| GPT-2 ( Radford et al., 2019 ) | 1,600 | 25 | 64 | 6,400 | 1,024 |
| GPT-3 ( Brown et al., 2020 ) | 12,288 | 96 | 128 | 49,152 | 2,048 |
| GPT-OSS 120B ( OpenAI, 2025 ) | 2,880 | 64/8 | 64 | 2,880 | 131,072 |
| Model | (Q/KV) | |||
|---|---|---|---|---|
| Qwen3-4B | 2,560 | 32/8 | 128 | 9,728 |
| Qwen3-8B | 4,096 | 32/8 | 128 | 12,288 |
| Qwen3-32B | 5,120 | 64/8 | 128 | 25,600 |
| SASS Instruction | Stalls Count | Main Reason |
|---|---|---|
| BAR.SYNC.DEFER_BLOCKING 0x0 | 33,689 | Long Scoreboard |
| @!P3 LDS.U16 R84, [R84+0x600] | 23,306 | Barrier |
| STS.128 [R91+0x600], R16 | 7,197 | Long Scoreboard |
| LDSM.16.M88.4 R68, [R0+UR5+0x600] | 2,690 | Barrier |
| HMMA.1688.F32.BF16 R36, R4, R8, R36 | 1,614 | Short Scoreboard |
| @!P3 IMAD.U32 R5, R84, 0x10000, RZ | 1,440 | Short Scoreboard |
LLM Inference
Large language model inference studies how models generate outputs efficiently, reliably, and securely across hardware and workloads.
See all 280 papers