mLoRA: Fine-Tuning LoRA Adapters via Highly-Efficient Pipeline Parallelism in Multiple GPUs

Zhengmao Ye, Dengchun Li, Zetao Hu, Tingfeng Lan, Jian Sha, Shicong Zhang, Lei Duan, Jie Zuo, Hui Lu, Yuanchun Zhou, Mingjie Tang

TL;DR

This paper introduces mLoRA, a novel system for efficiently fine-tuning multiple LoRA adapters simultaneously across multiple GPUs. By introducing LoRA-aware pipeline parallelism (LoRAPP) and a BatchLoRA operator, mLoRA significantly reduces fine-tuning time and memory requirements, making it feasible to fine-tune larger models and more adapters concurrently.

What Problem Does This Paper Address?

Large Language Models (LLMs) have shown remarkable performance, but fine-tuning them for specific tasks is computationally expensive. Parameter-Efficient Fine-Tuning (PEFT) methods like LoRA offer a solution by updating only a small subset of parameters. However, as developers increasingly fine-tune multiple LoRA adapters for various applications or hyperparameter tuning, existing model parallelism techniques (like tensor or pipeline parallelism) suffer from high communication overhead and inefficient GPU utilization, especially with the small size of LoRA adapters. This paper addresses the challenge of efficiently and concurrently fine-tuning multiple LoRA adapters across multiple GPUs and machines, aiming to reduce training time and improve GPU utilization.

Methods

mLORA introduces two key techniques:

  • LoRA-aware Pipeline Parallelism (LoRAPP): This novel pipeline parallelism scheme efficiently pipelines LoRA adapters and their distinct fine-tuning stages across GPUs. Unlike traditional pipeline parallelism that creates bubbles due to dependencies, LoRAPP leverages the independence of LoRA adapter training to schedule distinct stages (forward/backward passes) of different adapters concurrently, effectively eliminating pipeline bubbles and overlapping communication with computation.
  • BatchLoRA Operator: This operator consolidates training data from multiple fine-tuning tasks into a larger batch. By performing collective matrix multiplication operations for all involved adapters simultaneously, it significantly reduces the overhead of frequent GPU kernel launches, thereby enhancing GPU utilization and reducing overall training time.

mLORA also incorporates a task scheduler that prioritizes tasks and dynamically estimates memory usage to avoid out-of-memory (OOM) errors.

Datasets

The paper evaluates mLoRA using the GSM8K dataset for natural language generation tasks. The experiments fine-tune various publicly available LLMs, including TinyLlama-1.1B, Llama-2-7B, Llama-2-13B, and Llama-2-70B.

Key Insights and Ideas

  • LoRA Independence is Key: The core insight is that individual LoRA adapters, despite sharing a base model, can be trained independently. This independence is crucial for enabling LoRAPP to achieve zero pipeline bubbles by interleaving stages of different adapters.
  • Kernel Launch Overhead is Significant: For fine-tuning many small LoRA adapters, the overhead of launching GPU kernels becomes a substantial bottleneck, even more so than the computation itself. BatchLoRA directly addresses this by reducing the number of kernel launches.
  • Memory Efficiency is Crucial for Scalability: Existing methods like FSDP struggle with memory requirements, especially when fine-tuning larger models or multiple adapters. mLoRA's approach, by sharing the base model and optimizing pipeline stages, significantly reduces memory pressure.
  • Task Scheduling Matters: Effectively managing multiple fine-tuning tasks requires intelligent scheduling that considers user priorities and dynamically estimates memory usage to prevent OOM errors.

Key Results

  • mLORA significantly reduces average fine-tuning task completion time, achieving up to 30-45% reduction compared to state-of-the-art methods like FSDP in single-machine multi-GPU setups.
  • It enables simultaneous fine-tuning of larger models, such as two Llama-2-13B models on four NVIDIA RTX A6000 GPUs, which is not feasible for FSDP due to memory constraints.
  • BatchLoRA operator reduces kernel launch overhead, leading to an 8% reduction in training time for the 1.1B model compared to PEFT.
  • LoRAPP improves throughput by 60% for the 1.1B model when overlapping communication.
  • mLORA demonstrates linear scalability with the number of GPUs.
  • The system has been deployed at AntGroup, reducing the time for selecting optimal hyperparameters by 30%.

Limitations and Future Work

  • Model Size Limitations: While mLoRA improves efficiency, fine-tuning extremely large models (e.g., 70B) still requires multi-GPU setups and may necessitate techniques like 8-bit quantization and activation checkpointing, even with mLoRA.
  • Adaptability to Other PEFT Methods: The paper focuses on LoRA. While the authors suggest that other PEFT methods could be applied, further research might explore how mLoRA's techniques generalize to different PEFT approaches.
  • Further Optimization of Scheduling: While mLoRA includes a priority-based scheduler with memory estimation, more sophisticated scheduling strategies could potentially further optimize resource utilization and throughput.

Summary updated

BibTeX
@article{ye2025mlora,
  author = {Zhengmao Ye and Dengchun Li and Zetao Hu and Tingfeng Lan and Jian Sha and Shicong Zhang and Lei Duan and Jie Zuo and Hui Lu and Yuanchun Zhou and Mingjie Tang},
  title = {{mLoRA: Fine-Tuning LoRA Adapters via Highly-Efficient Pipeline Parallelism in Multiple GPUs}},
  journal = {Proc. VLDB Endow.},
  year = {2025},
  doi = {10.14778/3725688.3725718},
}
Figure