NVIDIA Deep Learning Examples
NVIDIA Deep Learning Examples
SIM for TensorFlow2
Resource
NVIDIA Deep Learning Examples
NVIDIA Deep Learning Examples
SIM for TensorFlow2

Search-based Interest Model (SIM) is a system for predicting user behavior given sequences of previous interactions.

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

To benchmark the training performance on a specific batch size, run:

mpiexec --allow-run-as-root --bind-to socket -np ${GPU} python main.py \
  --dataset_dir ${TF_RECORD_PATH} \
  --mode train \
  --model_type sim \
  --global_batch_size 131072 \
  --drop_remainder \
  --amp \
  --benchmark \
  --prebatch_train_size ${PREBATCH_TRAIN_SIZE} \
  --prebatch_test_size ${PREBATCH_TEST_SIZE}

Equivalent:

scripts/run_model.sh \
  --data_path ${TF_RECORD_PATH} \
  --gpus ${GPU} \
  --amp 1 \
  --benchmark 1 \
  --prebatch_train_size ${PREBATCH_TRAIN_SIZE} \
  --prebatch_test_size ${PREBATCH_TEST_SIZE}

Inference performance benchmark

To benchmark the inference performance on a specific batch size, run:

mpiexec --allow-run-as-root --bind-to socket -np ${GPU} python main.py \
  --dataset_dir ${TF_RECORD_PATH} \
  --mode inference \
  --model_type sim \
  --global_batch_size 131072 \
  --amp \
  --benchmark \
  --prebatch_train_size ${PREBATCH_TRAIN_SIZE} \
  --prebatch_test_size ${PREBATCH_TEST_SIZE}

Equivalent:

scripts/run_model.sh \
  --data_path ${TF_RECORD_PATH} \
  --gpus ${GPU} \
  --amp 1 \
  --benchmark 1 \
  --prebatch_train_size ${PREBATCH_TRAIN_SIZE} \
  --prebatch_test_size ${PREBATCH_TEST_SIZE}

Results

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

Training accuracy results

Our results were obtained by running the run_model.sh bash script in the TensorFlow2 21.10-py3 NGC container. Experiments were run on 1 and 8 GPUs, with FP32/TF32 Precision and AMP and with XLA-OFF/XLA-ON. Dataset was prebatched with the size of 16384. Other parameters were set to defaults.

There were 10 runs for each configuration. In the Training accuracy sections, average values are reported. In the Training stability sections, values from all runs are included in plots.

Training accuracy: NVIDIA DGX A100 (8x A100 80GB)
GPUsXLATime to train - TF32 (seconds)Time to train - mixed precision (seconds)AUC - TF32AUC - mixed precisionTime to train speedup (TF32 to mixed precision)
1XLA-OFF133.62109.290.820.8111.22
1XLA-ON132.31113.910.8110.8221.16
8XLA-OFF35.1734.080.8130.8081.03
8XLA-ON39.1940.160.8140.8110.98
Training accuracy: NVIDIA DGX-1 (8x V100 32GB)
GPUsXLATime to train - FP32 (seconds)Time to train - mixed precision (seconds)AUC - FP32AUC - mixed precisionTime to train speedup (FP32 to mixed precision)
1XLA-OFF210.70154.540.8150.8171.36
1XLA-ON203.61159.800.8160.8131.27
8XLA-OFF48.64344.020.8110.8171.11
8XLA-ON55.2654.330.8140.8171.02
Training stability test

Training stability was tested over 10 runs for each configuration of double precision / AMP, XLA-ON / XLA-OFF on 1 GPU and 8 GPUs for both Volta and Ampere architectures. Each run used the same random seed and default values of training hyperparameters. Training was performed on DGX A100 80GB and DGX-1 V100 32GB setups. AUC metric achieved on test set after training is presented in the following plots.

(Plot represents XLA-OFF results, for XLA-ON results, check expandable part below)


Figure 4. Training stability plot, distribution of AUC across different configurations with XLA-OFF.

Training stability with XLA-ON


Figure 5. Training stability plot, distribution of AUC across different configurations with XLA-ON.

