RTP: Rethinking Tensor Parallelism with Memory Deduplication

Cheng Luo,Tianle Zhong,Geoffrey Fox
2023-11-03
Abstract:In the evolving landscape of neural network models, one prominent challenge stand out: the significant memory overheads associated with training expansive models. Addressing this challenge, this study delves deep into the Rotated Tensor Parallelism (RTP). RTP is an innovative approach that strategically focuses on memory deduplication in distributed training environments. It boasts of unique features like a customized communication primitive and the Flyweight Pattern initialization. Furthermore, RTP ensures a seamless overlap between partition computation and partition weight communication, optimizing the training process. Our empirical evaluations underscore RTP's efficiency, revealing that its memory consumption during distributed system training is remarkably close to the optimal - distributing the memory overhead of a single machine equitably among multiple machines. The experimental results demonstrate that RTP is capable of achieving comparable performance to Distributed Data Parallel while providing support for significantly larger models with near-linear scalability in terms of memory. Code of RTP is available at <a class="link-external link-https" href="https://github.com/wdlctc/rtp" rel="external noopener nofollow">this https URL</a>.
Distributed, Parallel, and Cluster Computing,Artificial Intelligence,Networking and Internet Architecture
What problem does this paper attempt to address?
The main problem that this paper attempts to solve is the significant memory overhead during the training process of neural network models. As the scale of neural network models continues to increase, the memory resources required to train these large - scale models are also increasing day by day, which has become a major challenge in the distributed training environment. To address this issue, the paper proposes Rotated Tensor Parallelism (RTP) technology, which is a new method focusing on optimizing memory usage through memory deduplication in the distributed training environment. Specifically, RTP reduces memory consumption in the following ways: 1. **Custom - made communication primitives**: A new communication mechanism is designed to transfer data between different devices more efficiently. 2. **Flyweight Pattern Initialization**: Memory occupation is reduced by sharing multiple "virtual" modules with the same memory address. 3. **Seamless overlap of computation and communication**: Ensure that during the forward propagation and backward propagation, computation and communication can be carried out simultaneously, thereby improving the training efficiency. 4. **Memory deduplication**: By strategically slicing and rotating weights/gradients, memory duplication is reduced, especially when dealing with large - scale models. The paper verifies the effectiveness of RTP through experiments, indicating that its memory consumption in distributed system training is close to the optimal level, can support significantly larger models, and has nearly linear memory scalability. In addition, RTP is comparable to Distributed Data Parallel (DDP) in performance, but shows obvious advantages in terms of memory usage.