NVIDIA Deep Learning Examples
NVIDIA Deep Learning Examples
MoFlow for PyTorch
Resource
NVIDIA Deep Learning Examples
NVIDIA Deep Learning Examples
MoFlow for PyTorch

MoFlow is a model for molecule generation that leverages Normalizing Flows. This implementation is an optimized version of the model in the original paper.

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 number of GPUs, batch size and precision, run:

bash scripts/benchmark_training.sh <# GPUs> <batch_size> <precision>

Eg. running

./scripts/benchmark_training.sh 8 2048 amp

will measure performance for eight GPUs, batch size of 2048 per GPU and mixed precision and running:

./scripts/benchmark_training.sh 1 1024 full

will measure performance for single GPU, batch size of 1024 and full precision.

Inference performance benchmark

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

bash scripts/benchmark_inference.sh <batch size> <precision>

Eg. running

./scripts/benchmark_inference.sh 2048 amp

will measure performance for a batch size of 2048 and mixed precision and running:

./scripts/benchmark_inference.sh 1024 full

will measure performance for a batch size of 1024 and full precision.

Results

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

Training accuracy results

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

Our results were obtained by running the scripts/train.sh training script in the PyTorch 22.11 NGC container on NVIDIA A100 (8x A100 80GB) GPUs. The values presented below were averaged over 20 experiments.

GPUsBatch size / GPUNUV - TF32NUV - mixed precisionTime to train - TF32Time to train - mixed precisionTime to train speedup (TF32 to mixed precision)
151289.63 %87.83 %5h8min4h0min1.28x
851287.03 %87.90 %48min40min1.20x
Training stability test

The MoFlow model was trained for 300 epochs starting from 20 different initial random seeds. Every five training epochs, the model was evaluated by generating a small sample of molecules (100 molecules per GPU), and validity and uniqueness were calculated. The training was performed in the PyTorch 22.11 Docker container on NVIDIA DGX A100 with 8x A100 80GB GPUs with AMP and CUDA graph capture enabled. The following table summarizes the results of the stability test.

The following table displays the validity and uniqueness scores after every 50 epochs for different initial random seeds.

epochvalidity meanvalidity stdvalidity minvalidity maxvalidity medianuniqueness meanuniqueness stduniqueness minuniqueness maxuniqueness median
5068.225.2557.3874.7569.5093.648.2262.5699.8295.30
10076.914.2369.5084.3877.5099.390.9296.31100.0099.83
15080.483.8073.8888.2581.7599.580.7896.64100.0099.85
20083.873.9877.0090.6284.4499.760.3898.81100.00100.00
25086.084.4677.1293.1286.5699.870.2199.27100.00100.00
30087.293.7077.7593.3887.6999.820.3098.70100.0099.93

Training performance results

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

Our results were obtained by running the scripts/benchmark_training.sh training script in the PyTorch 22.11 NGC container on NVIDIA A100 (8x A100 80GB) GPUs. Performance numbers (in molecules per second) were averaged over 190 iterations after 10 warm-up steps.

GPUsBatch size / GPUThroughput - TF32Throughput - mixed precisionThroughput speedup (TF32 - mixed precision)Weak scaling - TF32Weak scaling - mixed precision
15123499.354524.151.29
110243883.495392.781.39
120484291.296118.461.43
851224108.0429293.411.226.896.47
8102428104.6237365.051.337.246.93
8204830927.0442078.311.367.216.88

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

Inference performance results

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

Our results were obtained by running the scripts/benchmark_inference.sh inferencing benchmarking script in the PyTorch 22.11 NGC container on the NVIDIA A100 (1x A100 80GB) GPU.

FP16

Batch sizeThroughput AvgLatency AvgLatency 90%Latency 95%Latency 99%
51212524.4941414141
102413871.6074747474
204814386.44142144144144

TF32

Batch sizeThroughput AvgLatency AvgLatency 90%Latency 95%Latency 99%
5129696.3553535353
102410242.98100100100100
204811174.75183187187187

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