NVIDIA Deep Learning Examples
NVIDIA Deep Learning Examples
SSD v1.1 for PyTorch
Resource
NVIDIA Deep Learning Examples
NVIDIA Deep Learning Examples
SSD v1.1 for PyTorch

With a ResNet-50 backbone and a number of architectural modifications, this version provides better accuracy and performance.

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

The following section shows how to run benchmarks measuring the model performance in training and inference modes.

Training performance benchmark

The training benchmark was run in various scenarios on A100 80GB and V100 16G GPUs. The benchmark does not require a checkpoint from a fully trained model.

To benchmark training, run:

torchrun --nproc_per_node={NGPU} \
       main.py --batch-size {bs} \
               --mode benchmark-training \
               --benchmark-warmup 100 \
               --benchmark-iterations 200 \
               {AMP} \
               --data {data}

Where the {NGPU} selects number of GPUs used in benchmark, the {bs} is the desired batch size, the {AMP} is set to --amp if you want to benchmark training with Tensor Cores, and the {data} is the location of the COCO 2017 dataset.

--benchmark-warmup is specified to omit the first iteration of the first epoch. --benchmark-iterations is a number of iterations used to measure performance.

Inference performance benchmark

Inference benchmark was run on 1x A100 80GB GPU and 1x V100 16G GPU. To benchmark inference, run:

python main.py --eval-batch-size {bs} \
               --mode benchmark-inference \
               --benchmark-warmup 100 \
               --benchmark-iterations 200 \
               {AMP} \
               --data {data}

Where the {bs} is the desired batch size, the {AMP} is set to --amp if you want to benchmark inference with Tensor Cores, and the {data} is the location of the COCO 2017 dataset.

--benchmark-warmup is specified to omit the first iterations of the first epoch. --benchmark-iterations is a number of iterations used to measure performance.

Results

The following sections provide details on how we achieved our performance and accuracy in training and inference.

Training accuracy results

Training accuracy: NVIDIA DGX A100 (8x A100 80GB)

Our results were obtained by running the ./examples/SSD300_A100_{FP16,TF32}_{1,4,8}GPU.sh script in the pytorch-22.10-py3 NGC container on NVIDIA DGX A100 (8x A100 80GB) GPUs.

GPUsBatch size / GPUAccuracy - TF32Accuracy - mixed precisionTime to train - TF32Time to train - mixed precisionTime to train speedup (TF32 to mixed precision)
1640.2710.27203:19:5903:18:35100%
4640.2700.27000:51:2200:51:3199%
8640.2700.26900:26:1000:26:1099%
11280.2740.27103:03:5603:03:50100%
41280.2720.27000:46:5100:47:0199%
81280.2670.26700:23:4400:23:4699%
12560.2720.27202:56:3702:56:4499%
42560.2710.26700:45:0500:45:0799%
82560.2600.25800:22:4900:22:56100%
Training accuracy: NVIDIA DGX-1 (8x V100 16GB)

Our results were obtained by running the ./examples/SSD300_FP{16,32}_{1,4,8}GPU.sh script in the pytorch-22.10-py3 NGC container on NVIDIA DGX-1 with 8x V100 16GB GPUs.

GPUsBatch size / GPUAccuracy - FP32Accuracy - mixed precisionTime to train - FP32Time to train - mixed precisionTime to train speedup (FP32 to mixed precision)
1320.2690.27120:04:4807:25:27270%
4320.2700.26905:08:5601:58:41260%
8320.2710.26902:35:0001:00:27256%
164<N/A>0.272<N/A>06:47:58<N/A>
464<N/A>0.270<N/A>01:46:34<N/A>
864<N/A>0.269<N/A>00:53:52<N/A>

Due to smaller size, mixed precision models can be trained with bigger batches. In such cases mixed precision speedup is calculated versus FP32 training with maximum batch size for that precision

Training loss plot

