只用部分注意力模块就能高效微调大模型,省时省力。
You Don't Need All Attentions: Distributed Dynamic Fine-Tuning for Foundation Models
- 动态选择关键注意力模块,减少计算量
- 训练成本降40%,通信开销减50%,精度损失仅1%-2%
- 适合资源受限设备和参数高效微调场景
微调在以少量训练成本适配下游任务中至关重要。然而,基础模型规模迅速扩大,给多数商用设备带来了内存带宽不足的挑战。现有方法如模型分片和张量并行虽能分散计算以满足内存需求,但未能充分利用基础模型特性,导致计算开销高且负载不均。本文提出一种新型分布式动态微调框架D2FT,基于观察:微调过程中并非所有注意力模块都需参与前向与反向传播。通过三种创新选择策略,D2FT显著降低微调计算负载;并通过多背包优化算法解决分布式环境中的负载不平衡问题。实验表明,D2FT在CIFAR-10、CIFAR-100和Stanford Cars数据集上,将训练计算成本降低40%,通信成本减少50%,准确率仅下降1%至2%。此外,D2FT可有效扩展至最新参数高效微调技术LoRA,D2FT LoRA在Stanford Cars上仅损失4%至6%的Top-1准确率,同时实现40%计算或50%通信成本的削减。
原文摘要 · Abstract (English)
Fine-tuning plays a crucial role in adapting models to downstream tasks with minimal training efforts. However, the rapidly increasing size of foundation models poses a daunting challenge for accommodating foundation model fine-tuning in most commercial devices, which often have limited memory bandwidth. Techniques like model sharding and tensor parallelism address this issue by distributing computation across multiple devices to meet memory requirements. Nevertheless, these methods do not fully leverage their foundation nature in facilitating the fine-tuning process, resulting in high computational costs and imbalanced workloads. We introduce a novel Distributed Dynamic Fine-Tuning (D2FT) framework that strategically orchestrates operations across attention modules based on our observation that not all attention modules are necessary for forward and backward propagation in fine-tuning foundation models. Through three innovative selection strategies, D2FT significantly reduces the computational workload required for fine-tuning foundation models. Furthermore, D2FT addresses workload imbalances in distributed computing environments by optimizing these selection strategies via multiple knapsack optimization. Our experimental results demonstrate that the proposed D2FT framework reduces the training computational costs by 40% and training communication costs by 50% with only 1% to 2% accuracy drops on the CIFAR-10, CIFAR-100, and Stanford Cars datasets. Moreover, the results show that D2FT can be effectively extended to recent LoRA, a state-of-the-art parameter-efficient fine-tuning technique. By reducing 40% computational cost or 50% communication cost, D2FT LoRA top-1 accuracy only drops 4% to 6% on Stanford Cars dataset.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。