Manuscript Offprint
arXiv:2610.25219gKSM: GPU Memory Deduplication at Driver Layer for Serverless LLM Inference
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
Ziye Yue
University of Science and Technology
of China
Hefei, China
Fan Guo
MinJiang University
Fuzhou, China
Yinlong Xu
University of Science and Technology
of China
Hefei, China
Yongkun Li
University of Science and Technology
of China
Hefei, China
John C.S. Lui
The Chinese University of Hong Kong
Hong Kong, China
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

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 under memory constrained workloads.
2.1 Serverless Inference Deployment
Serverless inference allows users to scale private model instances on demand without managing and scheduling GPU resources. However, serverless LLM inference differs significantly from traditional serverless function computation [12, 55, 60]. A LLM inference instance typically needs to load model weights ranging from several to tens of GB and maintain runtime states such as KV cache during request processing [24, 46, 62]. Even when the inference workload is very low, model weights persistently occupy a large amount

(a) Average Resource Utilization
(b) GPU Memory Breakdown
Figure 1. Resource utilization Analysis of the real world traces. Figure (a) illustrates the average resource utilization of serverless inference instances on Alibaba Cloud in one day. Figure (b) shows the inference memory breakdown for different models on A100 GPU.
of GPU memory to avoid the high latency overhead of frequent cold starts. As a result, although serverless inference offers a more flexible deployment approach, its resource utilization remains constrained by GPU memory occupied by model weights and the dynamic fluctuations of online requests [1, 36].
To better understand this problem, we analyze a public serverless inference dataset from Alibaba Cloud [29]. As shown in Figure 1a, for a single model instance, the average memory utilization is about 50%, while the GPU computation utilization at peak is only around 20%. This indicates that a single model instance often struggles to fully utilize the entire GPU. Due to the dynamic and intermittent nature of online inference requests, the arrival rate of the requests fluctuates over time, making it difficult for a model instance to maintain a high computational workload [1, 29]. Under these circumstances, model weights persistently occupy GPU memory, while GPU compute units remain underutilized for extended periods, leading to a serious mismatch between memory occupation and computational resources. As shown in Figure 1b, because most of the time instance workloads remain low, model weights dominate GPU memory usage. On the other hand, memory components such as KV cache and intermediate activations only account for less than 25% of total memory usage [24, 62].
Based on the above observations, cloud providers today typically adopt elastic resource sharing to improve GPU utilization [2, 15, 59]. For example, platforms such as Google Cloud and Alibaba Cloud support dynamic deployment and management of inference service instances on shared GPU resource pools [2, 15]. Specifically, by deploying multiple model instances on a single GPU, the dynamic workload of different instances can complement each other over time [11, 27, 47]. When one model instance has idle computational resources, others can utilize them, thereby improving the overall GPU compute utilization. Compared to the deployment mode where a single instance exclusively occupies a

(a) Duplication of Fine-tuned Qwen3-8B from Huggingface
(b) Duplication in GPU Cluster under different scheduling strategies
Figure 2. Duplicate GPU memory analysis. Figure (a) shows duplicate model weights between Qwen3-8B and its fine-tuned variants in Huggingface [22]. Figure (b) shows duplicate GPU memory under different scheduling strategies as the cluster size scales.
GPU, deploying multiple instances per GPU enables finer-grained filling of GPU resource gaps, increasing both the number of model instances and the scale of online requests that a single GPU can support.
2.2 Memory Duplication in Serverless Inference Systems
Serverless deployment enables elastic scaling of inference instances across GPU resources. However, traditional inference instances adopt a static resource allocation model, where the system reserves fixed GPU memory and compute resources during instance startup and cannot dynamically adapt to fluctuations in the real-time request load [27, 40]. To address this, existing works such as ServerlessLLM [12], Prism [60] and SLInfer [55] have proposed model-aware scheduling strategies [47]. ServerlessLLM exploits the model weight locality to reduce cold start and migration overhead. Prism dynamically offloads instances by tracking the access frequency of different model instances in real time. SLInfer aggregates instances of the same model onto the same node via live migration and merges small batches into larger ones, addressing the memory redundancy caused by duplicate model weights. These strategies mitigate unnecessary GPU memory waste, enable elastic resource sharing, and improve GPU utilization [11, 64].
However, under existing model-aware scheduling strategies, inference clusters still face significant GPU memory duplication. To confirm this problem, we simulate and replay the cluster level inference process based on Alibaba Cloud inference traces [6, 29, 50] to quantify GPU memory duplication under different scheduling strategies. As shown in Figure 2b, as the cluster size scales, the memory duplication of ServerlessLLM and traditional load balancing strategies reaches 2000 GB, with an overall duplication rate of 70%, while SLInfer achieves a duplication rate of 50%. Traditional load balancing strategies are model-agnostic, dispersing instances of the same model across different nodes and causing widespread memory duplication within the cluster. Although ServerlessLLM reduces cold start overhead by exploiting model weight locality, it tends to aggregate instances of the same model within GPU nodes. As a result, each GPU node still holds duplicate copies of model weights in its memory. SLInfer schedules instances with identical model weights to the same node and mitigates duplication by merging request batches, yet its scheduling strategy still faces fundamental limitations.
Existing scheduling strategies suffer from three intrinsic limitations. First, when the same model runs on different inference frameworks, such as vLLM [24], SGLang [63], and TensorRT-LLM [35], instances on different frameworks cannot share memory with each other. These frameworks differ fundamentally in request batching, prefill scheduling, and memory management, preventing cross-framework batch merging even when instances serve the same model. According to industry data, vLLM and TensorRT-LLM together dominate the NVIDIA inference ecosystem, with adoption rates of approximately 55% and 45% respectively, while SGLang is deployed on more than 300,000 GPUs [63]. Second, existing strategies only deduplicate the entirely identical model instances and cannot exploit partial weight sharing across different models. Many models are fine-tuned from the same base model [5, 10, 21, 28, 45] or extend a shared language backbone with different vision encoders [4, 25, 30]. As shown in Figure 2a, sharing the common base model of Qwen3-8B [56] saves 15.2%–81.6% GPU memory, yet existing schedulers cannot perceive such partial duplication. Third, live instance migration and batch merging [47, 64] introduce additional system overhead and undermine inter-tenant isolation. Live migration transfers instance context including runtime states and KV cache, incurring network overhead and service pauses that lead to tail latency [16, 53]. Meanwhile, merging requests from different tenants into shared batches weakens the instance resource boundaries, causing performance interference under varying request patterns and latency SLOs [16, 61].
2.3 Opportunities and Challenges of GPU Memory Deduplication
Current approaches rely on the scheduling layer to continuously decide placement and migration, which fail to inherently eliminate duplicate memory footprints while incur substantial overhead in the scheduling and coordination layer. Memory deduplication [7, 18, 33, 38, 49] is an established technique that reduces physical memory usage by identifying and merging identical memory pages through scanning and comparison, while relying on COW to maintain data consistency when modifications occur. This approach has been widely implemented in CPU memory systems, such as Linux's KSM [44] and virtualization platforms [33, 42, 52].
In serverless inference scenarios, extending traditional CPU memory deduplication to the GPU offers an opportunity for transparent memory sharing across colocated instances. GPU memory deduplication at CUDA driver layer can provide an efficient and transparent solution that significantly reduces duplicate memory usage without affecting inference services. Existing mainstream inference frameworks, including vLLM and SGLang, are built on the CUDA software stack. Although they implement their own logical memory managers, their model weights, KV cache buffer, and other GPU runtime memory must ultimately be allocated and managed through CUDA driver APIs. This allows us to track all these allocations and memory copy operations without modifying any framework, preserving each allocation's virtual addresses while managing the physical backing pages. In contrast, runtime-level sharing is coupled to each framework's memory manager, making it less efficient and less transparent than driver-layer deduplication.
However, fundamental differences in memory management models, driver interfaces, and hardware capabilities between CPU and GPU architectures prevent direct transplantation of mature CPU deduplication mechanisms to GPU memory. The lack of native support for COW semantics and fine-grained page sharing in current GPU systems presents particular challenges [23, 34, 37]. In general, these challenges can be summarized in the following three aspects:
Challenge 1: Deduplication in heterogeneous memory. The lifecycle of GPU memory is managed from the CPU side, including physical memory allocation, virtual address remapping, access control and coordination. However, duplicate memory reside in the GPU side. Copying GPU pages back to host memory for CPU-side hashing introduces substantial data transfer overhead, and CPU hash computation throughput is much lower than what GPU parallelism can achieve. Therefore, metadata must be maintained on the CPU side, while hash computation and page comparison are performed on the GPU. However, moving the entire scanning and management logic to the GPU is infeasible because page metadata such as allocation handles, access permissions, and sharing state requires the logical control and data structure management capabilities of the CPU runtime. This physical separation between GPU-side data and CPU-side metadata creates a fundamental coordination challenge. Efficient duplicate detection requires a collaborative mechanism that leverages GPU parallelism for hash computation while retaining CPU-side metadata management, without incurring expensive data movement from GPU to CPU.
Challenge 2: Eliminating redundant data transfer in the critical path. GPU inference workloads must first load model weights from CPU to GPU memory over the PCIe bus during instance initialization. A conventional deduplication pipeline would fully copy the model weights to the GPU, then scan and merge duplicate pages. This incurs unnecessary PCIe bandwidth consumption and temporarily occupies duplicate GPU memory before deduplication completes, leading to significant memory spike. Modern LLM model weights

