Deep neural networks have achieved capabilities comparable to or even surpassing human performance in various fields. This success is attributed to backpropagation, a learning rule commonly used to train deep neural networks. Backpropagation is an alg...
Deep neural networks have achieved capabilities comparable to or even surpassing human performance in various fields. This success is attributed to backpropagation, a learning rule commonly used to train deep neural networks. Backpropagation is an algorithm based on the chain rule that propagates errors backward, effectively adapting the weights in the model to minimize the loss. However, backpropagation entails significant training costs. First, it requires substantial training memory to store model states and activation memory. Second, it demands high computational costs for calculating activations during forward propagation and computing both input and weight gradients during backward propagation. Consequently, training deep neural networks often requires numerous expensive computing devices such as GPUs, and consumes considerable time and power. To address these challenges, various efficient training algorithms have been proposed, including parameter-efficient fine-tuning (PEFT), activation rematerialization, activation-compressed training, and layer dropping. This dissertation focuses on improving existing efficient training algorithms or proposing new optimization methods for training.
First, Auxiliary Activation Learning (AAL) is proposed to reduce activation memory without incurring additional training time. The proposed training algorithm adds auxiliary activations to the output activations during forward propagation and stores the auxiliary activations in memory instead of the actual activations for computing weight gradients. In contrast to existing activation memory-saving algorithms, such as activation rematerialization and activation-compressed training, AAL avoids additional processes like quantization, dequantization, or recalculation, thereby eliminating training time overhead for reducing activation memory. Furthermore, we theoretically prove that auxiliary activations can ensure the convergence of the loss under specific conditions. Two types of auxiliary activations that satisfy these conditions are proposed, achieving up to a 30% reduction in activation memory without compromising accuracy or introducing training time overhead in vision and text classification tasks.
Second, Averaged Low-Precision Activation for Memory-Efficient Training (ALAM) is proposed, a state-of-the-art (SOTA) activation-compressed training framework designed to significantly reduce activation memory without sacrificing training performance. ALAM introduces two key innovations: Average Quantization and a lightweight sensitivity calculation method. Average Quantization compresses activations into their group average values, theoretically minimizing gradient variance, and further quantizes these group average values, enabling high-quality activation compression with an effective precision of less than 1 bit while providing improved flexibility in bit allocation. Additionally, ALAM incorporates a cost-efficient sensitivity calculation algorithm based solely on the L2 norm of parameter gradients, substantially reducing the memory overhead typically associated with sensitivity analysis compared to the conventional activation-compressed training algorithm. Through these techniques, ALAM achieves up to a 10 times reduction in activation memory in large language models (LLMs) such as LLaMA-30B while maintaining comparable accuracy.
Third, Dropping Backward Propagation (DropBP) is proposed, a method aimed at reducing both computational costs and activation memory during training while maintaining accuracy. DropBP achieves this by randomly dropping layers during backward propagation, thereby reducing the floating-point operations (FLOPs) and activation memory associated with the dropped layers. Intuitively, DropBP can be understood as training shallow submodules consisting of undropped layers and skip connections. We found that these smaller submodules have a significant impact on gradients, enabling effective training of the entire deep neural network by focusing only on training these shallow submodules. Additionally, DropBP incorporates sensitivity-based drop rate allocation for each layer, ensuring stable training. DropBP demonstrates considerable advantages, including a 44% reduction in training time while achieving accuracy comparable to the baseline, a 1.5x faster convergence to the same perplexity, and the capability to train sequence lengths 6.2x larger on a single NVIDIA A100 GPU when fine-tuning large language models (LLMs) such as LLaMA2-70B. Furthermore, DropBP increases throughput by 79% on NVIDIA A100 GPUs and 117% on Intel Gaudi2 HPUs, establishing itself as a versatile and efficient approach for large-scale model training.
Fourth, Partial Connection Adaptation (PaCA) is proposed, a novel PEFT algorithm designed to significantly reduce training time and activation memory compared to existing methods such as Low-Rank Adaptation (LoRA). Previous PEFT algorithms process pretrained weights and adapters sequentially on GPUs, resulting in significant training time overhead. In contrast, PaCA fine-tunes randomly selected partial connections within the pretrained weights, eliminating the sequential processing overhead and accelerating training. Furthermore, by storing only partial activations instead of full activations for gradient computation, PaCA also reduces activation memory. Compared to LoRA, PaCA achieves a 22% reduction in training time and a 16% decrease in total memory usage while maintaining comparable accuracy during fine-tuning on the MMLU dataset and instruction tuning on the Oasst1 dataset. Additionally, PaCA supports quantization, enabling fine-tuning of large models such as LLaMA3.1-70B, facilitates training on sequences 23% longer, and improves throughput by 16% on both NVIDIA A100 and Intel Gaudi2 GPUs, highlighting its efficiency and scalability for large-scale fine-tuning.
All proposed algorithms have been implemented as an easy-to-integrate PyTorch library, allowing seamless integration into existing training codes. These algorithms can be applied to various objectives, such as training large models with limited resources, learning from long sequence data, and increasing training throughput. In addition, as each method is orthogonal, they can be combined to achieve further efficiency. For instance, applying both DropBP and PaCA simultaneously to maximize training speed resulted in a 56% reduction in training time and a 51% reduction in memory usage.