mTuner: Accelerating Parameter-Efficient Fine-Tuning on Multi-GPU Servers with Elastic Tensor

Kezhao Huang, Siqi Zhu, Mingshu Zhai, Liyan Zheng, Kinman Lei, Jiaao He, Yuyang Jin, Jidong ZhaiUSENIX ATC 2025

TL;DR

This paper introduces mTuner, a novel system that significantly accelerates parameter-efficient fine-tuning (PEFT) of large language models (LLMs) on multi-GPU servers. By introducing "Elastic Tensors," mTuner dynamically manages memory to overcome bottlenecks, achieving substantial throughput improvements over existing methods.

What Problem Does This Paper Address?

The rapid growth of large language models (LLMs) has led to a surge in demand for fine-tuning them for specific tasks. However, fine-tuning these massive models, even with parameter-efficient techniques (PEFT), presents significant memory challenges on multi-GPU systems. Existing PEFT methods, while reducing computational and storage demands compared to full fine-tuning, still struggle with:

  • Low temporal memory utilization: Memory usage fluctuates dramatically, with significant idle periods ("valleys") between peak demands, leading to underutilization of hardware.
  • Data dependence: Communication for runtime tensors (like activations) is often constrained by computation, leading to inefficient use of communication resources.
  • High peak memory consumption: Inflexible memory accumulation strategies lead to excessive memory pressure during peak usage, limiting optimization opportunities.

These issues collectively hinder the efficient and scalable fine-tuning of LLMs.

Methods

The core innovation of mTuner is the Elastic Tensor abstraction. This concept treats tensors (weights, activations, gradients) as dynamic entities whose memory usage can be adjusted during runtime. mTuner implements four key actions for elastic tensors:

  • Gather: Makes remote data partitions locally available.
  • Discard: Drops gathered tensors to save memory.
  • Execute: Performs model computation and generates runtime tensors.
  • Checkpoint: Saves generated runtime tensors for gradient computation.

These actions can be controlled with tunable ratios, allowing for fine-grained management. Based on this, mTuner introduces three novel optimizations:

  1. Temporal Memory Adjustment: Leverages frozen parameters in PEFT to reuse idle memory during "valley" stages, enhancing temporal memory utilization.
  2. Dependence-Relaxed Communication: Facilitates interplay between static and runtime tensors to relax data dependencies, improving communication-computation overlap.
  3. Adaptive Data Accumulation: Dynamically adjusts how runtime tensors are stored and accumulated, reducing peak memory pressure.

mTuner also incorporates a Holistic Schedule Searching mechanism, a dual-memory dynamic programming approach, to find the optimal elastic tensor configuration that minimizes execution time while respecting both peak and valley memory constraints.

Datasets

The paper evaluates mTuner on various sizes of the Llama 2 model (7B, 13B, 30B, and 70B parameters). The input data consists of samples with sequence lengths ranging from 1024 to 8192. The PEFT method used for evaluation is LoRA (Low-Rank Adaptation). No new benchmarks were introduced; rather, existing LLMs were used to demonstrate mTuner's effectiveness.

Key Insights and Ideas

  • Memory is the primary bottleneck for PEFT: The paper strongly emphasizes that memory efficiency, not just computation, is the critical factor for accelerating LLM fine-tuning.
  • Dynamic memory management is key: Static memory allocation strategies are insufficient for the dynamic nature of LLM fine-tuning. Elastic Tensors offer a flexible solution.
  • Exploiting PEFT's frozen parameters: The "frozen" nature of parameters in PEFT is a crucial opportunity for memory optimization that mTuner effectively leverages.
  • Balancing peak and valley memory: Addressing both high peak memory demands and underutilized valley periods is essential for overall efficiency.
  • Data dependence is a solvable problem: By strategically using static data, mTuner can relax data dependencies and improve communication efficiency.

Key Results

mTuner demonstrates significant performance improvements across various LLM sizes and hardware configurations:

  • PCIe Server: Achieves up to 51.2% throughput improvement and 28.3% on average compared to state-of-the-art systems like DeepSpeed.
  • NVLink Server: Achieves up to 24.8% throughput improvement and 14.5% on average compared to baselines.
  • Speedup: mTuner provides an average speedup of 1.28x over existing training systems.
  • Memory Reduction: Activation checkpointing reduces memory requirements by a factor of 10x.
  • Schedule Search: The schedule search overhead is acceptable, taking only tens of seconds.

Limitations and Future Work

  • Hardware Dependency: The current implementation is tested on NVIDIA GPUs (A100/H100) and requires significant memory (>400GB).
  • Applicability: While mTuner is designed to be applicable to Transformer models and PEFT techniques, its performance might vary with different model architectures or PEFT methods.
  • Future Work: The paper suggests that mTuner's approach can be extended to optimize other aspects of LLM training and inference, such as distributed training strategies and memory optimization for serving. Further exploration of adaptive strategies for different hardware and model configurations is also a promising direction.

Summary updated

BibTeX
@inproceedings{huang2025mtuner,
  author = {Kezhao Huang and Siqi Zhu and Mingshu Zhai and Liyan Zheng and Kinman Lei and Jiaao He and Yuyang Jin and Jidong Zhai},
  title = {{mTuner: Accelerating Parameter-Efficient Fine-Tuning on Multi-GPU Servers with Elastic Tensor}},
  booktitle = {USENIX ATC},
  year = {2025},
  url = {https://openreview.net/forum?id=71ZHGoOTHz},
}
Figure