Abstract
Serverless computing has grown rapidly for serving Large Language Model (LLM) inference due to its pay-as-you-go pricing, fine-grained GPU usage, and rapid scaling. However, our analysis reveals that current serverless can effectively serve general LLM but fail with Low-Rank Adaptation (LoRA) inference due to three key limitations: 1) massive parameter redundancy among functions where 99% of weights are unnecessarily duplicated, 2) costly artifact loading latency beyond LLM loading, and 3) magnified resource contention when serving multiple LoRA LLMs. These inefficiencies lead to massive GPU wastage, increased Time-To-First-Token (TTFT), and high monetary costs. We propose ServerlessLoRA, a novel serverless inference system designed for faster and cheaper LoRA LLM serving. ServerlessLoRA enables secure backbone LLM sharing across isolated LoRA functions to reduce redundancy. We design a pre-loading method that pre-loads comprehensive LoRA artifacts to minimize cold-start latency. Furthermore, ServerlessLoRA employs contention aware batching and offloading to mitigate GPU resource conflicts during bursty workloads. Experiment on industrial workloads demonstrates that ServerlessLoRA reduces TTFT by up to 86% and cuts monetary costs by up to 89% compared to state-of-the-art LLM inference solutions.
Introduction
While serverless computing is ideal for the "bursty" nature of AI workloads due to its pay-as-you-go pricing, it struggles with the unique architecture of Low-Rank Adaptation (LoRA). LoRA allows users to fine-tune LLMs by adding tiny "adapters" to a massive, frozen "backbone" model. Current serverless platforms treat every LoRA-based function as a completely independent unit, leading to massive redundancy (the backbone accounts for ~99% of weights), hidden cold-start latencies (CUDA context, JIT kernels), and resource contention during bursts.
System Design
ServerlessLoRA introduces several novel components to the serverless stack to address these inefficiencies, as illustrated in the system architecture below.
Secure Backbone Sharing
To maintain security isolation, the system decouples static backbone tensors from dynamic function logic. It loads the backbone once into a dedicated instance and shares it via CUDA Inter-Process Communication (IPC) handles. This allows functions to access the same memory region in a read-only, zero-copy manner without merging weights.
Comprehensive Pre-loading
The system treats artifact loading as a Precedence-Constrained Knapsack Problem (PCKP). It uses a greedy algorithm to decide which libraries, adapters, and kernels to pre-load into idle containers based on "value density"—a metric combining loading delay and request frequency.
Adaptive Batching & Dynamic Offloading
At the local level, a "fill-or-expire" batching mechanism maximizes throughput while respecting Service Level Objectives (SLOs). Globally, a contention-aware scheduler prioritizes batches based on deadline margins. If a GPU runs out of memory for KV caches during a burst, a "Dynamic Offloader" evicts the least valuable pre-loaded artifacts.
Evaluation
The system was evaluated using real-world production traces from Azure Functions (Predictable, Normal, and Bursty patterns) and Llama2-7B/13B backbones with popular LoRA adapters.
Key Results
- Latency: ServerlessLoRA accelerates TTFT by up to 4.7x compared to ServerlessLLM and 7.1x compared to InstaInfer, largely by eliminating redundant model loading.
- Cost: It achieves up to an 89% reduction in monetary costs by minimizing GPU idle time and memory wastage.
- Throughput: The system improves maximum token throughput by 1.65x and completed requests by up to 3.02x compared to baselines.
Discussion
While ServerlessLoRA significantly improves efficiency, it does introduce a small, fixed memory overhead (approx. 473 MB per process) for CUDA contexts. Additionally, because the backbone is shared and read-only, the system performs "unmerged" inference, which is slightly less computationally efficient than a merged model for a single user but enables massive multi-tenant scaling. Future work includes exploring finer-grained resource isolation and supporting other Parameter-Efficient Fine-Tuning (PEFT) methods.
Summary updated