arXiv:2610.25219cs.OSOct 2026

Manuscript Offprint

arXiv:2610.25219

gKSM: GPU Memory Deduplication at Driver Layer for Serverless LLM Inference

Shuheng Gao, Fan Guo, Yongkun Li, Ziye Yue, Yinlong Xu, John C. S. Lui

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

Shuheng Gao

University of Science and Technology

of China

Hefei, China

shhgao@mail.ustc.edu.cn

Ziye Yue

University of Science and Technology

of China

Hefei, China

ustc_yzyeah@mail.ustc.edu.cn

Fan Guo ∗^{*}

MinJiang University

Fuzhou, China

lps56@mail.ustc.edu.cn

Yinlong Xu

University of Science and Technology

of China

Hefei, China

ylxu@ustc.edu.cn

Yongkun Li ∗^{*}

University of Science and Technology

of China

Hefei, China

ykli@ustc.edu.cn

John C.S. Lui

The Chinese University of Hong Kong

Hong Kong, China

cslui@cse.cuhk.edu.hk

Abstract

In serverless LLM inference, cloud providers commonly locate multiple instances on a single GPU to improve utilization. However, each instance independently maintains its model weights and runtime state, making duplicate GPU memory the primary bottleneck. Memory deduplication is a widely-used technique for eliminating duplicate data in CPU systems, but extending it to GPU memory faces fundamental challenges. Effective GPU memory deduplication must avoid redundant data movement between CPU and GPU while preserving write isolation for shared pages without native copy-on-write (COW) support.

This paper presents gKSM, a transparent GPU memory deduplication framework for serverless LLM inference. gKSM addresses these challenges through CPU-GPU collaborative hash management that offloads hash computation to GPU kernels, zero-copy model weight deduplication that eliminates duplication before model weight transfer, and a cross-privilege page fault handler that combines a lightweight kernel hook and CUDA Virtual Memory Management (VMM) remapping in the user space. gKSM also designs a stable page scanning algorithm and a reuse-aware placement policy in cluster scale. Experiments show that gKSM reduces GPU memory usage by 59.8% while maintaining high throughput compared to ServerlessLLM. Under memory constrained workloads, gKSM improves aggregate throughput by 2.15× and supports five instances concurrently. In cluster level simulation, gKSM achieves a service rate of 99.97%, compared to 78.2% for SLInfer and 26.9% for ServerlessLLM.

CCS Concepts: • Software and its engineering → Memory management; • Computer systems organization → Cloud computing.

Keywords: GPU memory management, serverless, memory deduplication, LLM inference

ACM Reference Format:

Shuheng Gao, Fan Guo, Yongkun Li, Ziye Yue, Yinlong Xu, and John C.S. Lui. 2026. gKSM: GPU Memory Deduplication at Driver Layer for Serverless LLM Inference. In The 2026 ACM SIGOPS Annual Technical Conference (SIGOPS ATC 2026), November 15–18, 2026, Hong Kong, Hong Kong. ACM, New York, NY, USA, 16 pages. https://doi.org/10.1145/3828523.3857017

1 Introduction

Large language models (LLMs) are increasingly deployed as managed inference services in public cloud and private platforms [5, 12, 19, 54]. In many enterprise scenarios, to satisfy service level objectives (SLOs) and deployment customization in vertical industries, enterprises often deploy private model instances in the cloud instead of using public inference services [2, 15]. These private services have different SLOs and dynamic request rates, making statically reserved GPU resources inefficient and expensive [1, 36, 54, 58]. To address this problem, serverless inference [12, 20, 27, 40, 59] has emerged as an attractive deployment, allowing users to scale private model instances on demand without managing and scheduling GPU resources. Such services have already been adopted by major cloud providers, including Google [15] and Alibaba Cloud [2]. However, LLM inference fundamentally differs from traditional serverless functions [26, 41, 50, 51]. To avoid expensive model reloads during invocation, each inference instance must retain large model weights in GPU memory [12, 46]. As a result, serverless LLM inference is constrained by persistent GPU memory consumption [12, 29].

∗^{*}Corresponding authors.

Since online inference workloads are highly dynamic and intense, providers commonly locate multiple serverless inference instances on a single GPU to share compute resources

Figure

This work is licensed under a Creative Commons Attribution 4.0 International License.

SIGOPS ATC 2026, Hong Kong, Hong Kong

© 2026 Copyright held by the owner/author(s).