Figure 3. System design and architecture overview of gKSM
range from several to tens of gigabytes, and hundreds of instances may load overlapping weights concurrently at cluster scale, making these overheads significant. The challenge is to detect duplicates before GPU transfer to avoid redundant PCIe traffic and temporary duplicate memory usage.
Challenge 3: Preserving write isolation without native COW support. After GPU memory pages are shared, write isolation must be preserved. In CPU-side KSM, this is handled by the kernel's native COW mechanism. When a process writes to a shared page, the CPU MMU triggers a page fault, and the kernel's fault handler transparently allocates a private copy and updates the page table, all within the kernel's privileged execution context. However, the GPU driver is only partially open-source. While the kernel-mode driver is open, the user-mode driver remains closed-source and neither layer exposes COW semantics for deduplicated GPU virtual memory. CUDA VMM provides page-level access control but lacks automatic COW services. Directly modifying the GPU kernel driver to implement full COW semantics would introduce significant engineering complexity and risk system stability across driver updates. Furthermore, the UVM kernel module manages page faults within its own kernel-space logic and does not coordinate with user-space CUDA VMM APIs for page remapping. The challenge is to implement COW semantics for shared GPU pages while keeping kernel modifications minimal and preserving system stability.
3 System Design
3.1 Overall Architecture of gKSM
We propose gKSM, a GPU memory deduplication system operating at the CUDA driver layer. Compared to traditional CPU memory deduplication such as KSM, gKSM addresses three fundamental challenges. First, GPU memory on the device and deduplication metadata on the host leave CPU hashing limited by data transfer and computation overhead, while GPU metadata management is limited by CPU coordination. gKSM addresses this through CPU-GPU Collaborative Hash Management (Section 3.2), which offloads hash computation to GPU kernels while retaining metadata control on the CPU. Second, a conventional pipeline that copies model

Figure 4. CPU-GPU collaborative hash management.
weights first and deduplicates afterward wastes bandwidth and temporarily occupies duplicate memory. gKSM eliminates this through Zero-Copy Model Weight Deduplication (Section 3.3), which intercepts the copy path and performs sharing inline with data transfer. Third, after sharing, write isolation requires COW support. Unlike KSM, which relies on the kernel's native COW mechanism, the partially open-source GPU driver provides no such COW service, and invasive driver modifications threaten system stability. gKSM proposes a Cross-Privilege Page Fault Handler (Section 3.4), which combines a lightweight kernel hook with user-space CUDA VMM remapping to implement COW without invasive driver changes.
As illustrated in Figure 3, gKSM implements this design through a transparent deduplication framework and a reuse-aware instance placement policy. The framework realizes GPU-accelerated stable page scanning that periodically identifies sharing opportunities in dynamic KV cache and activation pages [14, 62], and transparent GPU page sharing via CUDA VMM that remaps duplicate pages to shared physical handles while preserving instance virtual address spaces. The placement scheduler decomposes each instance's memory into a shareable portion and a private portion, then selects the GPU with the lowest incremental memory cost under compute constraints. Figure 7 contrasts this policy with ServerlessLLM and SLInfer. Instead of relying on live migration or instance merging, gKSM exposes reuse opportunities directly to the memory layer. Since driver-layer deduplication requires reusable pages to reside on the same GPU [11], the placement policy locates instances that benefit from memory sharing. The workflow first deduplicates model parameters during initialization, then the background scanner identifies stable pages, while the COW handler preserves write isolation at runtime. The following subsections describe each module in detail.
3.2 CPU-GPU Collaborative Hash Management
To coordinate the parallel computing capability of the GPU with the GPU memory management capability of the CPU, gKSM introduces a CPU-GPU collaborative hash management mechanism, as illustrated in Figure 4. It offloads hash
Table 1. The page hash computation overhead on NVIDIA A100 GPU. We measure the latency and throughput of different hash algorithms on both GPU and CPU.
| Hash Algorithm | Latency(ms) | Throughput(GB/s) |
|---|---|---|
| xxHash3(GPU) | 47.7 | 167.70 |
| xxHash3(CPU) | 806.8 | 9.92 |
| SHA256(CPU) | 6166.3 | 1.31 |
computation to the GPU while retaining metadata coordination on the CPU, leveraging GPU parallelism for batch hash computation and CPU control for metadata table management and candidate lookup.
On the GPU side, gKSM implements a CUDA kernel version of the xxHash algorithm [8] to compute page hashes in batch. Hash matches identify candidate duplicates rather than directly authorizing page sharing. gKSM performs exact content comparison before merging, allowing us to use a fast non-cryptographic hash for candidate lookup. As shown in Table 1, xxHash3 on the CPU side achieves only 9.92 GB/s, while xxHash3 on the GPU side reaches 167.70 GB/s, a improvement. Using cryptographic algorithms on the CPU is even slower, such as SHA256 [13].
On the CPU side, gKSM maintains a per-GPU metadata table that stores information including the virtual address, access permission, and hash value for each managed page. To coordinate deduplication across instances, gKSM further maintains a global shared table organized as hash buckets. This global table, implemented as an indexed array, supports efficient lookups and updates. A hash lookup returns candidate shared pages that share the same hash value. It is important to note that the above implementation still carries the risk of hash collisions. Therefore, a hash match does not directly lead to page sharing. Instead, it triggers an exact comparison of the page contents. Only when the page contents are completely identical will the current page be remapped to an existing shared page. If a hash collision occurs, the current page remains independent. By combining GPU-accelerated hash computation with optimized CPU-side metadata management, gKSM addresses the challenges of computational bottlenecks and cross-processor coordination, enabling fast and scalable page comparisons across instances.
3.3 Zero-Copy Model Weight Deduplication
As discussed in Section 2.3, a conventional pipeline that copies data first and deduplicates afterward wastes PCIe bandwidth and temporarily occupies duplicate GPU memory. These overheads are significant in the cluster scale, where hundreds of instances may load overlapping model weights concurrently, causing transient memory spikes and increasing the risk of OOM errors. To address this, gKSM introduces a zero-copy deduplication method integrated into the memory copy path. The core idea is to intercept the model weight transfer before it reaches GPU memory, so that duplicate data are never physically copied.
Concretely, gKSM inserts a hook into the cudaMemcpy() path from CPU to GPU. Since model weights already reside in CPU memory before transfer, gKSM performs page hashing, candidate lookup, and exact content verification all on the CPU side. gKSM computes batched hashes in the hook path and uses them to query the global shared page table for candidate pages with matching hashes. If a match is found and the exact content comparison with the candidate pages retained pinned CPU buffer confirms this duplication, the virtual address of the current page is directly remapped to the physical handle of the existing shared page. The originally allocated physical memory is released immediately, without data ever being written there. If no match is found, the page is copied to the GPU as usual, and the new page is registered in the shared table and pinned buffer for future deduplication.
This approach ensures that only one physical copy of each unique model weight page is retained on the GPU, regardless of how many instances load the same model. To avoid unnecessary hash computation for model weight pages and other already-deduplicated data during subsequent background scans, these pages are marked with a flag so that they are excluded from further scanning. By avoiding redundant PCIe transfers and immediately releasing duplicate GPU allocations, zero-copy model weight deduplication achieves efficient memory savings with negligible impact on model initialization latency.
3.4 Cross-Privilege Page Fault Handler
After GPU memory deduplication, gKSM must preserve write isolation for shared GPU pages mapped by multiple instances. When one instance writes to the shared page, it must receive a private copy without affecting the other instances that are still reading from the original [23].
In traditional CPU memory deduplication, the kernel's native COW mechanism handles write isolation transparently within the privileged kernel context. However, the GPU environment lacks this native support. The partially open-source GPU driver provides no COW semantics. CUDA VMM lacks automatic page copy and remap services, and the UVM kernel module does not coordinate with user-space VMM APIs. To address this while keeping kernel modifications minimal, gKSM proposes a cross-privilege page fault handler that splits the COW workload across kernel space and user space. As shown in Figure 5, the kernel realizes a lightweight fault detection and reporting, while the user space handles page copying and virtual address remapping through CUDA VMM APIs.
After deduplication, gKSM maps all shared pages as read-only. When a GPU kernel attempts to write to a shared page, the access triggers a GPU page fault. On the kernel side, gKSM extends the UVM replayable fault path with a lightweight hook. For each GPU page fault, the hook checks