Complete list of training stability results
GPUsPrecisionXLAMean AUCStd AUCMin AUCMax AUC
DGX A1001TF32XLA-OFF0.81950.00830.79810.8307
DGX A1001TF32XLA-ON0.81060.00660.80120.8211
DGX A1001AMPXLA-OFF0.81100.01030.79390.8244
DGX A1001AMPXLA-ON0.82240.00670.81150.8397
DGX A1008TF32XLA-OFF0.81270.00700.80270.8285
DGX A1008TF32XLA-ON0.81430.00790.80120.8251
DGX A1008AMPXLA-OFF0.80840.01210.78500.8203
DGX A1008AMPXLA-ON0.81090.00770.80180.8281
DGX-1 V1001FP32XLA-OFF0.81520.00750.80060.8255
DGX-1 V1001FP32XLA-ON0.81580.00550.80600.8261
DGX-1 V1001AMPXLA-OFF0.81720.00450.80970.8237
DGX-1 V1001AMPXLA-ON0.81330.00700.79870.8234
DGX-1 V1008FP32XLA-OFF0.81120.00550.80270.8182
DGX-1 V1008FP32XLA-ON0.81440.00870.80370.8281
DGX-1 V1008AMPXLA-OFF0.81730.00610.80800.8277
DGX-1 V1008AMPXLA-ON0.81690.01090.79520.8326
 

For both NVIDIA Ampere and NVIDIA Volta, even though the same seed was used for each run, there is a still noticeable variance. The reason for that are built-in non-deterministic GPU kernels in tf.math.unsorted_segment_sum operation. However, since it is six times faster than the deterministic implementation of this operation, this is the preferable solution.

Impact of mixed precision on training accuracy

Results in this section present the impact of enabling AMP on the AUC. Models were trained using default parameters, on 1/8 GPUs and on Volta/Ampere architecture.

AUC is measured on test set after model training.

(Plot represents XLA-OFF results, for XLA-ON results, check expandable part below)


Figure 6. Impact of AMP on test set AUC (XLA-OFF)

Impact of AMP on AUC for XLA-ON


Figure 7. Impact of AMP on test set AUC (XLA-ON)

 

Distribution scores for full precision training and AMP training were compared in terms of mean, variance and Kolmogorov–Smirnov test to state statistical difference between full precision and AMP results. Refer to the expandable table below.

Full tabular data for AMP influence on AUC
GPUsXLAMean AUC for Full precision (TF32 for A100, FP32 for V100)Std AUC for Full precision (TF32 for A100, FP32 for V100)Mean AUC for AMPStd AUC for AMPKS test value: statistics, p-value
DGX A1001XLA-OFF0.81950.00830.81100.01030.6000, 0.0524
DGX A1001XLA-ON0.81060.00660.82240.00670.7000, 0.0123
DGX A1008XLA-OFF0.81270.00700.80840.01210.2000, 0.9945
DGX A1008XLA-ON0.81430.00790.81090.00770.4000, 0.4175
DGX-1 V1001XLA-OFF0.81520.00750.81720.00450.2000, 0.9945
DGX-1 V1001XLA-ON0.81580.00550.81330.00700.2000, 0.9945
DGX-1 V1008XLA-OFF0.81120.00550.81730.00610.4000, 0.4175
DGX-1 V1008XLA-ON0.81440.00870.81690.01090.4000, 0.4175
 

Training accuracy plot

Models trained with FP32, TF32, and Automatic Mixed Precision (AMP) achieve similar accuracy.

Plot represents ROC AUC on the test set for 1 and 8 GPUs, with precision FP32/TF32 (for Volta/Ampere) and AMP. All other training parameters are default.


Figure 8. ROC curve for different configurations of Ampere/Volta, 1/8 GPUs, double precision / AMP. (XLA-OFF)

Training performance results

Our results were obtained by running the scripts/run_model.sh script in the TensorFlow2 21.10-py3 NGC container. Dataset was prebatched with the size of 16384.

Numbers were averaged over 10 separate runs for each configuration.

For each run, performance numbers (in samples per second) were averaged over training steps from one epoch which gives reliable estimates of the throughput. We also exclude the first 20 steps of training as a warmup phase.

The cumulative batch size of all GPUs in performance tests was set to 131072.

To achieve these same results, follow the steps in the Quick Start Guide.

