[Paper Review] maxDNN: An Efficient Convolution Kernel for Deep Learning with Maxwell GPUs
maxDNN is a highly efficient convolution kernel for NVIDIA Maxwell GPUs that combines the memory access patterns of cuda-convnet2 with low-level assembly optimizations from Maxas SGEMM, achieving 96.3% computational efficiency on Overfeat and up to 95.5% on AlexNet v.2 by leveraging 128-bit texture loads, double buffering, and shared memory tiling. The kernel demonstrates that hand-optimized assembly can rival the performance of highly tuned BLAS kernels in deep learning workloads.
This paper describes maxDNN, a computationally efficient convolution kernel for deep learning with the NVIDIA Maxwell GPU. maxDNN reaches 96.3% computational efficiency on typical deep learning network architectures. The design combines ideas from cuda-convnet2 with the Maxas SGEMM assembly code. We only address forward propagation (FPROP) operation of the network, but we believe that the same techniques used here will be effective for backward propagation (BPROP) as well.
Motivation & Objective
- To develop a highly efficient convolution kernel for deep learning on NVIDIA Maxwell GPUs, addressing the gap in computational efficiency despite high peak throughput.
- To demonstrate that low-level assembly optimization, as used in Maxas SGEMM, can be effectively applied to convolution kernels to achieve near-peak performance.
- To show that computational efficiency—measured as FLOPs per clock—can be significantly improved over existing libraries like cuDNN, especially for diverse network architectures.
- To provide a proof of concept that similar optimization techniques can be extended to backward propagation (BPROP) in CNNs.
Proposed method
- maxDNN reuses the Maxas SGEMM64 kernel as a base and modifies it to perform convolution by treating each output map coordinate as a matrix multiply between input patches and filter weights.
- It employs 128-bit texture loads to reduce indexing overhead and increase maximum array size, while also improving memory coalescing and hiding global memory latency.
- Double buffering of global and shared memory loads is used to hide memory latency, reducing the need for warp synchronizations and improving occupancy.
- Shared memory is used to reorganize output values, enabling coalesced global memory writes and zero-initializing registers via 128-bit shared memory loads.
- The kernel uses 8-column tiling per iteration, with 8x8 register blocking, and operates on 64x64 shared memory tiles to maximize computational intensity.
- Computational efficiency is redefined to credit only the FLOPs strictly required by the direct convolution algorithm, excluding redundant operations.
Experimental results
Research questions
- RQ1Can low-level assembly optimization techniques used in SGEMM be effectively transferred to convolution kernels to achieve high computational efficiency on Maxwell GPUs?
- RQ2Why does cuDNN exhibit high variance in computational efficiency across different layers of the same network, and can this be mitigated with custom-tuned kernels?
- RQ3To what extent does computational efficiency depend on alignment with shared memory blocking sizes and filter dimensions?
- RQ4Can the same optimization strategies used in forward propagation be extended to backward propagation in CNNs?
- RQ5What is the impact of non-multiples of tile size (e.g., 64) on computational efficiency, and how can it be minimized?
Key findings
- maxDNN achieves 96.3% computational efficiency on the Overfeat network, significantly outperforming cuDNN’s 39.6% to 74.0% range across layers.
- On AlexNet v.2, maxDNN achieves 93.4% to 95.5% efficiency, compared to cuDNN’s 32.5% to 57.6% efficiency, demonstrating consistent high performance.
- The first layer of Overfeat shows only 70.3% efficiency due to a filter count (96) that is not a multiple of the 64×64 block size, indicating a sensitivity to alignment.
- The computational efficiency metric is refined to exclude unnecessary FLOPs, revealing that maxDNN’s efficiency is robust when filter and batch sizes align with tile sizes.
- The kernel’s high L2 cache hit rate suggests that device memory bandwidth is not the bottleneck, indicating room for further optimization with alternative block sizes.
- The authors conclude that maxDNN proves that high-efficiency convolution is achievable on Maxwell GPUs through hand-optimized assembly, rivaling even the best SGEMM implementations.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.