Abstract
RTP (Rotated Tensor Parallelism) is a novel distributed training strategy designed to minimize memory duplication by sharding both activations and parameters across devices. By replacing standard all-gather operations with a ring-based rotation primitive, RTP achieves near-linear memory scalability. This allows for training significantly larger models on existing hardware, outperforming methods like FSDP in memory efficiency while maintaining competitive throughput.
Addressing the Memory Duplication Bottleneck
As neural networks scale to billions of parameters, memory capacity becomes the primary constraint. Traditional distributed training techniques suffer from significant Memory Duplication. In standard Data Parallelism (DP), every GPU maintains a full copy of the model weights. In Tensor Parallelism (TP), while weights are sharded, activations are often duplicated across workers to facilitate computation. Even advanced techniques like Fully Sharded Data Parallelism (FSDP) incur overhead during the reconstruction phase of weights.
RTP aims to bridge the gap between practical systems and an "Unlimited Memory Idealized Computer" by ensuring that no device holds more than its proportional share of weights, gradients, or activations at any point. By sharding all components, RTP avoids the memory spikes that typically lead to Out-of-Memory (OOM) errors.
The RTP Mechanism: Rotation over Reconstruction
The core innovation of RTP is the Rotation Primitive, which replaces global tensor reconstruction with a localized, ring-based exchange.
Rotated Tensor Parallelism (RTP)
Instead of using an All-Gather operation to reconstruct a full weight matrix before computation, RTP shards both weights and activations. During the forward pass, weights are rotated "clockwise" across a ring of workers. Each worker computes a partial result using its current shard, then passes that shard to its neighbor and receives a new one. This process continues until all partial results are computed and aggregated.
Implementation Details
- Flyweight Pattern Initialization: To manage deep learning frameworks like PyTorch, which expect static weight-to-gradient mapping, RTP uses "fake" modules pointing to shared memory addresses. This allows the system to iterate through rotated weights without triggering massive new memory allocations.
- In-place vs. Out-of-place: RTP offers two modes: In-place for maximum memory efficiency (blocking communication to minimize footprint) and Out-of-place for high throughput (overlapping communication with computation using multiple CUDA streams).
- FlatParameter: To minimize the latency penalties associated with many small data transfers, RTP bundles all parameters within a layer (such as weights and biases) into a single one-dimensional "FlatParameter" tensor.
Key Insights and Results
The authors evaluated RTP using several standard Large Language Model (LLM) architectures, including GPT-2 variants (up to 2.7B parameters) and BERT-large, on A100 and V100 GPUs.
- Memory Efficiency: RTP demonstrated memory savings of over 75% compared to FSDP and 85% compared to Data Parallelism for models up to 774M parameters. It successfully accommodated the GPT-XL (1.5B) model on hardware where FSDP hit memory limits.
- Throughput and Scalability: Despite the overhead of rotating shards, RTP's throughput remains competitive. On V100 GPUs using PCIe, RTP outperformed FSDP at larger batch sizes because its overlapping of communication and computation eliminated the wait times inherent in
all-gatheroperations. - Computational Efficiency: RTP reaches approximately 90% of the computational efficiency of FSDP. The slight dip is attributed to "Kernel Launch Overheads" caused by executing many smaller partial-tensor operations instead of a single large one.
- MoE Synergy: RTP is naturally suited for Mixture of Experts (MoE) layers. Traditional MoE requires expensive all-to-all communication; RTP replaces this with its weight-rotating mechanism, improving performance against DP and FSDP.
Limitations and Future Work
RTP's primary challenge is the GPU underutilization that can occur if shards become too small, leading to increased kernel overhead. While highly effective on high-bandwidth interconnects like NVLink, the constant ring rotation may become a bottleneck in high-latency environments. Future research will focus on mitigating kernel overheads and exploring how RTP scales alongside pipeline parallelism in multi-thousand GPU clusters.
Summary updated