Figure 5. Cross-privilege COW fault handling for shared GPU pages. gKSM captures page faults in the kernel and remaps the fault page through the user-space CUDA VMM handler.
whether the fault address falls within the gKSM-managed memory range and whether the fault is caused by a write access to a read-only shared page. For each captured fault, the kernel module records a fault descriptor that contains the fault address, fault type, instance identifier, and device identifier, then inserts it into a waiting queue exposed through a character device. The kernel does not perform expensive page copying or CUDA VMM remapping. Instead, it only reports fault events to the user space. The fault queue is protected by locks with a narrow scope, which reduces lock contention and keeps the GPU driver path simple and stable.
On the user side, a dedicated COW handler thread periodically fetches fault records from the waiting queue in batch. For each fault, the handler first validates the current local and global metadata. If the faulting instance is not the owner of the shared handle, the COW handler creates a private copy of the fault page for this instance using CUDA VMM allocation and memory copy. It then redirects the virtual address to the private copy via cuMemMap() and makes the new mapping writable via cuMemSetAccess(). The local metadata is updated to record the page as a private page, and the global shared table removes this reference from the sharer list of the original page. A COW fault is triggered only on the first write to a shared page. After a COW process is finished, subsequent writes to this private page follow the normal access pattern.
If the faulting instance is the current owner of a shared page, the shared handle cannot be modified in place because other instances may still map to it. In this case, the COW handler first selects another instance from the sharer list as the new owner of the shared page group, preferring an instance on the same GPU. The ownership of the shared handle is then transferred to the new owner, and the faulting former owner is allocated a new private page. Its virtual address is remapped to this private copy with write access. If the reference count of the shared page becomes zero after all sharers have detached their references, the page is no longer shared. The COW handler restores write access for

Figure 6. Page-level GPU memory management and sharing via CUDA VMM API.
the remaining instance and removes the corresponding entry from the global shared table. During COW operations, gKSM protects the metadata of the faulting page with a shared memory mutex to prevent concurrent modification of the same shared page by multiple fault handlers. This design keeps the minimal kernel modification. Only a fault report hook is added to the existing UVM replayable fault path. All page copying, ownership management, and remapping logic resides in the user space, where CUDA VMM APIs provide a stable and well supported interface.
3.5 Implementation
3.5.1 Transparent GPU Page Sharing. Once duplicate pages are identified, gKSM must share the underlying physical memory across instances while preserving each instance's virtual address space. In CPU-side KSM, the kernel directly modifies page table entries to share physical frames. The GPU environment lacks such direct page table manipulation, and conventional CUDA interfaces do not allow independent remapping or sharing of physical pages across instances. gKSM therefore implements transparent GPU page sharing on top of CUDA VMM APIs [37], which expose fine-grained control over GPU virtual memory. These APIs support creating shareable physical handles, importing them into different address spaces, and independently controlling access permissions. gKSM leverages these primitives to turn duplicate pages into a single shareable physical handle while keeping each instance's virtual address unchanged.
Concretely, gKSM intercepts GPU memory allocation requests and manages them at page granularity. For each managed page, gKSM maintains metadata to track its ownership, sharing state, and page permissions. Our implementation uses 2 MB as the deduplication granularity [3], which matches the allocation granularity reported by CUDA VMM on our platform. This granularity is also well suited for LLM inference workloads, since model weights are typically stored as large contiguous tensors with stable memory layouts across instances. As a result, most duplicate model weight regions can already be captured at 2 MB granularity, while using smaller pages would significantly increase metadata management, hashing, and remapping overhead.
As shown in Figure 6, the sharing process works as follows. Duplicate pages are identified either through zero-copy interception during model loading or through the background stable page scanner. Once identified, gKSM exports a shareable physical handle from the source instance using cuMemExportToShareableHandle(). This handle is then imported into the target instance's virtual address space, and the target's virtual address range is remapped to the imported physical handle via cuMemMap(). The target instance's original duplicate allocation is then released. Throughout this process, the virtual addresses of both instances remain unchanged. Inference kernels continue to access memory at the same addresses without any modification. After remapping, all shared pages are marked read-only via cuMemSetAccess() to preserve isolation across instances. This sets up the necessary condition for the COW fault handler described in Section 3.4.
During normal inference execution, instances continue accessing GPU memory through their original virtual addresses. All reads are served directly from local HBM without remote memory access. gKSM only adds lightweight metadata management and occasional remap and permission updates during page sharing. In practice, these VMM operations occur infrequently and are concentrated mostly during initialization and deduplication events. They introduce negligible overhead and impact to the subsequent inference execution. For example, even the most expensive VMM operations, such as cuMemExportToShareableHandle() and cuMemSetAccess(), take only 100 s and 296 s on average in our implementation.
3.5.2 Stable Page Scanning. Beyond model weights, LLM inference continuously generates dynamic pages such as KV cache and intermediate activations. These pages may contain significant duplication when instances serve similar requests or share prefix prompts [14], but unlike read-only model weights, they are subject to frequent modifications. Indiscriminately sharing them would lead to excessive COW faults, as a page written immediately after sharing must be privately reallocated and copied. In the GPU context, where COW involves a cross-privilege round trip (Section 3.4), the cost of premature sharing is significantly higher than in CPU-side KSM. gKSM must therefore selectively identify pages that are sufficiently stable to benefit from deduplication.
To address this, gKSM introduces a stable page scanning mechanism that employs a lightweight background thread to periodically scan dynamic pages such as KV cache and intermediate activations. The core idea is to track page stability through repeated hash observations. If a page's hash value remains unchanged for N consecutive scans, it is classified as stable and becomes eligible for deduplication. Pages whose hashes change between scans are considered unstable and are excluded from sharing, avoiding unnecessary COW overhead on transient data. The scanning interval follows an exponential-backoff policy: if a scan finds no deduplication opportunity, the interval doubles up to a configured maximum. Successful deduplication resets it to the base interval. The maximum interval controls the tradeoff between scanning overhead and responsiveness to new sharing opportunities: a smaller cap revisits dynamic pages more frequently, while a larger cap reduces repeated scanning when few stable duplicates are available. The background scanner leverages the same CPU-GPU collaborative hash computation mechanism described in Section 3.2, while the GPU computes page hashes and the CPU manages the global shared table.
Specifically, the GPU computes the current hash values for each page. If the hash value differs from the previous scan, the page is considered unstable and its stability counter is reset. If the hash remains consistent for N consecutive scans, the page is deemed stable and gKSM proceeds to look up the corresponding hash bucket in the global candidate table. For each candidate page q in the bucket, gKSM recomputes its hash value to filter out pages that may have been modified after being inserted into the candidate table. If q resides in another instance, gKSM requests a hash recomputation on the remote instance. A matching hash alone does not guarantee page sharing due to the possibility of hash collisions. Before merging, gKSM performs an exact content comparison between the local page and the candidate. The two pages are remapped to the same physical page only if their contents are fully identical. If the comparison fails, gKSM treats the case as a hash collision or a stale candidate and continues to check the remaining candidates. If no candidate passes verification, the local page remains independent and may be inserted into the candidate table for future matching. By combining GPU-parallel hashing with stability-gated deduplication, gKSM effectively identifies sharing opportunities in transient data while minimizing scanning and COW overhead.
3.5.3 Reuse-Aware Placement Policy. After introducing memory deduplication within a single GPU, now we discuss where deduplication should take effect in cluster scale deployment. A straightforward approach is to share duplicate memory from the local GPU or even from a remote GPU node. This approach can reduce duplicate memory copies in principle, but shared memory is accessed through NVLink or network communication instead of the local HBM. Consider an inference step that reads a shared memory region of size S. If the memory resides in local HBM, the access time can be approximated as
where is the local HBM bandwidth and is the local access latency. If the same data are stored on another

