Abstract
Scaling CNN training is necessary to keep up with growing datasets and reduce training time. We also see an emerging need to handle datasets with very large samples, where memory requirements for training are large. Existing training frameworks use a data-parallel approach that partitions samples within a mini-batch, but limits to scaling the mini-batch size and memory consumption makes this untenable for large samples. We describe and implement new approaches to convolution, which parallelize using spatial decomposition or a combination of sample and spatial decomposition. This introduces many performance knobs for a network, so we develop a performance model for CNNs and present a method for using it to automatically determine efficient parallelization strategies. We evaluate our algorithms with microbenchmarks and image classification with ResNet-50. Our algorithms allow us to prototype a model for a mesh-tangling dataset, where sample sizes are very large. We show that our parallelization achieves excellent strong and weak scaling and enables training for previously unreachable datasets.
Introduction
Standard deep learning frameworks rely almost exclusively on data-parallelism (or "sample parallelism"), where different GPUs process different images from a mini-batch. However, this approach faces two major hurdles: the "Memory Wall" and "Strong-Scaling Limits". Emerging datasets in fields like medical imaging, satellite surveillance, and scientific simulations involve very large samples that can exceed the memory capacity of a single high-end GPU. Furthermore, increasing the number of GPUs in data-parallelism typically requires increasing the mini-batch size, which can lead to poor model generalization. If the mini-batch size is fixed to maintain convergence properties (strong-scaling), researchers eventually run out of samples to distribute across a large cluster.
Hybrid Parallelization Strategy
To address these limitations, we implement spatial parallelism and integrate it into a hybrid strategy. Instead of assigning one whole image to one GPU, spatial decomposition partitions the image into a grid of tiles, with each GPU processing a specific tile.
Because convolution kernels (e.g., a 3x3 filter) need to access neighboring pixels, GPUs must exchange boundary data—known as a "halo"—with their neighbors. This hybrid approach allows for simultaneous partitioning of the mini-batch (sample parallelism) and the images themselves (spatial parallelism). To manage the complexity of these parallelization "knobs," we developed an analytic performance model that combines empirical compute times with communication cost models to automatically find the most efficient strategy for any given network architecture.
Evaluation and Results
We evaluated our approach using ImageNet-1K (ResNet-50) and a specialized Mesh-Tangling dataset featuring high-resolution images: a 1K version (1024x1024) and a 2K version (2048x2048). Spatial parallelism proved to be a memory necessity for the 2K version, which was previously too large for standard data-parallel training on many GPUs.
Our results demonstrate that spatial parallelism enables strong-scaling even with small mini-batch sizes. For ResNet-50, we achieved 1.4x to 1.8x speedups over pure sample parallelism. On the Mesh-Tangling (1K) dataset, we observed a 6.1x speedup when using 16 GPUs per sample compared to the baseline. Most significantly, we successfully trained the 2048x2048 model, achieving excellent scaling up to 2048 GPUs, proving the approach works at a massive scale.
Conclusion and Future Work
By exploiting finer-grained spatial parallelism, we break the memory and scaling barriers inherent in traditional data-parallel CNN training. This approach not only speeds up training but also enables the use of high-resolution datasets that were previously unreachable. Future work will explore additional parallelization dimensions, such as channel and filter decomposition, and investigate the impact of spatial partitioning on Batch Normalization convergence.
Summary updated