NVIDIA Deep Learning Examples
NVIDIA Deep Learning Examples
BART for PyTorch
Resource
NVIDIA Deep Learning Examples
NVIDIA Deep Learning Examples
BART for PyTorch

BART is a denoising autoencoder for pretraining sequence-to-sequence models.

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, source length, target length and dataset for one epoch, run:

bash scripts/run_training_benchmark.sh <batch size> <max source length> <max target length> <data dir>

The resulting NUM_GPU and PRECISION vs Throughput is stored in results/bart_pyt_training_benchmark_${DATESTAMP}/inference_benchmark.log

Inference performance benchmark

To benchmark the inference performance on a specific batch size, source length, target length and dataset, run:

bash scripts/run_inference_benchmark.sh <predict batch size> <eval beams> <max source length> <max target length> <model name or path> <data dir> <config path>

The resulting NUM_GPU and PRECISION vs Throughput is stored in results/bart_pyt_inference_benchmark_${DATESTAMP}/inference_benchmark.log

Results

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

Training accuracy results

Pre-training accuracy: NVIDIA DGX A100 (320x A100 80GB)

Our results were obtained by running the run_pretraining.sh training script in the PyTorch 22.08-py3 NGC container on 40 nodes NVIDIA DGX A100 (320x A100 80GB) GPUs.

NodesSequence LengthBatch size/GPU (BF16)Accumulation StepsFinal loss - BF16Time to train (hrs) - BF16
4012820010.509517.38
405123230.60853.28
Fine-tuning accuracy: NVIDIA DGX A100 (8x A100 80GB)

Our results for XSUM dataset were obtained by running the run_summarization.sh training script in the PyTorch 22.08-py3 NGC container on NVIDIA DGX A100 (8x A100 80GB) GPUs. Rogue1, rogue2 and rogueLSum scores list as accuracy.

GPUsBatch size (TF32, BF16)R1 - TF32R2 - TF32RL - TF32R1 - BF16R2 - BF16RL - BF16Time to train (hrs) - TF32Time to train (hrs) - BF16Time to train (hrs) speedup (TF32 to BF16)
124, 4045.2222.0336.9544.9121.8536.782.411.691.43
8192, 32045.0421.9236.8245.0121.8636.810.640.391.64

In addition,results for CNN-DM dataset are:

GPUsBatch size (TF32, BF16)R1 - TF32R2 - TF32RL - TF32R1 - BF16R2 - BF16RL - BF16Time to train (hrs) - TF32Time to train (hrs) - BF16Time to train (hrs) speedup (TF32 to BF16)
124, 4043.7620.7940.5143.5820.6340.323.872.421.60
8192, 32043.7720.7740.5343.7620.7340.500.730.451.62
Fine-tuning stability test

Our results for XSUM dataset were obtained by running the run_summarization.sh training script in the PyTorch 22.08-py3 NGC container on NVIDIA DGX A100 (8x A100 80GB) GPUs. Accuracy column lists rogue1 scores across 5 different training runs with different seeds on DGX A100.

FP16, 8x GPUsseed 1seed 2seed 3seed 4seed 5meanstd
rogue145.0844.9845.1044.9144.9545.00

Training performance results

Pre-training performance: Single-node on NVIDIA DGX A100 (8x A100 80GB)

Our results were obtained by running the run_pretraining.sh training script in the PyTorch 22.08-py3 NGC container on single node NVIDIA DGX A100 (8x A100 80GB) GPUs.

GPUsSequence LengthBatch size / GPU (TF32, BF16)Throughput - TF32Throughput - BF16Throughput speedup (TF32 - BF16)Weak scaling - TF32Weak scaling - BF16
1128100, 200202.53326.531.6111
8128100, 2001556.232572.861.657.687.88
151216, 3241.3569.311.6811
851216, 32317.85549.671.737.697.93
Pre-training performance: Multi-node on NVIDIA DGX A100 (8x A100 80GB)

Our results were obtained by running the run_pretraining.sh training script in the PyTorch 22.08-py3 NGC container on multi node NVIDIA DGX A100 (8x A100 80GB) GPUs.

NodesSequence LengthBatch size / GPU (TF32, BF16)Throughput - TF32Throughput - BF16Throughput speedup (TF32 - BF16)Weak scaling - TF32Weak scaling - BF16
1128100, 2001556.232572.861.6511
20128100, 20031067.9652,459.021.6919.9620.39
40128100, 20061,538.4697028.511.5839.5437.71
151216, 32317.85549.671.7311
2051216, 325953.4910520.541.7718.7319.14
4051216, 3211,636.3619948.051.7136.6136.29
Fine-tuning performance: NVIDIA DGX A100 (8x A100 80GB)

Our results were obtained by running the run_summarization.sh training script in the PyTorch 22.08-py3 NGC container on NVIDIA DGX A100 (8x A100 80GB) GPUs. Performance numbers (in items per second) were averaged over an entire training epoch.

GPUsBatch size / GPU (TF32, BF16)Throughput - TF32Throughput - BF16Throughput speedup (TF32 - BF16)Weak scaling - TF32Weak scaling - BF16
124, 4048.6174.591.531.001.00
824, 40243.03390.241.613.394.08

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

The performance metrics used are tokens per second computed from iterating through an entire epoch of XSum dataset with source length = 1024 and target length = 60.

Inference performance results

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

Our results were obtained by running the run_eval_summarization.sh inferencing benchmarking script in the PyTorch 22.08-py3 NGC container on NVIDIA DGX A100 (1x A100 80GB) GPU.

BF16

Batch sizeLatency AvgLatency 90%Latency 95%Latency 99%Throughput
10.280.350.380.463.54
40.440.520.560.719.16
80.630.750.830.9812.79
160.981.21.291.4716.3
321.82.272.472.6317.73
643.784.855.215.416.83
1288.2910.5310.6910.9315.36

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

The inference performance metrics used are milliseconds per iteration. They are computed by iterating through the XSum test data with source length = 1024, target length = 60 and beam search = 6.