(a) Locality Placement
(b) Consolidation
(c) Reuse Aware (Ours)
Figure 7. Different Scheduling Strategies
local GPU, the access time becomes
where is the NVLink bandwidth and is the additional latency of memory access. The gap between local HBM access and NVLink access can be substantial. For example, an H100 GPU provides around 3.35 TB/s of local HBM bandwidth, while the aggregate NVLink bandwidth is only about 900 GB/s. In typical GPU servers,
The gap is more severe for the remote GPU node because the network bandwidth is much lower than NVLink. For serverless LLM inference, this overhead is not a one time cost. During decode, tokens are generated step by step. Each step repeatedly accesses the model weight and KV cache. Remote access overhead can therefore be amplified across tokens, increasing end-to-end inference latency [31].
For this reason, gKSM limits GPU memory deduplication to a single GPU. Duplicate memory is merged only among colocated instances on the same GPU. This single GPU sharing boundary creates the need for an instance placement policy [11, 52]. A model-agnostic scheduler may place a new instance on the GPU with the most free memory or the lowest current utilization. As a result, similar instances can be spread across different GPUs, leaving duplicate model weights in memory on multiple devices. gKSM instead uses a reuse-aware instance placement policy to create the opportunities for local GPU memory deduplication. For each incoming instance i, gKSM decomposes its expected GPU memory demand into a shareable portion and a private portion:
The shareable portion includes read-only model weights and stable prefix or runtime pages [14]. The private portion includes instance private KV cache, mutable runtime buffers, and memory that is not stable enough for sharing. For a candidate GPU , gKSM estimates the reusable memory from resident instances as
where is the set of instances already placed on the GPU g. The incremental GPU memory cost is
gKSM first filters out GPUs that do not have enough memory or compute headroom, and then selects
among the remaining candidates. If multiple GPUs have similar incremental memory cost, gKSM prefers the GPU with more compute headroom to avoid concentrating too many active requests on one GPU. This placement policy operates at the scheduling layer and is decoupled from the memory deduplication at the driver layer. After placement, gKSM still relies on page hashes and exact content comparison before remapping duplicate pages to a shared physical handle. The same rule also supports framework transparency and partial sharing. For example, instances using vLLM and SGLang can still share duplicate GPU memory even though their batching and scheduling states are independent. Similarly, fine-tuned models with partially shared weights can still expose substantial duplicate GPU memory. They only need to expose duplicate GPU memory after being located on the same GPU.
4 Evaluation
4.1 Evaluation Setup
Test Environment. We evaluated gKSM on a GPU server with 4 NVIDIA A100 80 GB GPUs. The system runs CUDA 12.4 with NVIDIA driver version 570.148.08, serving instances with OpenAI APIs. All instances use bfloat16 weights with a maximum context length of 4096 tokens. Each benchmark client issues up to 32 concurrent requests.
Workloads and Metrics. The workload is generated from the ShareGPT conversation dataset [43]. Each benchmark client samples prompts from ShareGPT and submits requests according to a Poisson arrival process. We sweep the offered request rate from 0.5 to 4.0 req/s per instance. For the throughput experiment, each deployment policy runs the maximum number of instances that can be kept resident under its memory management strategy, and we report aggregate RPS of all active instances. For the latency experiment, we use the same fixed instance count across policies and report the mean time to first token (TTFT) and P99 TTFT over all completed requests. We deploy multiple serving instances with both vLLM instances and SGLang instances. These instances serve models from the Qwen3-8B [56], Qwen2.5-7B [39], GLM-4-9B [48], and Llama3-8B [32] families, together with instruction tuned and domain tuned models such as Qwen3-8B-Medical, Llama3-8B-Instruct, Qwen3-8B-Roleplay and Llama3-Guard-8B. The workload therefore contains identical model deployments, related model variants

Figure 8. Memory usage and throughput in 2GPU config

Figure 9. Memory usage and throughput in 4GPU config
with partial weight overlap, and deployments across different inference frameworks.
Implementation. We implement gKSM by extending the native CUDA Driver API with custom logic built on top of the CUDA VMM API. CUDA Runtime calls are intercepted through symbol interposition, allowing gKSM to hook GPU memory management operations while preserving the original CUDA runtime behavior. The complete prototype contains approximately 4,000 lines of C++ and CUDA code, including a driver layer runtime library and a kernel level deduplication module. For serving experiments, the background scanner uses a base interval of 1 s and a maximum interval of 16 s to balance the frequency of stability checks against the scanning overhead.
Deployment Policies. We compare three deployment policies. ServerlessLLM uses independent serving instances with separate physical copies of GPU memory. We place four instances on each GPU with different frameworks and model variants. gKSM naive keeps the same placement policy as ServerlessLLM but enables driver layer GPU memory deduplication, enabling transparent memory sharing. gKSM reuse-aware also enables gKSM but preferentially locates instances from the same model family on the same GPU. This placement exposes more duplicate GPU memory across frameworks and related model variants, increasing the sharing opportunities available to gKSM.
4.2 Overall Performance
4.2.1 Serverless Inference Scenarios. Figure 8 and 9 show the memory footprint and the actual RPS under the ShareGPT request rate sweep. In the 2 GPU setting, gKSM clearly improves aggregate throughput under low workload, where gKSM naive and gKSM reuse-aware improve throughput by about 30.8% and 51.3% on average over ServerlessLLM.

Figure 10. Mean and P99 TTFT in 2GPU config

Figure 11. Mean and P99 TTFT in 4GPU config
The same trend appears in the 4 GPU setting, where the average gains are about 17.4% and 30.7%, respectively. This is because memory deduplication allows each GPU to hold more serving instances at the same time. As the offered load increases, the throughput gap of all system approach narrows, indicating that GPU compute becomes the bottleneck in both the 2 GPU and 4 GPU configurations. These results show that gKSM removes duplicate GPU memory copies and improves throughput while maintaining comparable serving performance at saturation.
Figure 10 and Figure 11 show that gKSM provides consistent TTFT improvements in different request rates. Across all request rates, gKSM naive reduces mean TTFT by 9.93 ms (5.9%) relative to ServerlessLLM, while gKSM reuse-aware reduces mean TTFT by 7.00 ms (4.2%). The improvement is more significant for tail latency. gKSM naive and gKSM reuse-aware reduce P99 TTFT by 55.9 ms (14.5%) and 55.0 ms (14.4%) on average. Under the highest request rate, ServerlessLLM reaches 438.4 ms P99 TTFT, while gKSM naive and gKSM reuse-aware reduce P99 TTFT to 364.7 ms and 375.7 ms, corresponding to reductions of 73.7 ms (16.8%) and 62.7 ms (14.3%), respectively. These results suggest that GPU memory deduplication reduces memory pressure and leaves more GPU memory available for KV cache allocation, improving TTFT at only a small throughput cost.
Memory usage in Figure 8 and Figure 9 reports the average memory usage per GPU under the three deployment policies. The bars decompose the memory into duplicate, shared, and private memory. ServerlessLLM does not perform deduplication, so repeated model copies appear as duplicate memory and the total usage reaches about 96% to 97% of GPU capacity. In the 2 GPU setting, gKSM naive and gKSM reuse-aware reduce memory usage by 39.3% and 59.0%, respectively. In the 4 GPU setting, the reductions are 19.9% and 59.8%. gKSM


Figure 12. The aggregate throughput in memory constrained scenarios of Llama3-8B on a single A100 GPU

Figure 13. The mean TTFT in memory constrained scenarios of Llama3-8B on a single A100 GPU
naive removes duplicate copies on each GPU, but its mixed placement leaves several unrelated model bases on the same GPU, which remain private and limit memory savings. gKSM reuse-aware locates instances from the same model family, so each GPU maintains a single shared model base and greatly reduces private model memory.
4.2.2 Memory Constrained Scenarios. Next, we evaluated whether gKSM improves multi-instance serving capacity when GPU memory becomes the limiting resource. We deploy multiple identical Llama3-8B vLLM instances on a single NVIDIA A100 GPU and replay ShareGPT requests to each instance at request rates of 1.5 and 3 requests/s per instance. The baseline launches independent vLLM instances and falls back to CPU offloading once GPU memory is insufficient. A deployment is marked as OOM when the requested number of instances cannot be initialized or served. gKSM runs the same workload but shares duplicate GPU pages after initialization, so additional instances do not require another copy of the model weights. Figures 12, 13, and 14 report aggregate throughput, mean TTFT, and P99 TTFT, respectively.
With up to three instances, both vLLM and gKSM fit within GPU memory and achieve similar throughput, showing that gKSM introduces negligible overhead before GPU memory becomes constrained. The gap emerges at four instances when the baseline begins CPU offloading due to insufficient GPU memory. Under 1.5 req/s per instance, vLLM throughput drops to 2.89 req/s, while gKSM reaches 5.92 req/s. Under

