TL;DR
This paper introduces an optimized Unified Kernel-Segregated Transpose Convolution algorithm that eliminates redundant zero-padding computations in generative deep learning models without requiring specialized hardware. By dynamically selecting and executing specific sub-kernels at runtime on a per-thread basis, the approach achieves up to a 3.89× speedup on CPUs and 2.03× on GPUs, while saving up to 35 MB of memory in popular Generative Adversarial Networks (GANs).
What Problem Does This Paper Address?
Transpose convolution is a foundational operation in deep learning, widely used in GANs and autoencoders to upsample low-resolution feature maps into high-resolution images. Traditionally, this is done using a "bed-of-nails" approach: inserting rows and columns of zeros into the input feature map before applying a standard convolution.
However, these redundant zeros lead to massive computational inefficiencies, memory bottlenecks, and unnecessary data transfers. While previous algorithmic work attempted to solve this via "kernel segregation"—splitting the main kernel into four smaller sub-kernels to bypass zero-padding—it suffered from a major flaw. It grouped all four sub-kernels into a single thread to execute sequentially. When the output feature map had odd dimensions, this static grouping forced the system to compute extra, useless elements, wasting GPU memory and processing cycles.
Methods
The authors propose a Unified Kernel Segregation approach. Instead of statically grouping and sequentially executing four sub-kernels within a single thread, their algorithm dynamically selects the exact sub-kernel needed for each individual thread at runtime during the kernel launch.
Key algorithmic highlights include:
- Dynamic Sub-Kernel Selection: Uses runtime variables ($r = i\%2$ and $s = j\%2$) to determine the precise sub-kernel dimensions and elements required for a specific output coordinate.
- Padding Reduction: The method inherently reduces the required padding factor by half ($\lfloor P/2 \rfloor$), preventing unnecessary edge convolutions.
- Hardware Agnostic: The optimization happens entirely at the software/algorithmic level, eliminating the need for specialized hardware accelerators like FPGAs or custom systolic arrays.
Datasets
The algorithm was evaluated across standard computer vision benchmarks to ensure its generalizability:
- Flower Dataset: Includes subsets of Sunflower, Tulip, Daisy, Rose, and Dandelion images.
- MSCOCO 2017: A 10% subset of the "Common Objects in Context" dataset.
- PASCAL VOC 2012: Used for both image classification and semantic segmentation tasks.
All images were standardized to a $224 \times 224 \times 3$ format for evaluation.
Key Insights and Ideas
- The "Aha" Moment: Moving from sequential sub-kernel execution within a thread to conditional sub-kernel assignment per thread completely resolves the odd-dimension memory overhead problem on GPUs.
- Memory Independence: The memory savings achieved are entirely independent of the output feature map's structural complexity, making the optimization highly predictable and stable across different datasets.
- Bandwidth Alignment: The authors observed that a $4 \times 4$ kernel size yielded exceptionally high speedups, likely because its data footprint perfectly aligns with standard GPU memory bandwidth architectures, maximizing data transfer efficiency.
Key Results
The proposed unified approach was benchmarked against conventional transpose convolution using an NVIDIA GeForce RTX 2070 GPU and an Intel Xeon CPU:
- Standard Datasets: Achieved an average computational speedup of 2.03× on GPU and 3.89× on CPU.
- GAN Ablation Study: When tested on popular generative architectures (DC-GAN, DiscoGAN, Art-GAN, GP-GAN, and EB-GAN), the algorithm demonstrated an average speedup of 3.5×.
- Memory Efficiency: The implementation delivered massive memory savings for generative models, slashing up to 35 MB of memory overhead in the EB-GAN model.
Limitations and Future Work
Despite the performance gains, the unified approach introduces a minor computational burden: threads must perform additional runtime instructions to identify the correct sub-kernel and map it to the exact output location. This conditional logic slightly limits the ideal 4× theoretical speedup on GPUs.
For future work, the authors suggest extending this unified kernel segregation strategy to:
- Matrix Multiplication Methods: Overcoming the challenge of rearranging elements when multiple threads run in parallel.
- Dilated Convolutions: Applying similar zero-skipping patterns to dilated convolution layers to save memory and eliminate redundant calculations without modifying the underlying kernels.
Summary updated