TensorFlow Release 20.06
The NVIDIA container image of TensorFlow, release 20.06, is available on NGC.
Contents of the TensorFlow container
This container image includes the complete source of the NVIDIA version of TensorFlow in
/opt/tensorflow. It is pre-built and installed as a system Python module.
To achieve optimum TensorFlow performance, for image based training, the container includes a sample script that demonstrates efficient training of convolutional neural networks (CNNs). The sample script may need to be modified to fit your application. The container also includes the following:
- Ubuntu 18.04
20.06-tf2-py3contains Python 3.6
- NVIDIA CUDA 11.0.167 including cuBLAS 11.1.0
- NVIDIA cuDNN 8.0.1
- NVIDIA NCCL 2.7.5 (optimized for NVLink™ )
- OpenMPI 3.1.6
- OpenSeq2Seq at commit a81babd
- Included only in
- Included only in
- TensorRT 7.1.2
- DALI 0.22
- DLProf 0.12.0
- Included only in
- Included only in
- Nsight Compute 2020.1.0.33
- Nsight Systems 2020.2.5.8
- Tensor Core optimized examples: (Included only in
- JupyterLab 1.2.2 including Jupyter-TensorBoard
Release 20.06 is based on NVIDIA CUDA 11.0.167, which requires NVIDIA Driver release 450 or later. However, if you are running on Tesla (for example, T4 or any other Tesla board), you may use NVIDIA driver release 418.xx or 440.30. The CUDA driver's compatibility package only supports particular drivers. For a complete list of supported drivers, see the CUDA Application Compatibility topic. For more information, see CUDA Compatibility and Upgrades.
Release 20.06 supports CUDA compute capability 6.0 and higher. This corresponds to GPUs in the NVIDIA Pascal, Volta, Turing, and Ampere Architecture GPU families. Specifically, for a list of GPUs that this compute capability corresponds to, see CUDA GPUs. For additional support details, see Deep Learning Frameworks Support Matrix.
Key Features and Enhancements
This TensorFlow release includes the following key features and enhancements.
- The latest version of NVIDIA CUDA 11.0.167 including cuBLAS 11.1.0
- The latest version of NVIDIA cuDNN 8.0.1
- The latest version of NVIDIA NCCL 2.7.5
- TensorFlow container image version 20.06 is based on TensorFlow 1.15.2 and TensorFlow 2.2.0.
- The latest version of DALI 0.21.2
- The latest version of DLProf 0.12.0
- The latest version of Nsight Compute 2020.1.0.33
- The latest version of Nsight Systems 2020.2.5.8
- The latest version of TensorRT 7.1.2
- The latest version of Horovod 0.19.1
- The latest version of JupyterLab 1.2.2 including Jupyter-TensorBoard
- Integrated latest NVIDIA Deep Learning SDK to support NVIDIA A100 using CUDA 11 and cuDNN 8
- Improved NVTX annotations for XLA clusters for use with DLProf
- Improved XLA to avoid excessive recompilations
- Enhancements for Automatic Mixed Precision with einsum, 3D Convolutions, and list operations
- Improved 3D Convolutions to support NDHWC format
- Default TF32 support
- Ubuntu 18.04 with May 2020 updates
- Python 2.7 is no longer supported in this TensorFlow container release.
- The TF_ENABLE_AUTO_MIXED_PRECISION environment variables are no longer supported in the tf2 container because it is not possible to automatically enable loss scaling in many cases in the tf 2.x API. Instead tf.train.experimental.enable_mixed_precision_graph_rewrite() should be used to enable AMP.
- Deep learning framework containers 19.11 and later include experimental support for Singularity v3.0.
NVIDIA TensorFlow Container Versions
The following table shows what versions of Ubuntu, CUDA, TensorFlow, and TensorRT are supported in each of the NVIDIA containers for TensorFlow. For older container versions, refer to the Frameworks Support Matrix.
|Container Version||Ubuntu||CUDA Toolkit||TensorFlow||TensorRT|
|NVIDIA CUDA 11.0.167|
|20.03||NVIDIA CUDA 10.2.89||TensorRT 7.0.0|
|19.10||NVIDIA CUDA 10.1.243||1.14.0|
Accelerating Inference In TensorFlow With TensorRT (TF-TRT)
For step-by-step instructions on how to use TF-TRT, see Accelerating Inference In TensorFlow With TensorRT User Guide.
TF1 TF-TRT is infrequently updated. In order to benefit from the latest performance improvements, optimizations and features such as implicit batch mode and dynamic shape support, we recommend using TF2.
- Known Issues
We have observed a regression in the performance of certain TF-TRT benchmarks in TensorFlow 1.15 including image classification models with precision INT8. We are still investigating this. Since 19.11 comes with a new version of TensorFlow (1.15), which includes a lot of changes in the TensorFlow backend, it’s very possible that the regression is caused by a change in the TensorFlow backend.
CUDA 10.2 and NCCL 2.5.x libraries require slightly more device memory than previous releases. As a result, some models that ran previously may exhaust device memory.
The accuracy of Faster RCNN with the backbone ResNet-50 using TensorRT6.0 INT8 calibration is lower than expected. This will be fixed in future releases of TensorRT.
The following warning is issued when the method
build()from the API is not called. This warning can be ignored.
OP_REQUIRES failed at trt_engine_resource_ops.cc:183 : Not found: Container TF-TRT does not exist. (Could not find resource: TF-TRT/TRTEngineOp_...
The following warning is issued because internally TensorFlow calls the TensorRT optimizer for certain objects unnecessarily. This warning can be ignored.
TensorRTOptimizer is probably called on funcdef! This optimizer must *NOT* be called on function objects.
We have seen failures when using INT8 calibration (post-training) within the same process that does FP32/FP16 conversion. We recommend using separate processes for different precisions until this issue gets resolved.
We have seen failures when calling the TensorRT optimizer on models that are already optimized by TensorRT. This issue will be fixed in a future release.
In case you import nets from models/slim, you might see the following error:
AttributeError: module 'tensorflow_core.contrib' has no attribute 'tensorrt'
Changing the order of imports can fix the issue. Therefore, import TensorRT before importing nets as follows:
import tensorflow.contrib.tensorrt as trt import nets.nets_factory
Automatic Mixed Precision (AMP)
Automatic mixed precision converts certain float32 operations to operate in float16 which can run much faster on Tensor Cores. Automatic mixed precision is built on two components:
- a loss scaling optimizer
- graph rewriter
For models already using an optimizer from
tf.keras.optimizers for both
apply_gradients() operations (for example, by calling
model.fit(), automatic mixed precision can be enabled by wrapping the optimizer with
For more information on this function, see the TensorFlow documentation here.
For more information about how to access and enable Automatic mixed precision for TensorFlow, see Automatic Mixed Precision Training In TensorFlow from the TensorFlow User Guide, along with Training With Mixed Precision.
Tensor Core Examples
The tensor core examples provided in GitHub focus on achieving the best performance and convergence by using the latest deep learning example networks and model scripts for training. Each example model trains with mixed precision Tensor Cores on Volta, therefore you can get results much faster than training without tensor cores. This model is tested against each NGC monthly container release to ensure consistent accuracy and performance over time. This container includes the following tensor core examples.
- U-Net Medical model. The U-Net model is a convolutional neural network for 2D image segmentation. This repository contains a U-Net implementation as described in the paper U-Net: Convolutional Networks for Biomedical Image Segmentation, without any alteration. This model script is available on GitHub as well as NVIDIA GPU Cloud (NGC).
- SSD320 v1.2 model. The SSD320 v1.2 model is based on the SSD: Single Shot MultiBox Detector paper, which describes an SSD as “a method for detecting objects in images using a single deep neural network”. Our implementation is based on the existing model from the TensorFlow models repository. This model script is available on GitHub as well as NVIDIA GPU Cloud (NGC).
- Neural Collaborative Filtering (NCF) model. The NCF model is a neural network that provides collaborative filtering based on implicit feedback, specifically, it provides product recommendations based on user and item interactions. The training data for this model should contain a sequence of user ID, item ID pairs indicating that the specified user has interacted with, for example, was given a rating to or clicked on, the specified item. This model script is available on GitHub as well as NVIDIA GPU Cloud (NGC).
- BERT model. BERT, or Bidirectional Encoder Representations from Transformers, is a new method of pre-training language representations which obtains state-of-the-art results on a wide array of Natural Language Processing (NLP) tasks. This model is based on BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding paper. NVIDIA's BERT is an optimized version of Google's official implementation, leveraging mixed precision arithmetic and Tensor Cores on V100 GPUS for faster training times while maintaining target accuracy. This model script is available on GitHub as well as NVIDIA GPU Cloud (NGC).
- U-Net Industrial Defect Segmentation model. This U-Net model is adapted from the original version of the U-Net model which is a convolutional auto-encoder for 2D image segmentation. U-Net was first introduced by Olaf Ronneberger, Philip Fischer, and Thomas Brox in the paper: U-Net: Convolutional Networks for Biomedical Image Segmentation. This work proposes a modified version of U-Net, called TinyUNet which performs efficiently and with very high accuracy on the industrial anomaly dataset DAGM2007. This model script is available on GitHub as well as NVIDIA GPU Cloud (NGC).
- GNMT v2 model. The GNMT v2 model is similar to the one discussed in the Google's Neural Machine Translation System: Bridging the Gap between Human and Machine Translation paper. The most important difference between the two models is in the attention mechanism. In our model, the output from the first LSTM layer of the decoder goes into the attention module, then the re-weighted context is concatenated with inputs to all subsequent LSTM layers in the decoder at the current timestep. This model script is available on GitHub as well as NVIDIA GPU Cloud (NGC).
- ResNet-50 v1.5 model. The ResNet-50 v1.5 model is a modified version of the original ResNet-50 v1 model. The difference between v1 and v1.5 is in the bottleneck blocks which requires downsampling, for example, v1 has stride = 2 in the first 1x1 convolution, whereas v1.5 has stride = 2 in the 3x3 convolution. The following features were implemented in this model; data-parallel multi-GPU training with Horovod, Tensor Cores (mixed precision) training, and static loss scaling for Tensor Cores (mixed precision) training. This model script is available on GitHub as well as NVIDIA GPU Cloud (NGC).
There is a known performance regression of 10 to 30% compared to the 20.03 release when training the JoC V-Net Medical and U-Net Industrial models with small batch size on V100. This will be addressed in a future release.
An out-of-memory condition can occur in TensorFlow (TF1) 20.06 for some models (such as ResNet-50, and ResNext) when Horovod and XLA are both in use. In XLA, we added an optimization that skips compiling a cluster the very first time it is executed, which can help avoid unnecessary recompilations for models with dynamic shapes. On the other hand, for models like ResNet-50, the preferred compilation strategy is to aggressively compile clusters, as compiled clusters are executed many times. Per the "XLA Best Practices" section of the TensorFlow User Guide, running XLA with the following environment variable opts in to that strategy:
- NCF depends on CuPy and will not work until a CuPy release supporting CUDA 11 is available.
- There is an issue that causes the error "
failed call to cuInit: CUDA_ERROR_UNKNOWN: unknown error" in certain cases on NVIDIA A100/GA100 GPUs. The workaround is to start the container and then use the following:
$ dpkg -l '*nccl*' $ dpkg -r libnccl-dev_2.7.5 libnccl2_2.5;# remove current nccl libs $ apt-get update $ apt-get install build-essential devscripts debhelper -y $ git clone https://github.com/NVIDIA/nccl.git $ cd nccl $ git fetch $ git checkout v2.7.6-1 $ make -j src.build pkg.debian.build $ dpkg -i build/pkg/deb/libnccl-dev_2.7.6-1+cuda11.0_amd64.deb $ dpkg -i build/pkg/deb/libnccl2_2.7.6-1+cuda11.0_amd64.deb