New Optimizations To Accelerate Deep Learning Training on NVIDIA GPUs

The pace of AI adoption across diverse industries depends on maximizing data scientists’ productivity. NVIDIA releases optimized NGC containers every month with…

Michael Carilli
11 min readadvanced
--
View Original

Overview

NVIDIA has introduced new optimizations in its NGC containers to enhance deep learning training performance on NVIDIA GPUs. These improvements are particularly focused on frameworks like MXNet, TensorFlow, and PyTorch, enabling significant speedups and better resource utilization for data scientists.

What You'll Learn

1

How to leverage automatic mixed precision in MXNet for faster training

2

Why using TensorRT can optimize inference performance for deep learning models

3

How to implement the fused Adam optimizer in PyTorch to reduce overhead

4

When to use DALI for GPU-accelerated data pipelines in vision tasks

Prerequisites & Requirements

  • Understanding of deep learning frameworks like MXNet, TensorFlow, and PyTorch
  • Familiarity with NVIDIA GPUs and CUDA programming(optional)

Key Questions Answered

What performance improvements does the latest MXNet release provide?
The latest MXNet release includes optimizations that enhance training performance across various batch sizes, particularly smaller ones. Key improvements include reduced synchronization overhead and the introduction of fused operators, which eliminate unnecessary memory transfers, leading to a throughput of 1060 images/sec when training ResNet-50 with a batch size of 32 on a Tesla V100 GPU.
How does TensorRT improve inference performance in TensorFlow?
TensorRT 5.0.2 integrated into the TensorFlow NGC container allows for optimized inference performance by efficiently executing with low-precision data types and small batch sizes. This is crucial for applications requiring low latencies, enabling data scientists to deploy models more effectively.
What are the benefits of using DALI for data pipelines?
DALI accelerates data input and augmentation pipelines by shifting processing from the CPU to the GPU, which reduces idle GPU time. This is particularly beneficial for vision tasks like classification and object detection, where data preparation can become a bottleneck.
What optimizations have been made in cuDNN 7.4.1?
cuDNN 7.4.1 introduces significant performance improvements for NHWC data layouts and persistent RNN data gradient calculations. These enhancements allow for more efficient memory access and can lead to performance increases of over 20% when training certain networks.

Key Statistics & Figures

Throughput for ResNet-50 training
1060 images/sec
Achieved using the 18.11 MXNet container on a single Tesla V100 GPU with a batch size of 32.
Speedup from using automatic mixed precision
3x faster
This speedup is realized by utilizing Tensor Cores with minimal code changes in MXNet.
Performance increase with cuDNN's new NHWC support
over 20%
This improvement is noted when training the SSD network with a ResNet-34 backbone on a DGX-1V with 8 Tesla V100 GPUs.

Technologies & Tools

Some links below are affiliate links. We may earn a commission if you make a purchase.

Cloud Platform
Nvidia GPU Cloud (ngc)
Provides optimized deep learning framework containers and pre-trained models.
Deep Learning Framework
Mxnet
Framework optimized for training deep learning models with new performance enhancements.
Deep Learning Framework
Tensorflow
Framework that includes TensorRT for optimized inference performance.
Deep Learning Framework
Pytorch
Framework enhanced with NVIDIA's Apex for improved training performance.
Performance Library
Cudnn
Library providing performance improvements for deep learning operations.
Data Processing Library
Dali
Library for GPU-accelerated data input and augmentation pipelines.

Key Actionable Insights

1
Utilize automatic mixed precision in MXNet to achieve faster training times with minimal code changes.
By adding just one or two lines of code, data scientists can leverage Tensor Cores for a 3x speedup in training performance, making it a valuable optimization for large-scale model training.
2
Integrate TensorRT into your TensorFlow workflow to enhance inference performance.
This integration allows for optimized execution with low-precision data types, which is essential for applications requiring quick response times, particularly in production environments.
3
Adopt DALI for your data pipelines to minimize CPU bottlenecks during model training.
By offloading data processing to the GPU, DALI can significantly reduce idle GPU time, ensuring that your training processes run more efficiently, especially when working with large datasets.
4
Implement the fused Adam optimizer in PyTorch to streamline training processes.
This optimized version reduces redundant memory transfers, which is particularly beneficial when scaling training across multiple GPUs, leading to improved performance metrics.

Common Pitfalls

1
Failing to optimize data pipelines can lead to significant idle GPU time during training.
This often happens when the CPU cannot keep up with the data processing needs of multiple GPUs. To avoid this, consider using DALI to offload data processing to the GPU.
2
Not utilizing mixed precision can result in slower training times.
Many users overlook the benefits of automatic mixed precision, which can drastically improve training speed with minimal code changes. Implementing this can provide a significant competitive edge.

Related Concepts

Deep Learning Optimization Techniques
Performance Tuning For Nvidia Gpus
Mixed Precision Training
Data Augmentation Strategies