NVIDIA Deep Learning Examples
NVIDIA Deep Learning Examples
BioBERT for TensorFlow1
Resource
NVIDIA Deep Learning Examples
NVIDIA Deep Learning Examples
BioBERT for TensorFlow1

BERT for biomedical text-mining.

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.

Both of these benchmarking scripts enable you to run a number of epochs, extract performance numbers, and run the BERT model for fine tuning.

Training performance benchmark

Training benchmarking can be performed by running the script:

biobert/scripts/biobert_finetune_training_benchmark.sh <task> <num_gpu> <bert_model> <cased>

This script runs 2 epochs by default on the NER BC5CDR dataset and extracts performance numbers for various batch sizes and sequence lengths in both FP16 and FP32. These numbers are saved at /results/tf_bert_biobert_<task>_training_benchmark__<bert_model>_<cased/uncased>_num_gpu_<num_gpu>_<DATESTAMP>

Inference performance benchmark

Training benchmarking can be performed by running the script:

biobert/scripts/biobert_finetune_inference_benchmark.sh <task> <bert_model> <cased>

This script runs inference on the test and dev sets and extracts performance and latency numbers for various batch sizes and sequence lengths in both FP16 with XLA and FP32 without XLA. These numbers are saved at /results/tf_bert_biobert_<task>_training_benchmark__<bert_model>_<cased/uncased>_num_gpu_<num_gpu>_<DATESTAMP>

Results

The following sections provide detailed results of downstream fine-tuning task on NER and RE benchmark tasks.

Training accuracy results

Pre-training accuracy

Our results were obtained by running the scripts/run_pretraining_lamb.sh training script in the TensorFlow 19.08-py3 NGC container.

DGX SystemNodesPrecisionBatch Size/GPU: Phase1, Phase2Accumulation Steps: Phase1, Phase2Time to Train (Hrs)Final Loss
DGX2H4FP16128, 168, 3219.140.88
DGX2H16FP16128, 162, 84.810.86
DGX2H32FP16128, 161, 42.650.87
DGX11FP1664, 8128,512174.580.87
DGX14FP1664, 832, 12857.710.85
DGX116FP1664, 88, 3212.620.87
DGX132FP1664, 84, 166.970.87
Fine-tuning accuracy
TaskF1PrecisionRecall
NER BC5CDR-chemical93.4793.0393.91
NER BC5CDR-disease86.2285.0587.43
RE Chemprot76.2777.6274.98
Fine-tuning accuracy for NER Chem

Our results were obtained by running the biobert/scripts/ner_bc5cdr-chem.sh training script in the TensorFlow 19.08-py3 NGC container.

DGX SystemBatch size / GPUF1 - FP32F1- mixed precisionTime to Train - FP32 (Minutes)Time to Train - mixed precision (Minutes)
DGX-1 16G6493.3393.4023.9514.13
DGX-1 32G6493.3193.3624.3512.63
DGX-2 32G6493.6693.4712.268.16

Training stability test

Fine-tuning stability test:

The following tables compare F1 scores scores across 5 different training runs on the NER Chemical task with different seeds, for both FP16 and FP32. The runs showcase consistent convergence on all 5 seeds with very little deviation.

16 x V100 GPUsseed 1seed 2seed 3seed 4seed 5meanstd
F1 Score (FP16)93.1392.9293.3493.6693.4793.30.29
F1 Score (FP32)93.193.2893.3393.4593.1793.270.14

Training performance results

Training performance: NVIDIA DGX-1 (8x V100 16G)
Pre-training training performance: multi-node on DGX-1 16G

Our results were obtained by running the biobert/scripts/run_biobert.sub training script in the TensorFlow 19.08-py3 NGC container using multiple NVIDIA DGX-1 with 8x V100 16G GPUs. Performance (in sentences per second) is the steady state throughput.

NodesSequence LengthBatch size / GPU: mixed precision, FP32Throughput - mixed precisionThroughput - FP32Throughput speedup (FP32 to mixed precision)Weak scaling - mixed precisionWeak scaling - FP32
112864,322762.06744.483.711.001.00
412864,3210283.082762.883.723.723.71
1612864,3239051.6910715.143.6414.1414.39
3212864,3276077.3921104.873.6027.5428.35
15128,8432.33160.382.701.001.00
45128,81593.00604.362.643.683.77
165128,85941.822356.442.5213.7414.69
325128,811483.734631.292.4826.5628.88

Note: The respective values for FP32 runs that use a batch size of 16, 2 in sequence lengths 128 and 512 respectively are not available due to out of memory errors that arise.

Fine-tuning training performance for NER on DGX-1 16G

Our results were obtained by running the biobert/scripts/ner_bc5cdr-chem.sh training script in the TensorFlow 19.08-py3 NGC container on NVIDIA DGX-1 with 8x V100 16G GPUs. Performance (in sentences per second) is the mean throughput from 2 epochs.

GPUsBatch size / GPUThroughput - FP32Throughput - mixed precisionThroughput speedup (FP32 to mixed precision)Weak scaling - FP32Weak scaling - mixed precision
164147.71348.842.361.001.00
464583.781145.461.963.953.28
864981.221964.852.006.645.63

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

Training performance: NVIDIA DGX-1 (8x V100 32G)
Fine-tuning training performance for NER on DGX-1 32G

Our results were obtained by running the biobert/scripts/ner_bc5cdr-chem.sh training script in the TensorFlow 19.08-py3 NGC container on NVIDIA DGX-1 with 8x V100 32G GPUs. Performance (in sentences per second) is the mean throughput from 2 epochs.

GPUsBatch size / GPUThroughput - FP32Throughput - mixed precisionThroughput speedup (FP32 to mixed precision)Weak scaling - FP32Weak scaling - mixed precision
164144.1417.392.891.001.00
464525.151354.142.573.643.24
864969.42341.392.416.735.61

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

Training performance: NVIDIA DGX-2 (16x V100 32G)
Pre-training training performance: multi-node on DGX-2H 32G

Our results were obtained by running the biobert/scripts/run_biobert.sub training script in the TensorFlow 19.08-py3 NGC container using multiple NVIDIA DGX-2H with 16x V100 32G GPUs. Performance (in sentences per second) is the steady state throughput.

NodesSequence LengthBatch size / GPU: mixed precision, FP32Throughput - mixed precisionThroughput - FP32Throughput speedup (FP32 to mixed precision)Weak scaling - mixed precisionWeak scaling - FP32
1128128,1287772.182165.043.591.001.00
4128128,12829785.318516.903.503.833.93
16128128,128115581.2933699.153.4314.8715.57
32128128,128226156.5366996.733.3829.1030.94
64128128,128444955.74133424.953.3357.2561.63
151216,161260.06416.923.021.001.00
451216,164781.191626.762.943.793.90
1651216,1618405.656418.092.8714.6115.39
3251216,1636071.0612713.672.8428.6330.49
6451216,1669950.8625245.962.7755.5160.55
Fine-tuning training performance for NER on DGX-2 32G

Our results were obtained by running the biobert/scripts/ner_bc5cdr-chem.sh training script in the TensorFlow 19.08-py3 NGC container on NVIDIA DGX-2 with 16x V100 32G GPUs. Performance (in sentences per second) is the mean throughput from 2 epochs.

GPUsBatch size / GPUThroughput - FP32Throughput - mixed precisionThroughput speedup (FP32 to mixed precision)Weak scaling - FP32Weak scaling - mixed precision
164139.59475.543.41.001.00
464517.081544.012.983.703.25
8641009.842695.342.667.235.67
16641997.734268.812.1314.318.98

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

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.