Training performance: NVIDIA DGX A100 (8x A100 80GB)
GPUsXLAThroughput - TF32 (samples/s)Throughput - mixed precision (samples/s)Throughput speedup (mixed precision / TF32)Strong scaling - TF32Strong scaling - mixed precision
1OFF377254.65479921.541.271.001.00
1ON455724.01565221.041.241.001.00
8OFF2161681.552603489.601.205.735.42
8ON2662368.182979441.801.125.845.27
NVIDIA DGX A100 XLA-ON / XLA-OFF training speedup

For each configuration of parameters present in the table, the Speedup column shows the speedup achieved by turning on XLA.

GPUsPrecisionSpeedup
1TF321.208
1AMP1.178
8TF321.232
8AMP1.119

 

Training performance: NVIDIA DGX-2 (16x V100 32GB)
GPUsXLAThroughput - FP32 (samples/s)Throughput - mixed precision (samples/s)Throughput speedup (mixed precision / FP32)Strong scaling - FP32Strong scaling - mixed precision
1OFF209376.38309752.481.481.001.00
1ON245414.62348945.591.421.001.00
8OFF1310239.011689602.791.296.265.45
8ON1483120.321962226.321.326.045.62
16OFF2127221.652555926.791.2010.168.25
16ON2450499.402788997.071.149.997.99
NVIDIA DGX-2 XLA-ON / XLA-OFF training speedup

For each configuration of parameters present in the table, the Speedup column shows the speedup achieved by turning on XLA.

GPUsAMPSpeedup
1FP321.172
1AMP1.127
8FP321.132
8AMP1.161
16FP321.152
16AMP1.091

 

NVIDIA DGX A100 / DGX-2 (Ampere / Volta) training speedup
GPUsXLAPrecisionSpeedup
1OFFTF32/FP321.802
1OFFAMP1.549
1ONTF32/FP321.857
1ONAMP1.620
8OFFTF32/FP321.650
8OFFAMP1.541
8ONTF32/FP321.795
8ONAMP1.518

 

Inference performance results

Our results were obtained by running the scripts/run_model.sh script in the TensorFlow2 21.10-py3 NGC container.

Numbers were averaged over 10 separate runs for each configuration.

For each run, performance numbers (in samples per second) were averaged over training steps from one epoch which gives reliable estimates of the throughput. We also exclude the first 20 steps of training as a warmup phase.

To achieve these same results, follow the steps in the Quick Start Guide.

Inference performance: NVIDIA DGX A100 (8x A100 80GB)
Batch SizeXLAThroughput - TF32 (samples/s)Throughput - mixed precision (samples/s)Throughput speedup (mixed precision / TF32)
4096ON618547.45669640.651.08
8192ON722801.14849101.881.17
16384ON859418.771051361.671.22
32768ON976771.701269000.971.30
65536ON1082688.511444729.521.33
131072ON1094733.641483542.861.36
Complete table of DGX A100 inference performance results
Batch SizeXLAPrecisionThroughput (samples/s)
4096OFFTF32708349.73 ± 14161.58
8192OFFTF32873335.82 ± 8539.56
16384OFFTF32937987.79 ± 12114.34
32768OFFTF32943313.07 ± 8631.81
65536OFFTF32960794.46 ± 7388.45
131072OFFTF32966245.27 ± 8637.82
4096OFFAMP645394.94 ± 14844.27
8192OFFAMP919410.07 ± 11355.28
16384OFFAMP1136346.66 ± 14529.91
32768OFFAMP1216810.45 ± 21013.12
65536OFFAMP1287305.05 ± 19373.18
131072OFFAMP1298478.97 ± 10733.67
4096ONTF32618547.45 ± 6569.97
8192ONTF32722801.14 ± 9448.19
16384ONTF32859418.77 ± 10012.61
32768ONTF32976771.70 ± 13377.36
65536ONTF321082688.51 ± 8523.55
131072ONTF321094733.64 ± 11157.18
4096ONAMP669640.65 ± 9319.68
8192ONAMP849101.88 ± 14068.04
16384ONAMP1051361.67 ± 15310.42
32768ONAMP1269000.97 ± 23971.56
65536ONAMP1444729.52 ± 18011.54
131072ONAMP1483542.86 ± 6751.29
DGX A100 XLA-ON / XLA-OFF inference Speedup

