Skip to main content
QUICK REVIEW

[Paper Review] High-Performance Deep Learning via a Single Building Block

Evangelos Georganas, Kunal Banerjee|arXiv (Cornell University)|Jun 15, 2019
Advanced Neural Network ApplicationsComputer Science40 references7 citations
TL;DR

This paper introduces the batch-reduce GEMM kernel as a universal building block for high-performance deep learning workloads, enabling efficient implementation of RNNs, CNNs, and MLPs with just 3,000 lines of high-level code. By optimizing this single kernel, the authors achieve performance exceeding vendor-optimized libraries on CPUs and match or surpass auto-tuned GPU kernels, demonstrating a scalable, maintainable alternative to specialized low-level kernels.

ABSTRACT

Deep learning (DL) is one of the most prominent branches of machine learning. Due to the immense computational cost of DL workloads, industry and academia have developed DL libraries with highly-specialized kernels for each workload/architecture, leading to numerous, complex code-bases that strive for performance, yet they are hard to maintain and do not generalize. In this work, we introduce the batch-reduce GEMM kernel and show how the most popular DL algorithms can be formulated with this kernel as the basic building-block. Consequently, the DL library-development degenerates to mere (potentially automatic) tuning of loops around this sole optimized kernel. By exploiting our new kernel we implement Recurrent Neural Networks, Convolution Neural Networks and Multilayer Perceptron training and inference primitives in just 3K lines of high-level code. Our primitives outperform vendor-optimized libraries on multi-node CPU clusters, and we also provide proof-of-concept CNN kernels targeting GPUs. Finally, we demonstrate that the batch-reduce GEMM kernel within a tensor compiler yields high-performance CNN primitives, further amplifying the viability of our approach.

Motivation & Objective

  • To address the combinatorial explosion of low-level kernel optimizations required for diverse deep learning workloads across multiple architectures.
  • To reduce the complexity of deep learning library development by unifying all major DL primitives under a single, highly optimized kernel.
  • To enable high performance across training and inference for RNNs, CNNs, and MLPs using only loop tuning around a single optimized kernel.
  • To demonstrate that a single, well-optimized kernel can outperform hand-tuned, vendor-optimized implementations on CPUs and GPUs.
  • To enable performance-portable deep learning primitives through integration with tensor compilers like TVM.

Proposed method

  • Propose the batch-reduce GEMM kernel, which multiplies a batch of input sub-tensor blocks and reduces partial results into a single output sub-tensor block.
  • Formulate all major deep learning primitives—RNN/LSTM, CNN, and MLP—as compositions of this single kernel, abstracting away low-level complexity.
  • Optimize the batch-reduce GEMM kernel for CPU and GPU architectures with fine-grained memory access, prefetching, and data layout transformations.
  • Implement DL primitives in 3,000 lines of high-level code, relying solely on loop tuning around the optimized kernel.
  • Integrate the kernel into distributed training frameworks (e.g., for GNMT and ResNet-50) and demonstrate scalability across multi-node clusters.
  • Prototype CNN kernels in the TVM tensor compiler using the batch-reduce GEMM kernel, achieving performance comparable to auto-tuned primitives.

Experimental results

Research questions

  • RQ1Can a single, highly optimized kernel replace the need for hundreds of specialized, hand-tuned kernels across different deep learning workloads and architectures?
  • RQ2To what extent can performance portability and maintainability in deep learning libraries be improved by abstracting all primitives around one kernel?
  • RQ3Can a unified kernel approach outperform vendor-optimized, ad hoc implementations in both CPU and GPU workloads?
  • RQ4How effective is the batch-reduce GEMM kernel in enabling high-performance inference and training in distributed, multi-node environments?
  • RQ5Can tensor compilers leverage this kernel to achieve performance on par with auto-tuned, vendor-optimized primitives?

Key findings

  • The batch-reduce GEMM kernel achieves 83% of peak performance on a Xeon Skylake-SP CPU, outperforming generic GEMM-based approaches (61% and 49%) and matching vendor-optimized mkl-dnn (81%) with 2% higher efficiency.
  • The authors' CNN primitive based on the batch-reduce GEMM kernel outperforms the vendor-optimized mkl-dnn library by 1.24× on CPUs and 1.4× on multi-node clusters.
  • On integrated GPUs, the kernel achieves performance comparable to vendor-provided CNN kernels, demonstrating architectural agnosticism.
  • The end-to-end training of GNMT and ResNet-50 on multi-node CPU clusters exceeds the performance of vendor-optimized libraries by up to 2.3×.
  • In a TVM-based prototype, the batch-reduce GEMM kernel enables CNN primitives that match the performance of auto-tuned, Amazon-AutoTVM-optimized code.
  • The entire DL library implementation requires only 3,000 lines of high-level code, significantly reducing codebase complexity compared to existing libraries with tens of thousands of lines.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.