Inference InfrastructureCUDALLM SystemsApplied ResearchMarch 2024
Fused CUDA Kernel for Multi-Tenant Quantized LoRA Inference
Problem & Motivation
Serving hundreds of distinct fine-tuned LoRA adapters concurrently on a single GPU cluster typically forces an expensive trade-off: either merge weights on-the-fly (incurring prohibitive weight-swapping latency and GPU VRAM bloat) or maintain separate full-precision base model instances per customer.
High-Performance Kernel Solution
- Fused Int8 × FP16 Pipeline: Developed a specialized CUDA kernel computing unmerged LoRA paths over an int8-quantized base model.
- GEMM Fusion: Fused the quantized base GEMM operation directly with the FP16 low-rank projection path ($W_{base} \cdot x + \frac{\alpha}{r} B \cdot A \cdot x$).
- Memory Bandwidth Efficiency: Kept intermediate activations in shared memory / L1 cache, eliminating redundant round-trip global memory accesses between base model forward passes and adapter calculations.
- Multi-Tenant Throughput: Enabled high-density multi-tenant adapter serving with near-zero latency penalty over base model inference.
