Skip to main content
QUICK REVIEW

[Paper Review] Punica: Multi-Tenant LoRA Serving

Lequn Chen, Zihao Ye|arXiv (Cornell University)|Oct 28, 2023
Advanced Neural Network ApplicationsComputer Science4 citations
TL;DR

Punica is a multi-tenant LoRA serving system that enables efficient batching of multiple, different LoRA models on a single GPU by introducing a novel CUDA kernel, Segmented Gather Matrix-Vector Multiplication (SGMV), which allows concurrent execution without duplicating the base pre-trained model. This design achieves 12x higher throughput than state-of-the-art LLM serving systems with only 2ms additional latency per token.

ABSTRACT

Low-rank adaptation (LoRA) has become an important and popular method to adapt pre-trained models to specific domains. We present Punica, a system to serve multiple LoRA models in a shared GPU cluster. Punica contains a new CUDA kernel design that allows batching of GPU operations for different LoRA models. This allows a GPU to hold only a single copy of the underlying pre-trained model when serving multiple, different LoRA models, significantly enhancing GPU efficiency in terms of both memory and computation. Our scheduler consolidates multi-tenant LoRA serving workloads in a shared GPU cluster. With a fixed-sized GPU cluster, our evaluations show that Punica achieves 12x higher throughput in serving multiple LoRA models compared to state-of-the-art LLM serving systems while only adding 2ms latency per token. Punica is open source at https://github.com/punica-ai/punica .

Motivation & Objective

  • To address the inefficiency of serving multiple LoRA models in shared GPU clusters, where traditional approaches require per-model GPU allocation.
  • To enable batching of inference requests across different LoRA models, overcoming the limitation that batching typically requires identical models.
  • To improve GPU utilization by consolidating multi-tenant LoRA workloads on a minimal number of GPUs through shared base model weights.
  • To maintain low latency during inference, especially in the decode stage, which dominates serving cost.
  • To design a scheduler that enables dynamic consolidation and migration of LoRA workloads for optimal GPU resource utilization.

Proposed method

  • Design of a new CUDA kernel, Segmented Gather Matrix-Vector Multiplication (SGMV), which enables batching of GPU operations across different LoRA models by handling segmented input and output data.
  • Use of SGMV to allow a single GPU to serve multiple LoRA models simultaneously by reusing one copy of the base pre-trained model.
  • Implementation of a two-phase scheduling strategy: first routing new requests to underutilized GPUs to maximize batch size, and then proactively migrating existing requests to consolidate workloads.
  • On-demand loading of LoRA adapter weights with millisecond-level latency to avoid preloading and reduce memory pressure.
  • Integration with existing optimizations such as vLLM, FlashAttention, and KvCache quantization to further enhance performance.
  • Leveraging weight correlations among LoRA models fine-tuned from the same base model to enable efficient shared inference.

Experimental results

Research questions

  • RQ1Can batching be effectively extended to support multiple, different LoRA models on the same GPU, despite model-specific adapter matrices?
  • RQ2What kernel-level optimizations are required to enable concurrent execution of different LoRA models without duplicating the base model weights?
  • RQ3How can a scheduler efficiently consolidate multi-tenant LoRA workloads across a shared GPU cluster while maintaining low latency?
  • RQ4What is the performance overhead of on-demand LoRA weight loading compared to preloading?
  • RQ5To what extent can GPU memory and compute utilization be improved by sharing the base model across multiple LoRA adapters?

Key findings

  • Punica achieves 12x higher throughput in serving multiple LoRA models compared to state-of-the-art LLM serving systems on the same fixed GPU cluster.
  • The system adds only 2ms of additional latency per token compared to baseline systems, demonstrating minimal performance overhead.
  • SGMV enables near-identical performance between batching same-model and different-model requests, indicating negligible performance penalty for model diversity.
  • On-demand loading of LoRA weights introduces only millisecond-level latency, enabling flexible and efficient resource allocation.
  • The scheduler successfully consolidates workloads by dynamically migrating requests, allowing GPUs to be released when idle, improving cluster utilization.
  • The system maintains high GPU utilization by prioritizing large batch sizes and only allocating new GPUs when existing ones are fully saturated.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.