V-Net is a convolutional neural network for 3D image segmentation.
The performance measurements in this document were conducted at the time of publication and may not reflect the performance achieved from NVIDIA's latest software release. For the most up-to-date performance measurements, go to NVIDIA Data Center Deep Learning Product Performance.
Benchmarking
Starting from CuDNN 7.6.2, enhanced support for 3D convolutions in mixed precision has been introduced to our containers. This enhanced support accelerates even further both training and inference, while maintaining the reduction of the model's memory footprint characteristic of mixed precision training.


In the two figures above, it's displayed the difference in throughput for P100 and V100 GPUs when training V-Net in a single and multi-GPU setup. We do this for different batch sizes. For both single and multi-GPU, training V-Net using mixed precision in Volta GPUs (V100) is at least 2x faster than in Pascal (P100).

The figure above displays the difference in throughput for P100 and V100 GPUs when performing inference using V-Net. We do this for different batch sizes. In general, V-Net inference when using mixed precision in Volta GPUs (V100) is at least 2x faster than in Pascal (P100).
The following section shows how to run benchmarks measuring the model performance in training and inference modes.
Training performance benchmark
To benchmark training, run the script vnet_benchmark.py in the ./examples directory.
usage: vnet_benchmark.py [-h]
--data_dir DATA_DIR
--model_dir MODEL_DIR
--mode train
--gpus {1, 8}
--batch_size BATCH_SIZE
OPTIONAL [--amp]
This script will by default run 200 warm-up iterations and benchmark the performance during training in the next 200 iterations.
Inference performance benchmark
To benchmark inference, run the script vnet_benchmark.py in the ./examples directory.
usage: vnet_benchmark.py [-h]
--data_dir DATA_DIR
--model_dir MODEL_DIR
--mode predict
--gpus {1, 8}
--batch_size BATCH_SIZE
OPTIONAL [--amp]
This script will by default run 200 warm-up iterations and benchmark the performance during inference in the next 200 iterations.
Results
The following sections provide details on how we achieved our performance and accuracy in training and inference.
Training accuracy results
Dataset is divided on training data (samples with ground truth) and test data (unlabelled). In order to obtain instant feedback on the quality of the model, test data is put aside and training and evaluation is performed on the original training set.
For training, 90% of the traning data is used, while for validation it is used the remaining 10%, which is treated as validation data. This validation data remains unseen during training and it is used exclusively to calculate the final accuracy of the model.
Training accuracy: NVIDIA DGX-1 (8x V100 16GB)
Our results were obtained by running the ./examples/vnet_train_and_evaluate.py script in the nvcr.io/nvidia/tensorflow:20.06-tf1-py3 NGC container on NVIDIA DGX-1 with 8x V100 16GB GPUs.
To train until convergence in FP32 using 1GPU, run:
python examples/vnet_train_and_evaluate.py --gpus 1 --batch_size 2 --base_lr 0.0001 --epochs 80 --data_dir ./data/Task04_Hippocampus/ --model_dir /tmp
To train until convergence in FP32 using 8GPU, run:
python examples/vnet_train_and_evaluate.py --gpus 8 --batch_size 2 --base_lr 0.0001 --epochs 320 --data_dir ./data/Task04_Hippocampus/ --model_dir /tmp
To train until convergence in FP16 using 1GPU, run:
python examples/vnet_train_and_evaluate.py --gpus 1 --batch_size 2 --base_lr 0.0001 --epochs 80 --data_dir ./data/Task04_Hippocampus/ --model_dir /tmp --amp
To train until convergence in FP16 using 8GPU, run:
python examples/vnet_train_and_evaluate.py --gpus 8 --batch_size 2 --base_lr 0.0001 --epochs 320 --data_dir ./data/Task04_Hippocampus/ --model_dir /tmp --amp
| GPUs | Batch size / GPU | Anterior dice - FP32 | Anterior dice - mixed precision | Time to train - FP32 | Time to train - mixed precision | Time to train speedup (FP32 to mixed precision) |
|---|---|---|---|---|---|---|
| 1 | 2 | 0.8537 | 0.8533 | 11 min | 11 min | 1.0 |
| 8 | 2 | 0.8409 | 0.8398 | 2 min | 2 min | 1.0 |
To achieve these same results, follow the steps in the Quick Start Guide.
Training performance results
Training performance: NVIDIA DGX-1 (8x V100 16GB)
Our results were obtained by running the ./examples/vnet_benchmark.py scripts in the nvcr.io/nvidia/tensorflow:20.06-tf1-py3 NGC container on NVIDIA DGX-1 with 8x V100 16GB GPUs. Performance numbers (in images per second) were averaged over 200 iterations.
For example:
python examples/vnet_benchmark.py --data_dir ./data/Task04_Hippocampus --model_dir /tmp --mode train --gpus {1,8} --batch_size {8,16,32} [--amp]
| GPUs | Batch size / GPU | Throughput - FP32 | Throughput - mixed precision | Throughput speedup (FP32 - mixed precision) | Weak scaling - FP32 | Weak scaling - mixed precision |
|---|---|---|---|---|---|---|
| 1 | 2 | 117.82 | 114.11 | 0.97 | N/A | N/A |
| 1 | 8 | 277.46 | 368.93 | 1.33 | N/A | N/A |
| 1 | 16 | 339.56 | 427.02 | 1.26 | N/A | N/A |
| 1 | 32 | 444.98 | 639.03 | 1.44 | N/A | N/A |
| 8 | 2 | 584.23 | 497.05 | 0.85 | 4.96 | 4.36 |
| 8 | 8 | 1783.44 | 1851.75 | 1.04 | 6.43 | 5.02 |
| 8 | 16 | 2342.51 | 2821.20 | 1.20 | 6.90 | 6.61 |
| 8 | 32 | 3189.86 | 4282.41 | 1.34 | 7.17 | 6.70 |
To achieve these same results, follow the Quick start guide outlined above.
Inference performance results
Inference performance: NVIDIA DGX-1 (1x V100 16GB)
Our results were obtained by running the ./examples/vnet_benchmark.py scripts in the nvcr.io/nvidia/tensorflow:20.06-tf1-py3 NGC container on NVIDIA DGX-1 with 1x V100 16GB GPUs.
For example:
python examples/vnet_benchmark.py --data_dir ./data/Task04_Hippocampus --model_dir /tmp --mode predict --gpus 1 --batch_size {8, 16, 32} [--amp]
FP16
| Batch size | Sequence length | Throughput Avg | Latency Avg | Latency 90% | Latency 95% | Latency 99% |
|---|---|---|---|---|---|---|
| 8 | 32x32x32x1 | 1428.89 | 6.59 | 8.25 | 8.57 | 9.19 |
| 16 | 32x32x32x1 | 2010.71 | 10.23 | 14.04 | 14.77 | 16.20 |
| 32 | 32x32x32x1 | 3053.85 | 16.36 | 26.08 | 27.94 | 31.58 |
FP32
| Batch size | Sequence length | Throughput Avg | Latency Avg | Latency 90% | Latency 95% | Latency 99% |
|---|---|---|---|---|---|---|
| 8 | 32x32x32x1 | 1009.75 | 8.89 | 10.53 | 10.84 | 11.45 |
| 16 | 32x32x32x1 | 1262.54 | 14.92 | 18.71 | 19.43 | 20.85 |
| 32 | 32x32x32x1 | 1496.08 | 27.32 | 37.27 | 39.17 | 42.90 |
To achieve these same results, follow the steps in the Quick Start Guide.