Skip to main content
NVIDIA
GNMT v2 for TensorFlow
Resource
NVIDIA
GNMT v2 for TensorFlow

The GNMT v2 model is an improved version of the first Google's Neural Machine Translation System with a modified attention mechanism.

Performance

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 nmt.py script in the tensorflow-19.03-py3 NGC container on NVIDIA DGX-1 with 8x V100 16G GPUs.

Commands to launch the training:

for 1 GPUs in mixed precision:
python nmt.py --output_dir=results --batch_size=192 --learning_rate=8e-4

for 8 GPUs in mixed precision:
python nmt.py --output_dir=results --batch_size=1536 --num_gpus=8 --learning_rate=2e-3

for 1 GPUs in FP32:
python nmt.py --output_dir=results --batch_size=128 --learning_rate=5e-4 --use_amp=false

for 8 GPUs in FP32:
python nmt.py --output_dir=results --batch_size=1024 --num_gpus=8 --learning_rate=2e-3 --use_amp=false
Number of GPUsMixed precision batch size/GPUFP32 batch size/GPUMixed precision BLEUFP32 BLEUMixed precision training timeFP32 training time
119212824.5824.64789 min1375 min
819212824.4624.51184 min262 min

In the following plot, the BLEU scores after each training epoch for different configurations are displayed.

BLEUScore

Training stability test

The GNMT v2 model was trained for 6 epochs, starting from 6 different initial random seeds. After each training epoch, the model was evaluated on the test dataset and the BLEU score was recorded. The training was performed in the tensorflow-19.03-py3 NGC container on NVIDIA DGX-1 with 8 Tesla V100 16G GPUs.

In the following table, the BLEU scores after each training epoch for different initial random seeds are displayed.

EpochAverageStandard deviationMinimumMaximumMedian
119.9430.24019.67020.29019.855
221.7500.19721.55022.11021.690
322.4080.15022.16022.63022.430
423.0570.21922.77023.44022.985
523.8970.14223.70024.08023.915
624.2430.17424.03024.46024.235

Training performance results

Our results were obtained by running the nmt.py script in the tensorflow-19.03-py3 NGC container on NVIDIA DGX-1 with 8x V100 16G GPUs. Performance numbers (in tokens per second) were averaged over an entire training epoch.

Number of GPUsMixed precision batch size/GPUFP32 batch size/GPUMixed precision tokens/sFP32 tokens/sMixed precision speedupMixed precision multi-gpu weak scalingFP32 multi-gpu weak scaling
119212822 29712 7671.741.001.00
8192128133 99283 3371.616.016.53

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

Inference performance results

Our results were obtained by running the scripts/translate.py script in the tensorflow-19.03-py3 NGC container on NVIDIA DGX-1 with a single V100 16G GPUs. The benchmark requires a checkpoint from a fully trained model.

To launch the inference benchmark in mixed precision on 1 GPU, run:

python scripts/inference_benchmark.py --output_dir=/path/to/trained/model --beam_width 1,2,5,10 --infer_batch_size 32,128,512

To launch the inference benchmark in FP32 on 1 GPU, run:

python scripts/inference_benchmark.py --output_dir=/path/to/trained/model --beam_width 1,2,5,10 --infer_batch_size 32,128,512 --use_amp=false
Batch sizeBeam sizeMixed precision BLEUFP32 BLEUMixed precision tokens/sFP32 tokens/s
32123.4323.4781807555
32224.1424.1368706359
32524.4324.4747293991
321024.2924.2923442495
128123.4323.471934314810
128224.1524.13102679956
128524.4524.4770095224
1281024.3024.2938732855
512123.4523.473232520782
512224.1724.131891713702
512524.4624.4787896036
5121024.2924.2946843149

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

Modal Content

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.