Here are example graphs of FP32, TF32 and AMP training on 8 GPU configuration:

TrainingLoss

Training stability test

The SSD300 v1.1 model was trained for 65 epochs, starting from 15 different initial random seeds. The training was performed in the pytorch-22.10-py3 NGC container on NVIDIA DGX A100 8x A100 80GB GPUs with batch size per GPU = 128. After training, the models were evaluated on the test dataset. The following table summarizes the final mAP on the test set.

PrecisionAverage mAPStandard deviationMinimumMaximumMedian
AMP0.26795030390.0013604940120.262010.270130.26529
TF320.26706918230.0016393941020.261810.272740.26492

Training performance results

Training performance: NVIDIA DGX A100 (8x A100 80GB)

Our results were obtained by running the main.py script with the --mode benchmark-training flag in the pytorch-22.10-py3 NGC container on NVIDIA DGX A100 (8x A100 80GB) GPUs. Performance numbers (in items/images per second) were averaged over an entire training epoch.

GPUsBatch size / GPUThroughput - TF32Throughput - mixed precisionThroughput speedup (TF32 - mixed precision)Weak scaling - TF32Weak scaling - mixed precision
164364.27662.91181%100%100%
4641432.732581.24180%393%389%
8642838.765252.84185%779%792%
1128377.18724.41192%100%100%
41281493.132885.55193%395%398%
81282967.235733.98193%786%791%

To achieve these same results, follow the Quick Start Guide outlined above.

Training performance: NVIDIA DGX-1 (8x V100 16GB)

Our results were obtained by running the main.py script with the --mode benchmark-training flag in the pytorch-22.10-py3 NGC container on NVIDIA DGX-1 with 8x V100 16GB GPUs. Performance numbers (in items/images per second) were averaged over an entire training epoch.

GPUsBatch size / GPUThroughput - FP32Throughput - mixed precisionThroughput speedup (FP32 - mixed precision)Weak scaling - FP32Weak scaling - mixed precision
132107.22296.80276%100%100%
432419.541115.59265%391%375%
832840.352153.96256%783%725%
164<N/A>322.81<N/A><N/A>100%
464<N/A>1238.27<N/A><N/A>383%
864<N/A>2520.50<N/A><N/A>780%

Due to smaller size, mixed precision models can be trained with bigger batches. In such cases mixed precision speedup is calculated versus FP32 training with maximum batch size for that precision

To achieve these same results, follow the Quick Start Guide outlined above.

Inference performance results

Inference performance: NVIDIA DGX A100 (1x A100 80GB)

Our results were obtained by running the main.py script with --mode benchmark-inference flag in the pytorch-22.10-py3 NGC container on NVIDIA DGX A100 (1x A100 80GB) GPU.

Batch sizeThroughput - TF32Throughput - mixed precisionThroughput speedup (TF32 - mixed precision)Weak scaling - TF32Weak scaling - mixed precision
1158.83142.6789%100%100%
2308.31261.2184%194%183%
4481.69454.9594%303%318%
8597.72742.05124%376%520%
16590.44887.01150%371%621%
32708.97970.27136%446%680%
64798.161057.51132%502%741%

To achieve these same results, follow the Quick Start Guide outlined above.

Inference performance: NVIDIA DGX-1 (1x V100 16GB)

Our results were obtained by running the main.py script with --mode benchmark-inference flag in the pytorch-22.10-py3 NGC container on NVIDIA DGX-1 with (1x V100 16GB) GPU.

Batch sizeThroughput - FP32Throughput - mixed precisionThroughput speedup (FP32 - mixed precision)Weak scaling - FP32Weak scaling - mixed precision
193.2184.5990%100%100%
2148.61165.30111%159%195%
4206.82304.77147%221%360%
8242.55447.25184%260%528%
16292.44541.05185%313%639%
32311.61605.30194%334%715%

To achieve these same results, follow the Quick Start Guide outlined above.