ACM ISBN 979-8-4007-2818-1/2026/11

https://doi.org/10.1145/3828523.3857017 over time [6, 27, 59, 60]. Although colocation improves compute utilization, each instance independently maintains its model weights, KV cache, and runtime state [24, 62], making GPU memory the primary bottleneck that limits the number of colocated instances. Moreover, GPU memory usage across colocated instances is often highly duplicate. In practical deployment, many instances serve the same popular models or fine-tuned models derived from the same base model [5, 10, 21, 28, 45]. Even when instances use different inference frameworks [9, 19, 24, 35, 63], their model weights remain largely identical. This duplication severely constrains the serving capacity of the inference system.

Existing works have proposed model-aware scheduling strategies to mitigate GPU memory waste. ServerlessLLM exploits the locality of model weights to reduce cold start and migration overhead [12]. Prism dynamically offloads instances by tracking the access frequency of different models [60]. SLInfer consolidates instances of the same model onto shared nodes via live migration and merges small request batches into larger ones [55]. These strategies improve resource elasticity and GPU utilization [11, 64]. However, they operate at the level of instance scheduling and batch aggregation rather than directly eliminating duplicate memory pages at the physical level. They cannot share memory between instances running on different inference frameworks or exploit partial weight duplication between similar models. Furthermore, live migration introduces tail latency while weakening instance isolation. As a result, these scheduling approaches do not fully resolve the GPU memory duplication problem.

The scale of duplication is substantial. To confirm this problem, we perform a trace driven simulation of an A100 GPU cluster running a serverless inference workload of Alibaba Cloud [6, 29, 50]. Our experiments show that ServerlessLLM and conventional load balancing strategies accumulate up to 2000 GB of duplicate GPU memory, corresponding to a 70% duplication rate. Even SLInfer, which explicitly consolidates identical instances, still retains a duplication rate of more than 50% (see Figure 2). Memory deduplication is a widely used technique in CPU systems, such as Linux KSM [44]. KSM identifies identical memory pages by scanning and merging them into a single physical copy, relying on COW to maintain data consistency when modifications occur. A transparent page level deduplication technique on the GPU side could therefore effectively eliminate duplicate model weights and runtime data across colocated instances.

However, CPU memory deduplication cannot be directly transplanted to GPU environments. Three fundamental challenges arise from the architectural differences between the two domains. First, duplicate data reside on the GPU while the metadata required for page tracking and sharing coordination is managed on the CPU. This separation makes CPU-side hashing prohibitively expensive and rules out a purely GPU-side management approach. Second, model weights must be loaded from the host to GPU memory over the PCIe bus during instance initialization. A conventional pipeline that copies first and deduplicates afterward wastes PCIe bandwidth and temporarily occupies duplicate memory, which leads to potential out-of-memory (OOM) risk. Third, after duplicate pages are shared, write isolation must be enforced. CPU KSM relies on the kernel's native COW mechanism, but the GPU driver, which is only partially open-source with a closed user-mode component, provides no COW semantics for deduplicated virtual memory.

To address these challenges, we propose gKSM, a GPU memory deduplication framework operating at the CUDA driver layer. Mainstream inference frameworks are built on CUDA software stack, their GPU memory operations pass through CUDA driver APIs. These interfaces provide a common interception point where gKSM can track allocations and copies and manage physical page sharing while preserving application-visible virtual addresses. This enables transparent page-level deduplication across independent instances, including those running different inference frameworks, without modifying the frameworks. Our major contributions are summarized as follows.

• We design a CPU–GPU collaborative hash management for page scanning. gKSM computes page hashes in the GPU, manages metadata and hash buckets in the CPU, and verifies candidate pages by exact comparison.

• We propose zero-copy model weight deduplication based on duplicate data detection. By hooking CUDA memory copy during model loading, gKSM detects duplicate pages before transfer and avoids redundant memory allocations.

• We design COW across user space and kernel space for shared GPU pages. gKSM captures write faults in the UVM path, reports them to a user space handler, and uses CUDA VMM to create private copies.

• We implement gKSM at the CUDA driver layer, incorporating a stable page scanning algorithm for dynamic GPU memory and a reuse-aware instance placement policy for cluster deployment. Evaluated on a single GPU and cluster workloads, gKSM reduces GPU memory usage by up to 59.8% with negligible overhead, and improves throughput by up to 2.15×2.15\times under memory constrained workloads.

References (8)