Parallel Training of GRU Networks with a Multi-Grid Solver for Long Sequences

Gordon Euhyun Moon, Eric C. Cyr · DOI

Introduction

Recurrent Neural Networks (RNNs), and specifically Gated Recurrent Units (GRUs), have long been the standard for processing sequential data. However, they suffer from a fundamental computational limitation: the sequential bottleneck. Because the hidden state at any given time step $t$ depends directly on the state at $t-1$, the training process is inherently serial. As datasets involve increasingly long sequences—such as high-resolution video or high-frequency sensor data—this linear scaling of training time becomes a massive barrier to research and deployment.

This paper presents a novel approach to break this bottleneck by applying "parallel-in-time" (PinT) methods to GRU training. By combining a multigrid solver with a newly formulated "Implicit GRU," the authors achieve significant speedups without compromising the model's predictive accuracy.

The Challenge of Parallel-in-Time Training

While data parallelism (distributing batches) and model parallelism (distributing layers) are common in deep learning, they do not address the temporal dependency within a single sequence. Previous attempts to use PinT methods—which attempt to solve multiple time steps simultaneously—often failed in the context of deep learning. These failures typically stem from numerical instability; when a sequence is downsampled to a "coarse" grid to speed up calculations, the long-term dependencies often become unstable, leading to gradient explosion or divergence.

Methodology: MGRIT and the Implicit GRU

The researchers address these challenges using a technique from numerical analysis known as Multigrid Reduction in Time (MGRIT). Their approach rests on two primary innovations:

1. The MGRIT Framework

Instead of processing a sequence from start to finish, MGRIT partitions the timeline into shorter sub-sequences distributed across different processors. To maintain global consistency, the algorithm uses a hierarchy of grids. It performs detailed, computationally expensive work on the "fine grid" (the full sequence) in parallel, then uses a "coarse grid" (a simplified, downsampled version of the sequence) to quickly propagate corrections across the entire timeline. This allows the processors to stay "in sync" regarding the global state of the sequence.

2. The Implicit GRU Formulation

The paper’s most critical innovation is the re-formulation of the GRU as an Ordinary Differential Equation (ODE). Standard GRUs behave like "explicit" solvers, which are notoriously unstable when taking the large time steps required by a coarse multigrid. To solve this, the authors developed an Implicit GRU based on a backward Euler discretization. This formulation is mathematically stable even with large time steps, providing the numerical robustness necessary for the MGRIT solver to function effectively.

Experimental Setup

The proposed method was evaluated on two distinct benchmarks:

  • UCI-HAR: A dataset of human activity recognition using smartphone accelerometer data, featuring sequences of length 128.
  • HMDB51: A large-scale video dataset for human motion classification. To manage the high-dimensional video data, the authors used pre-trained ResNet models (ResNet18, 34, and 50) to extract features, which were then processed by the GRU as sequences of length 128.

The implementation utilized a combination of C++ (via the XBraid library), PyTorch, and MPI/OpenMP, running on CPU clusters.

Key Results and Insights

Performance and Scaling

On the HMDB51 dataset, the parallel-in-time approach achieved a 6.5x speedup over traditional serial training when utilizing 32 MPI ranks (288 CPU cores). Interestingly, the efficiency of this parallel strategy improves as the sequence length increases, making it a specialized tool for the exact scenarios where standard GRUs struggle most.

Accuracy Preservation

Despite the introduction of the Implicit GRU and the multigrid approximation, accuracy remained high. The Implicit GRU trained in parallel achieved approximately 90% accuracy on UCI-HAR and 65% accuracy on HMDB51, matching the performance of the standard serial "Classic GRU."

Training Efficiency

The authors discovered that a perfectly accurate forward pass is not required at every training iteration. They found that using just two MGRIT iterations for the forward pass and one for the backward pass provided sufficient accuracy for the weights to converge, further reducing the computational overhead.

Limitations and Future Directions

While the results are promising, several hurdles remain for widespread adoption:

  • Hardware Implementation: The current work is CPU-centric. Given that most modern deep learning occurs on GPUs, porting the MGRIT/Implicit GRU framework to GPU architectures is a critical next step.
  • Architectural Specificity: The "Implicit" formulation was specifically derived for GRUs. Extending this logic to LSTMs or other complex gated architectures would require new mathematical derivations.
  • Communication Diminishing Returns: As with all parallel algorithms, there is a point where the time spent on inter-processor communication outweighs the gains in computation speed. This was observed when scaling beyond 32 MPI ranks for the sequence lengths tested.

Conclusion

By identifying "stiffness" in GRU dynamics as the primary barrier to parallelization and solving it through an Implicit ODE formulation, this research provides a viable path for training recurrent models on extremely long sequences. The 6.5x speedup demonstrates that the temporal bottleneck in RNNs is not insurmountable, opening new possibilities for high-resolution temporal data analysis.

Summary updated

BibTeX
@inproceedings{moon2022parallel,
  author = {Gordon Euhyun Moon and Eric C. Cyr},
  title = {{Parallel Training of GRU Networks with a Multi-Grid Solver for Long Sequences}},
  booktitle = {International Conference on Learning Representations},
  year = {2022},
  url = {https://openreview.net/forum?id=N1WI0vJLER},
}
Figure