Figure 14. The P99 TTFT in memory constrained scenarios of Llama3-8B on a single A100 GPU
3 req/s per instance, vLLM reaches only 4.22 req/s, while gKSM reaches 9.07 req/s. The throughput degradation of the baseline is mainly caused by the reduced KV cache capacity under memory pressure, which triggers KV cache offloading and frequent CPU memory transfers, significantly slowing down the affected instances and reducing the overall request throughput. gKSM improves aggregate throughput by and under 1.5 req/s and 3 req/s, respectively. With five instances, the baseline fails with OOM, whereas gKSM continues serving all instances and achieves 7.38 and 9.24 req/s.
The TTFT results further show that gKSM avoids the latency overhead caused by CPU offloading under GPU memory pressure. Under the 1.5 req/s workload, gKSM reduces mean TTFT from 187.88 ms to 151.19 ms in four instances. Under the 3 req/s workload, the mean TTFT decreases from 218.13 ms to 184.24 ms. It also reduces P99 TTFT by 24.2% and 27.0% under the 1.5 req/s and the 3 req/s workloads, respectively. By eliminating duplicate model weights from GPU memory, gKSM allows more instances to fully reside on GPU memory and avoids the additional memory transfer overhead introduced by offloading. At the highest workload, throughput no longer scales linearly with five instances because the computation and scheduling overhead become the primary bottlenecks. However, gKSM continues to serve all instances without OOM failures and maintains high aggregate throughput.
4.3 Performance Breakdown
We further characterize gKSM’s deduplication performance and memory savings by profiling individual CUDA memory operations, measuring COW latency and throughput under concurrent writes, and breaking down deduplicated memory into different types, analyzing how different memory components contribute to its memory savings.
API-Level Overhead. As shown in table 2, the overhead of gKSM comes mainly from page hashing, VMM remapping operations, and COW handling. Among them, page hashing is the most frequent operation, but batching reduces the average hashing cost from 200.15 s to 118.67 s per page. The core VMM operations are lightweight, with cuMemCreate()
| API | calls | total time(ms) | avg time(μs) |
|---|---|---|---|
| hash_xxh3(single) | 7798 | 1560.80 | 200.15 |
| hash_xxh3(batch) | 160256 | 19017.35 | 118.67 |
| pagefault_handle | 190 | 107.44 | 565.44 |
| cuMemCreate | 18592 | 439.13 | 23.62 |
| cuMemMap | 18706 | 152.62 | 8.16 |
| cuMemSetAccess | 7960 | 2358.74 | 296.32 |
| cuMemExport | 7658 | 769.82 | 100.53 |
| cuMemImport | 456 | 32.84 | 72.02 |
Table 2. Overhead of CUDA APIs
and cuMemMap() taking only 23.62 s and 8.16 s on average, respectively. Although cuMemSetAccess() and page fault handling have higher latency per call, they are only triggered when sharing relationships or page permissions change. COW events are also rare because gKSM primarily shares read-only model weights and stable runtime pages. Once pages are shared, normal memory accesses proceed through the original virtual addresses without additional processing. As a result, these costs have only a small impact on the overall inference throughput.
Concurrent COW Performance. The latency of handling cross-privilege COW fault includes kernel-to-user notification, metadata and ownership updates, private-page allocation and copying, VMM remapping, and completion acknowledgment. To further characterize COW overhead under concurrent write pressure, we synchronize 1–8 writer processes of separate CUDA streams, each performing its first write to a 2 MB page that was previously deduplicated with a read-only holder process. Figure 15a reports the average COW latency and the aggregate throughput of COW handling. As shown in Figure 15a, the average COW latency increases from 0.426 ms with one writer to 0.942 ms with eight writers, while the aggregate throughput increases from 2346.2 to 8382.2 events/s, a increase. At 6–8 concurrent writers, throughput plateaus at about 8300 events/s while latency continues to rise. Under such high concurrency, lock contention in the COW handling path and blocking waits in the page fault queue become the primary bottlenecks, preventing throughput from scaling while increasing the COW latency. Given that the colocation of four instances per-GPU represents the practical configuration in our evaluation, these results show that gKSM maintains COW performance for practical deployment.
Memory Deduplication Breakdown. We classify deduplicated pages as model weights, KV cache, and other runtime data by logging GPU address ranges of framework-managed memory regions, mapping each page to its corresponding region, and aggregating deduplicated bytes by memory type. Figure 15b illustrates their cumulative contributions over time of two instances configured with the Qwen3-8B model. Model weights are handled by zero-copy loading through the intercepted cuMemcpyHtoD path. Their contribution rises rapidly during loading and then plateaus as model weights remain read-only during inference. In contrast, KV cache and other runtime data are written directly into preallocated GPU buffers by CUDA kernels and normally bypass this loading path. Background scanning identifies stable duplicate pages in these regions, producing stepwise increases as additional pages are merged. At the end of the illustrated interval, the cumulative deduplicated memory is approximately 24.4 GB, with model weights, KV cache, and other runtime data contributing 16.40 GB (67.2%), 5.76 GB (23.6%), and 2.24 GB (9.2%), respectively. Weight deduplication is the largest component, while the runtime portion demonstrates that scanning provides substantial additional savings.

(a) COW performance.
(b) Cumulative memory savings.
Figure 15. Deduplication component analysis.
4.4 Cluster Level Simulation
We further evaluated gKSM at the cluster level by simulating and replaying an anonymized pod-level inference trace derived from Alibaba Cloud serverless workloads [29] on clusters with 1 to 8 GPU nodes. Each node contains 8 A100 GPUs with 80 GB GPU memory. We compare gKSM with ServerlessLLM and SLInfer, and focus on two metrics: the fraction of pod steps that can be served and the resource balance ratio on active nodes. The resource balance ratio is defined as the average value of compute utilization divided by memory utilization across active GPUs. A higher ratio means that the cluster is less dominated by memory pressure and can use GPU compute resources more effectively.
Figure 16 shows the fraction of pod steps that can be served in cluster scale. With only one node, gKSM already serves of all pod steps, compared to for SLInfer and for ServerlessLLM. With two nodes, gKSM reaches , while the latter two remain at and , respectively. From three nodes onward, gKSM serves the whole workload. In contrast, ServerlessLLM still needs eight nodes to approach , and SLInfer reaches at eight nodes. It shows that the memory saved by deduplication can be turned directly into higher cluster capacity.
Figure 17 shows the balance ratio of resources in active nodes. After two nodes, gKSM only decreases slightly from

Figure 16. Inference Service Rate under Cluster Simulation
0.472 to 0.436, which means active GPUs remain relatively balanced between compute demand and memory demand. The same ratio drops steadily for the two baselines as the cluster grows. For ServerlessLLM, it falls from 0.417 at two nodes to 0.150 at eight nodes. For SLInfer, it falls from 0.413 to 0.212 over the same range. This trend shows that the baselines spread across more GPUs, but memory remains the main bottleneck on the nodes that are still active. gKSM keeps similar instances on the same GPU and removes duplicate pages in place, so the cluster uses memory more effectively and reaches high service capacity with fewer nodes.
5 Discussion
Security. As in other CPU memory deduplication systems, there are side-channel risks in gKSM [18, 44, 49]. However, their practical impacts are limited by the lower sensitivity in LLM inference scenarios and trust-domain restrictions. Compared with conventional CPU memory deduplication, gKSM operates at 2MB page granularity, making fine-grained probing more difficult. For public or authorized model weights, a deduplication signal may reveal only a few model weight pages, which is insufficient to reconstruct the entire model weight. Considering that KV cache retains attention states derived from prompts [14, 24], gKSM can restrict its deduplication to operator-defined trust domains.
Deployment and Native Support. GPU memory deduplication can be provided by the cloud vendor or hardware provider. If NVIDIA provides GPU memory deduplication service, most parts of gKSM remain necessary, such as page management, duplication detection, stable-page scanning, and reuse-aware placement. In particular, reuse-aware placement remains relevant because sharing opportunities depend on colocation, as demonstrated in CPU virtualized systems [52]. However, NVIDIA may implement COW and page merging more efficiently in its kernel.
6 Related Work
Serverless Inference. Serverless inference has been studied as a way to elastically serve heterogeneous models under dynamic workloads. Systems such as INFaaS and AlpaServe