For each configuration of parameters present in the table, the Speedup column shows the speedup achieved by turning on XLA.

Batch SizePrecisionSpeedup
4096TF320.873
8192TF320.828
16384TF320.916
32768TF321.035
65536TF321.127
131072TF321.133
4096AMP1.038
8192AMP0.924
16384AMP0.925
32768AMP1.043
65536AMP1.187
131072AMP1.143

 

Inference performance: NVIDIA DGX-2 (16x V100 32GB)
Batch SizeXLAThroughput - FP32 (samples/s)Throughput - mixed precision (samples/s)Throughput speedup (mixed precision / FP32)
4096ON444532.22541975.241.22
8192ON505047.64642784.481.27
16384ON549325.54727077.631.32
32768ON587452.73788606.351.34
65536ON605187.67832651.591.38
131072ON599557.03840602.901.40
Complete table of DGX-2 inference performance results
Batch SizeXLAPrecisionThroughput (samples/s)
4096OFFFP32459175.30 ± 23184.33
8192OFFFP32499179.20 ± 15967.26
16384OFFFP32525180.72 ± 2521.56
32768OFFFP32532042.10 ± 4020.44
65536OFFFP32534307.20 ± 7276.26
131072OFFFP32532311.44 ± 6195.16
4096OFFAMP581771.66 ± 6163.50
8192OFFAMP665048.04 ± 4607.95
16384OFFAMP716355.19 ± 7174.98
32768OFFAMP741642.61 ± 4981.04
65536OFFAMP755141.25 ± 6175.05
131072OFFAMP744459.46 ± 8183.17
4096ONFP32444532.22 ± 6239.01
8192ONFP32505047.64 ± 6543.06
16384ONFP32549325.54 ± 2841.21
32768ONFP32587452.73 ± 2366.43
65536ONFP32605187.67 ± 3740.07
131072ONFP32599557.03 ± 11811.28
4096ONAMP541975.24 ± 4441.93
8192ONAMP642784.48 ± 4721.08
16384ONAMP727077.63 ± 5332.80
32768ONAMP788606.35 ± 11705.36
65536ONAMP832651.59 ± 10401.17
131072ONAMP840602.90 ± 16358.73
DGX-2 XLA-ON / XLA-OFF inference speedup

For each configuration of parameters present in the table, the Speedup column shows the speedup achieved by turning on XLA.

Batch SizePrecisionSpeedup
4096TF320.968
8192TF321.012
16384TF321.046
32768TF321.104
65536TF321.133
131072TF321.126
4096AMP0.932
8192AMP0.967
16384AMP1.384
32768AMP1.063
65536AMP1.103
131072AMP1.129

 

NVIDIA A100 / DGX-2 (Ampere / Volta) inference speedup
Batch SizeXLAPrecisionSpeedup
4096OFFTF32/FP321.54
8192OFFTF32/FP321.75
16384OFFTF32/FP321.79
32768OFFTF32/FP321.77
65536OFFTF32/FP321.80
131072OFFTF32/FP321.81
4096OFFAMP1.11
8192OFFAMP1.38
16384OFFAMP1.59
32768OFFAMP1.64
65536OFFAMP1.71
131072OFFAMP1.74
4096ONTF32/FP321.39
8192ONTF32/FP321.43
16384ONTF32/FP321.56
32768ONTF32/FP321.66
65536ONTF32/FP321.79
131072ONTF32/FP321.83
4096ONAMP1.24
8192ONAMP1.32
16384ONAMP1.45
32768ONAMP1.61
65536ONAMP1.74
131072ONAMP1.76

 

NVIDIA uses cookies to improve your experience on our web site. We and our third-party partners also use cookies and other tools to collect and record information you provide as well as information about your interactions with our websites for performance improvement, analytics, and to assist in marketing efforts. By clicking "Accept All", you consent to our use of cookies and other tools as described in our Cookie Policy. You can manage your cookie settings by clicking on "Manage Settings." By continuing to use this site or by clicking one of the buttons below, you agree to our Terms of Service (which contains important waivers). Please see our Privacy Policy for more information on our privacy practices.