Figure 17. Resource Balance Ratio under Cluster Simulation
optimize model scheduling and parallelism for inference services [27, 40]. Recent serverless LLM systems further reduce cold start and memory pressure through model offloading, migration, and batch merging [12, 55, 60]. These works mainly address the problem from the scheduling and serving layers. However, these systems optimize above the GPU memory layer and do not address duplicate physical memory across colocated instances. This motivates our driver-layer GPU memory deduplication design for serverless inference. GPU Memory Deduplication. Memory deduplication has a long history in CPU and virtualized systems. Related systems such as KSM and Difference Engine scan memory pages, merge identical physical frames, and rely on kernel supported COW to preserve isolation [18, 33, 44]. Recent works improve deduplication efficiency through better page grouping or scanning policies [7, 38, 52, 57]. GPU memory systems mainly focus on memory management and defragmentation to optimize KV cache management for LLM serving. However, these works do not provide direct memory deduplication between independent GPU instances [3, 7, 17, 24, 37].
7 Conclusion
This paper presents gKSM, a transparent GPU memory deduplication framework for serverless LLM inference. Motivated by the large amount of duplicate GPU memory across colocated model instances, gKSM enables transparent memory sharing while preserving instance isolation. Our results show that memory deduplication can substantially improve GPU memory efficiency and system scalability for serverless inference. We view gKSM as a first step toward transparent GPU memory sharing for large scale LLM serving. As model deployment continues to grow, new opportunities will emerge to exploit memory duplication in the AI world.
Acknowledgments
We sincerely thank anonymous shepherd and reviewers for their insightful suggestions. This work was supported by NSFC (62472392, 62502189) and Major Science and Technology Projects of Anhui Province (S202305a12020032).
References
[1] Amey Agrawal, Nitin Kedia, Ashish Panwar, Jayashree Mohan, Nipun Kwatra, Bhargav S. Gulavani, Alexey Tumanov, and Ramachandran Ramjee. 2024. Taming Throughput-Latency Tradeoff in LLM Inference with Sarathi-Serve. In 18th USENIX Symposium on Operating Systems Design and Implementation (OSDI 24).
[2] Alibaba Cloud. 2024. PAI Elastic Algorithm Service (EAS). https://www.aliyun.com/product/bigdata/learn/eas. Accessed: 2025-11.
[3] Rachata Ausavarungnirun, Joshua Landgraf, Vance Miller, Saugata Ghose, Jayneel Gandhi, Christopher J. Rossbach, and Onur Mutlu. 2017. Mosaic: A GPU Memory Manager with Application-Transparent Support for Multiple Page Sizes. In 50th Annual IEEE/ACM International Symposium on Microarchitecture (MICRO 2017). 136–150.
[4] Jinze Bai, Shuai Bai, Shusheng Yang, Shijie Wang, Sinan Tan, Peng Wang, Junyang Lin, Chang Zhou, and Jingren Zhou. 2023. Qwen-VL: A Versatile Vision-Language Model for Understanding, Localization, Text Reading, and Beyond. arXiv preprint arXiv:2308.12966 (2023).
[5] Lequn Chen, Zihao Ye, Yongji Wu, Danyang Zhuo, Luis Ceze, and Arvind Krishnamurthy. 2024. Punica: Multi-Tenant LoRA Serving. In Proceedings of Machine Learning and Systems (MLSys 2024).
[6] Yue Cheng, Zheng Chai, and Ali Anwar. 2018. Characterizing Colocated Datacenter Workloads. In Proceedings of the 9th Asia-Pacific Workshop on Systems (APSys '18). Association for Computing Machinery, 1–3. doi:10.1145/3265723.3265742
[7] Esha Choukse, Michael B. Sullivan, Mike O'Connor, Mattan Erez, Jeff Pool, David Nellans, and Stephen W. Keckler. 2020. Buddy Compression: Enabling Larger Memory for Deep Learning and HPC Workloads on GPUs. In International Symposium on Computer Architecture (ISCA). IEEE. https://research.nvidia.com/sites/default/files/pubs/2020-06_Buddy-Compression%3A-Enabling/chouske.isca2020.pdf
[8] Yann Collet. 2024. xxHash: Extremely fast non-cryptographic hash algorithm. https://github.com/Cyan4973/xxHash. Accessed: 2025-11.
[9] DeepSpeed. 2021. DeepSpeed Inference: Multi-GPU inference with customized inference kernels and quantization support. https://www.deepspeed.ai/2021/03/15/inference-kernel-optimization.html.
[10] Tim Dettmers, Artidoro Pagnoni, Ari Holtzman, and Luke Zettlemoyer. 2023. QLoRA: Efficient Finetuning of Quantized LLMs. In Advances in Neural Information Processing Systems (NeurIPS 2023).
[11] Jiangfei Duan, Runyu Lu, Haojie Duanmu, Xiuhong Li, Xingcheng Zhang, Dahua Lin, Ion Stoica, and Hao Zhang. 2024. MuxServe: Flexible Spatial-Temporal Multiplexing for Multiple LLM Serving. In International Conference on Machine Learning (ICML 2024). 11905–11917.
[12] Yao Fu, Leyang Xue, Yeqi Huang, Andrei-Octavian Brabete, Dmitrii Ustiugov, Yuvraj Patel, and Luo Mai. 2024. ServerlessLLM: Low-Latency Serverless Inference for Large Language Models. In 18th USENIX Symposium on Operating Systems Design and Implementation (OSDI 24). 135–153. https://www.usenix.org/conference/osdi24/presentation/fu
[13] Henri Gilbert and Helena Handschuh. 2003. Security analysis of SHA-256 and sisters. In International workshop on selected areas in cryptography. Springer, 175–193.
[14] In Gim, Guojun Chen, Seung-Seob Lee, Nikhil Sarda, Anurag Khandelwal, and Lin Zhong. 2024. Prompt Cache: Modular Attention Reuse for Low-Latency Inference. In Proceedings of Machine Learning and Systems (MLSys 2024).
[15] Google Cloud. 2025. Model Garden on Vertex AI. https://cloud.google.com/model-garden?hl=en. Accessed: 2025-05.
[16] Arpan Gujarati, Reza Karimi, Safya Alzayat, Wei Hao, Antoine Kaufmann, Ymir Vigfusson, and Jonathan Mace. 2020. Serving DNNs like Clockwork: Performance Predictability from the Bottom Up. In 14th USENIX Symposium on Operating Systems Design and Implementation (OSDI 20). 443–462.
[17] Cong Guo, Rui Zhang, Jiale Xu, Jingwen Leng, Zihan Liu, Ziyu Huang, Minyi Guo, Hao Wu, Shouren Zhao, Junping Zhao, and Ke Zhang. 2024. GMLake: Efficient and Transparent GPU Memory Defragmentation for Large-Scale DNN Training with Virtual Memory Stitching. In Proceedings of the 29th ACM International Conference on Architectural Support for Programming Languages and Operating Systems, Volume 2 (ASPLOS 24). 450–466.
[18] Diwaker Gupta, Sangmin Lee, Michael Vrable, Stefan Savage, Alex C. Snoeren, George Varghese, Geoffrey M. Voelker, and Amin Vahdat. 2008. Difference Engine: Harnessing Memory Redundancy in Virtual Machines. In 8th USENIX Symposium on Operating Systems Design and Implementation (OSDI 08). 309–322.
[19] Connor Holmes, Masahiro Tanaka, Michael Wyatt, Ammar Ahmad Awan, Jeff Rasley, Samyam Rajbhandari, Reza Yazdani Aminabadi, Heyang Qin, Arash Baktiari, Lev Kurilenko, and Yuxiong He. 2024. DeepSpeed-FastGen: High-throughput Text Generation for LLMs via MII and DeepSpeed-Inference. arXiv preprint arXiv:2401.08671 (2024).
[20] Zicong Hong, Jian Lin, Song Guo, Sifu Luo, Wuhui Chen, Roger Wattenhofer, and Yue Yu. 2024. Optimus: Warming Serverless ML Inference via Inter-Function Model Transformation. In Proceedings of the Nineteenth European Conference on Computer Systems (EuroSys 24).
[21] Edward J. Hu, Yelong Shen, Phillip Wallis, Zeyuan Allen-Zhu, Yuanzhi Li, Shean Wang, Lu Wang, and Weizhu Chen. 2022. LoRA: Low-Rank Adaptation of Large Language Models. In International Conference on Learning Representations (ICLR 2022).
[22] Hugging Face. [n.d.]. Hugging Face Hub documentation. https://huggingface.co/docs/hub/index. Accessed: 2026-10-15.
[23] Hyojong Kim, Jaewoong Sim, Prasun Gera, Ramyad Hadidi, and Hyesoon Kim. 2020. Batch-Aware Unified Memory Management in GPUs for Irregular Workloads. In Proceedings of the Twenty-Fifth International Conference on Architectural Support for Programming Languages and Operating Systems (ASPLOS 2020). 1357–1370.
[24] Woosuk Kwon, Zhuohan Li, Siyuan Zhuang, Ying Sheng, Lianmin Zheng, Cody Hao Yu, Joseph Gonzalez, Hao Zhang, and Ion Stoica. 2023. Efficient memory management for large language model serving with pagedattention. In Proceedings of the 29th symposium on operating systems principles. 611–626.
[25] Junnan Li, Dongxu Li, Silvio Savarese, and Steven C. H. Hoi. 2023. BLIP-2: Bootstrapping Language-Image Pre-training with Frozen Image Encoders and Large Language Models. In International Conference on Machine Learning (ICML 2023).
[26] Jie Li, Laiping Zhao, Yanan Yang, Kunlin Zhan, and Keqiu Li. 2022. Tetris: Memory-efficient serverless inference through tensor sharing. In 2022 USENIX Annual Technical Conference (USENIX ATC 22).
[27] Zhuohan Li, Lianmin Zheng, Yinmin Zhong, Vincent Liu, Ying Sheng, Xin Jin, Yanping Huang, Zhifeng Chen, Hao Zhang, Joseph E. Gonzalez, and Ion Stoica. 2023. AlphaServe: Statistical Multiplexing with Model Parallelism for Deep Learning Serving. In 17th USENIX Symposium on Operating Systems Design and Implementation (OSDI 23). 663–679.
[28] Vladislav Lialin, Vijeta Deshpande, Xiaowei Yao, and Anna Rumshisky. 2024. Scaling Down to Scale Up: A Guide to Parameter-Efficient Fine-Tuning. arXiv preprint arXiv:2303.15647 (2024).
[29] Yanying Lin, Shuaipeng Wu, Shutian Luo, Hong Xu, Haiying Shen, Chong Ma, Min Shen, Le Chen, Chengzhong Xu, Lin Qu, and Kejiang Ye. 2025. Understanding Diffusion Model Serving in Production: A Top-Down Analysis of Workload, Scheduling, and Resource Efficiency. In ACM Symposium on Cloud Computing (SoCC '25).
[30] Haotian Liu, Chunyuan Li, Qingyang Wu, and Yong Jae Lee. 2023. Visual Instruction Tuning. In Advances in Neural Information Processing Systems (NeurIPS 2023).
[31] Yuhan Liu, Hanchen Li, Yihua Cheng, Siddhant Ray, Yuyang Huang, Qizheng Zhang, Kuntai Du, Jiayi Yao, Shan Lu, Ganesh Ananthanarayanan, Michael Maire, Henry Hoffmann, Ari Holtzman, and
Junchen Jiang. 2024. CacheGen: KV Cache Compression and Streaming for Fast Large Language Model Serving. In Proceedings of the ACM SIGCOMM 2024 Conference (SIGCOMM 2024). 38–56.
[32] Meta. 2024. Meta-Llama-3-8B. https://huggingface.co/meta-llama/Meta-Llama-3-8B.
[33] Konrad Miller, Fabian Franz, Thorsten Groeninger, Marc Rittinghaus, Marius Hillenbrand, and Frank Bellosa. 2012. KSM++: Using I/O-Based Hints to Make Memory-Deduplication Scanners More Efficient. In Proceedings of the ASPLOS Workshop on Runtime Environments, Systems, Layering and Virtualized Environments (RESoLVE 12).
[34] NVIDIA. 2024. CUDA Toolkit Documentation: Virtual Memory Management. https://docs.nvidia.com/cuda/cuda-driver-api/group_CUDA_VA.html.
[35] NVIDIA. 2024. TensorRT-LLM. https://github.com/NVIDIA/TensorRT-LLM.
[36] Pratyush Patel, Esha Choukse, Chaojie Zhang, Aashaka Shah, Inigo Goiri, Saeed Maleki, and Ricardo Bianchini. 2024. Splitwise: Efficient Generative LLM Inference Using Phase Splitting. In 51st Annual International Symposium on Computer Architecture (ISCA 24).
[37] Ramya Prabhu, Ajay Nayak, Jayashree Mohan, Ramachandran Ramjee, and Ashish Panwar. 2025. vAttention: Dynamic Memory Management for Serving LLMs without PagedAttention. In Proceedings of the 30th ACM International Conference on Architectural Support for Programming Languages and Operating Systems, Volume 1 (ASPLOS 2025). 1133–1150.
[38] Wei Qiu, Marcin Copik, Yun Wang, Alexandru Calotoiu, and Torsten Hoefler. 2023. User-guided Page Merging for Memory Deduplication in Serverless Systems. In 2023 IEEE International Conference on Big Data (BigData 2023). 159–169.
[39] Qwen, An Yang, Baosong Yang, Beichen Zhang, Binyuan Hui, Bo Zheng, Bowen Yu, Chengyuan Li, Dayiheng Liu, Fei Huang, Haoran Wei, Huan Lin, Jian Yang, Jianhong Tu, Jianwei Zhang, Jianxin Yang, Jiaxi Yang, Jingren Zhou, Junyang Lin, Kai Dang, Keming Lu, Keqin Bao, Kexin Yang, Le Yu, Mei Li, Mingfeng Xue, Pei Zhang, Qin Zhu, Rui Men, Runji Lin, Tianhao Li, Tianyi Tang, Tingyu Xia, Xingzhang Ren, Xuancheng Ren, Yang Fan, Yang Su, Yichang Zhang, Yu Wan, Yuqiong Liu, Zeyu Cui, Zhenru Zhang, and Zihan Qiu. 2025. Qwen2.5 Technical Report. arXiv:2412.15115 [cs.CL] https://arxiv.org/abs/2412.15115
[40] Francisco Romero, Qian Li, Neeraja J. Yadwadkar, and Christos Kozyrakis. 2021. INFaaS: Automated Model-less Inference Serving. In 2021 USENIX Annual Technical Conference (USENIX ATC 21). 397–411.
[41] Mohammad Shahrad, Rodrigo Fonseca, Inigo Goiri, Gohar Irfan Chaudhry, Paul Batum, Jason Cooke, Eduardo Laureano, Colby Tressness, Mark Russinovich, and Ricardo Bianchini. 2020. Serverless in the Wild: Characterizing and Optimizing the Serverless Workload at a Large Cloud Provider. In 2020 USENIX Annual Technical Conference (USENIX ATC 20).
[42] Furquan Shaikh, Fangzhou Yao, Indranil Gupta, and Roy H. Campbell. 2014. VMDedup: Memory De-duplication in Hypervisor. In IEEE International Conference on Cloud Engineering (IC2E).
[43] ShareGPT. 2023. ShareGPT. https://sharegpt.com/.
[44] Prateek Sharma and Purushottam Kulkarni. 2012. Singleton: system-wide page deduplication in virtual environments. In 21st ACM International Symposium on High-Performance Parallel Distributed Computing (HPDC).
[45] Ying Sheng, Shiyi Cao, Dacheng Li, Coleman Hooper, Nicholas Lee, Shuo Yang, Christopher Chou, Banghua Zhu, Lianmin Zheng, Kurt Keutzer, Joseph E. Gonzalez, and Ion Stoica. 2024. S-LoRA: Serving Thousands of Concurrent LoRA Adapters. In Proceedings of Machine Learning and Systems (MLSys 2024).
[46] Ying Sheng, Lianmin Zheng, Binhang Yuan, Zhuohan Li, Max Ryabinin, Beidi Chen, Percy Liang, Christopher Ré, Ion Stoica, and Ce Zhang.
- FlexGen: High-Throughput Generative Inference of Large Language Models with a Single GPU. In International Conference on Machine Learning (ICML 2023). 31094–31116.
[47] Biao Sun, Ziming Huang, Hanyu Zhao, Wencong Xiao, Xinyi Zhang, Yong Li, and Wei Lin. 2024. Llumnix: Dynamic Scheduling for Large Language Model Serving. In 18th USENIX Symposium on Operating Systems Design and Implementation (OSDI 24). 173–191.
[48] Team GLM, Aohan Zeng, Bin Xu, Bowen Wang, Chenhui Zhang, Da Yin, Dan Zhang, Diego Rojas, Guanyu Feng, Hanlin Zhao, Hanyu Lai, Hao Yu, Hongning Wang, Jiadai Sun, Jiajie Zhang, Jiale Cheng, Jiayi Gui, Jie Tang, Jing Zhang, Jingyu Sun, Juanzi Li, Lei Zhao, Lindong Wu, Lucen Zhong, Mingdao Liu, Minlie Huang, Peng Zhang, Qinkai Zheng, Rui Lu, Shuaiqi Duan, Shudan Zhang, Shulin Cao, Shuxun Yang, Weng Lam Tam, Wenyi Zhao, Xiao Liu, Xiao Xia, Xiaohan Zhang, Xiaotao Gu, Xin Lv, Xinghan Liu, Xinyi Liu, Xinyue Yang, Xixuan Song, Xunkai Zhang, Yifan An, Yifan Xu, Yilin Niu, Yuantao Yang, Yueyan Li, Yushi Bai, Yuxiao Dong, Zehan Qi, Zhaoyu Wang, Zhen Yang, Zhengxiao Du, Zhenyu Hou, and Zihan Wang. 2024. ChatGLM: A Family of Large Language Models from GLM-130B to GLM-4 All Tools. arXiv:2406.12793 [cs.CL] https://arxiv.org/abs/2406.12793
[49] Carl A. Waldspurger. 2002. Memory Resource Management in VMware ESX Server. In 5th Symposium on Operating Systems Design and Implementation (OSDI 02). 181–194.
[50] Ao Wang, Shuai Chang, Huangshi Tian, Hongqi Wang, Haoran Yang, Huiba Li, Rui Du, and Yue Cheng. 2021. FaaSNet: Scalable and Fast Provisioning of Custom Serverless Container Runtimes at Alibaba Cloud Function Compute. https://arxiv.org/abs/2105.11229.
[51] Liang Wang, Mengyuan Li, Yinqian Zhang, Thomas Ristenpart, and Michael Swift. 2018. Peeking Behind the Curtains of Serverless Platforms. In 2018 USENIX Annual Technical Conference (USENIX ATC 18). USENIX Association, 133–146. https://www.usenix.org/conference/atc18/presentation/wang-liang
[52] Timothy Wood, Gabriel Tarasuk-Levin, Prashant J. Shenoy, Peter Desnoyers, Emmanuel Cecchet, and Mark D. Corner. 2009. Memory Buddies: Exploiting Page Sharing for Smart Colocation in Virtualized Data Centers. In Proceedings of the 5th ACM SIGPLAN/SIGOPS International Conference on Virtual Execution Environments (VEE 2009). 31–40.
[53] Bingyang Wu, Yinmin Zhong, Zili Zhang, Shengyu Liu, Fangyue Liu, Yuanhang Sun, Gang Huang, Xuanzhe Liu, and Xin Jin. 2023. Fast Distributed Inference Serving for Large Language Models. arXiv preprint arXiv:2305.05920 (2023).
[54] Yuxing Xiang, Xue Li, Kun Qian, Wenyuan Yu, Ennan Zhai, and Xin Jin. 2026. ServeGen: Workload Characterization and Generation of Large Language Model Serving in Production. arXiv:2505.09999 [cs.DC] https://arxiv.org/abs/2505.09999
[55] Chuhao Xu, Zijun Li, Quan Chen, Han Zhao, Xueyan Tang, and Minyi Guo. 2026. Towards Resource-Efficient Serverless LLM Inference with SLINFER. In 2026 IEEE International Symposium on High-Performance Computer Architecture (HPCA 2026).
[56] An Yang, Anfeng Li, Baosong Yang, Beichen Zhang, Binyuan Hui, Bo Zheng, Bowen Yu, Chang Gao, Chengen Huang, Chenxu Lv, Chujie Zheng, Dayiheng Liu, Fan Zhou, Fei Huang, Feng Hu, Hao Ge, Haoran Wei, Huan Lin, Jialong Tang, Jian Yang, Jianhong Tu, Jianwei Zhang, Jianxin Yang, Jiaxi Yang, Jing Zhou, Jingren Zhou, Junyang Lin, Kai Dang, Keqin Bao, Kexin Yang, Le Yu, Lianghao Deng, Mei Li, Mingfeng Xue, Mingze Li, Pei Zhang, Peng Wang, Qin Zhu, Rui Men, Ruize Gao, Shixuan Liu, Shuang Luo, Tianhao Li, Tianyi Tang, Wenbiao Yin, Xingzhang Ren, Xinyu Wang, Xinyu Zhang, Xuancheng Ren, Yang Fan, Yang Su, Yichang Zhang, Yinger Zhang, Yu Wan, Yuqiong Liu, Zekun Wang, Zeyu Cui, Zhenru Zhang, Zhipeng Zhou, and Zihan Qiu. 2025. Qwen3 Technical Report. arXiv:2505.09388 [cs.CL] https://arxiv.org/abs/2505.09388
[57] Shijun Yang, Shuheng Gao, Chaomei Yan, Guoli Wei, and Yongkun Li. 2026. Token Write Amplification in LLM-Mediated State Stores. In 18th ACM Workshop on Hot Topics in Storage and File Systems (HotStorage 26). 105–114.
[58] Gyeong-In Yu, Joo Seong Jeong, Geon-Woo Kim, Soojeong Kim, and Byung-Gon Chun. 2022. Orca: A Distributed Serving System for Transformer-Based Generative Models. In 16th USENIX Symposium on Operating Systems Design and Implementation (OSDI 22). 521–538.
[59] Minchen Yu, Ao Wang, Dong Chen, Haoxuan Yu, Xiaonan Luo, Zhuohao Li, Wei Wang, Ruichuan Chen, Dapeng Nie, Haoran Yang, and Yu Ding. 2025. Torpor: GPU-Enabled Serverless Computing for Low-Latency, Resource-Efficient Inference. arXiv:2306.03622 [cs.DC] https://arxiv.org/abs/2306.03622
[60] Shan Yu, Yifan Qiao, Mingyuan Ma, Yangmin Li, Shuo Yang, Xinyuan Tong, Yang Wang, Zhiqiang Xie, Yuwei An, Shiyi Cao, Ke Bao, Deepak Vij, Xiaoning Ding, Yichen Wang, Qingda Lu, Zhong Wang, Gao Gao, Harry Xu, Junyi Shu, Jiarong Xing, and Ying Sheng. 2026. Prism: Cost-Efficient Multi-LLM Serving via GPU Memory Ballooning. In 20th USENIX Symposium on Operating Systems Design and Implementation (OSDI 26). USENIX Association, Seattle, WA, 75–93. https://www.usenix.org/conference/osdi26/presentation/yu-shan
[61] Yongkang Zhang, Haoxuan Yu, Chenxia Han, Cheng Wang, Baotong Lu, Yunzhe Li, Zhifeng Jiang, Yang Li, Xiaowen Chu, and Huaicheng Li. 2025. SGDRC: Software-Defined Dynamic Resource Control for Concurrent DNN Inference on NVIDIA GPUs. arXiv preprint arXiv:2407.13996 (2025).
[62] Zhenyu Zhang, Ying Sheng, Tianyi Zhou, Tianlong Chen, Lianmin Zheng, Ruisi Cai, Zhao Song, Yuandong Tian, Christopher Ré, Clark W. Barrett, Zhangyang Wang, and Beidi Chen. 2023. H₂O: Heavy-Hitter Oracle for Efficient Generative Inference of Large Language Models. In Advances in Neural Information Processing Systems (NeurIPS 2023).
[63] Lianmin Zheng, Liangsheng Yin, Zhiqiang Xie, Chuyue Sun, Jeff Huang, Cody Hao Yu, Shiyi Cao, Christos Kozyrakis, Ion Stoica, Joseph E. Gonzalez, Clark Barrett, and Ying Sheng. 2024. SGLang: Efficient Execution of Structured Language Model Programs. arXiv:2312.07104 [cs.AI] https://arxiv.org/abs/2312.07104
[64] Yinmin Zhong, Shengyu Liu, Junda Chen, Jianbo Hu, Yibo Zhu, Xuanzhe Liu, Xin Jin, and Hao Zhang. 2024. DistServe: Disaggregating Prefill and Decoding for Goodput-optimized Large Language Model Serving. In 18th USENIX Symposium on Operating Systems Design and Implementation (OSDI 24). 193–210.