NVIDIA
NVIDIA
FastPitch 1.0 for PyTorch
Resource
NVIDIA
NVIDIA
FastPitch 1.0 for PyTorch

The FastPitch model generates mel-spectrograms from raw input text and allows to exert additional control over the synthesized utterances.

Benchmarking

The following section shows how to run benchmarks measuring the model performance in training and inference mode.

Training performance benchmark

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

  • NVIDIA DGX A100 (8x A100 80GB)

        AMP=true NUM_GPUS=1 BS=32 GRAD_ACCUMULATION=8 EPOCHS=10 bash scripts/train.sh
        AMP=true NUM_GPUS=8 BS=32 GRAD_ACCUMULATION=1 EPOCHS=10 bash scripts/train.sh
        AMP=false NUM_GPUS=1 BS=32 GRAD_ACCUMULATION=8 EPOCHS=10 bash scripts/train.sh
        AMP=false NUM_GPUS=8 BS=32 GRAD_ACCUMULATION=1 EPOCHS=10 bash scripts/train.sh
    
  • NVIDIA DGX-1 (8x V100 16GB)

        AMP=true NUM_GPUS=1 BS=16 GRAD_ACCUMULATION=16 EPOCHS=10 bash scripts/train.sh
        AMP=true NUM_GPUS=8 BS=16 GRAD_ACCUMULATION=2 EPOCHS=10 bash scripts/train.sh
        AMP=false NUM_GPUS=1 BS=16 GRAD_ACCUMULATION=16 EPOCHS=10 bash scripts/train.sh
        AMP=false NUM_GPUS=8 BS=16 GRAD_ACCUMULATION=2 EPOCHS=10 bash scripts/train.sh
    

Each of these scripts runs for 10 epochs and for each epoch measures the average number of items per second. The performance results can be read from the nvlog.json files produced by the commands.

Inference performance benchmark

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

  • For FP16

    AMP=true BS_SEQUENCE="1 4 8" REPEATS=100 bash scripts/inference_benchmark.sh
    
  • For FP32 or TF32

    AMP=false BS_SEQUENCE="1 4 8" REPEATS=100 bash scripts/inference_benchmark.sh
    

The output log files will contain performance numbers for the FastPitch model (number of output mel-spectrogram frames per second, reported as generator_frames/s w ) and for WaveGlow (number of output samples per second, reported as waveglow_samples/s). The inference.py script will run a few warm-up iterations before running the benchmark. Inference will be averaged over 100 runs, as set by the REPEATS env variable.

Results

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

Training accuracy results

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

Our results were obtained by running the ./platform/DGXA100_FastPitch_{AMP,TF32}_8GPU.sh training script in the 21.05-py3 NGC container on NVIDIA DGX A100 (8x A100 80GB) GPUs.

Loss (Model/Epoch)50250500750100012501500
FastPitch AMP3.352.892.792.712.682.642.61
FastPitch TF323.372.882.782.712.682.632.61
Training accuracy: NVIDIA DGX-1 (8x V100 16GB)

Our results were obtained by running the ./platform/DGX1_FastPitch_{AMP,FP32}_8GPU.sh training script in the PyTorch 21.05-py3 NGC container on NVIDIA DGX-1 with 8x V100 16GB GPUs.

All of the results were produced using the train.py script as described in the Training process section of this document.

Loss (Model/Epoch)50250500750100012501500
FastPitch AMP3.382.882.792.712.682.642.61
FastPitch FP323.382.892.802.712.682.652.62
Loss curves

Training performance results

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

Our results were obtained by running the ./platform/DGXA100_FastPitch_{AMP,TF32}_8GPU.sh training script in the 21.05-py3 NGC container on NVIDIA DGX A100 (8x A100 80GB) GPUs. Performance numbers, in output mel-scale spectrogram frames per second, were averaged over an entire training epoch.

Batch size / GPUGrad accumulationGPUsThroughput - TF32Throughput - mixed precisionThroughput speedup (TF32 to mixed precision)Weak scaling - TF32Weak scaling - mixed precision
328197,735101,7301.041.001.00
3224337,163352,3001.043.453.46
3218599,221623,4981.046.136.13
Expected training time

The following table shows the expected training time for convergence for 1500 epochs:

Batch size / GPUGPUsGrad accumulationTime to train with TF32 (Hrs)Time to train with mixed precision (Hrs)Speed-up with mixed precision
321832.831.61.04
32429.69.21.04
32815.55.31.04
Training performance: NVIDIA DGX-1 (8x V100 16GB)

Our results were obtained by running the ./platform/DGX1_FastPitch_{AMP,FP32}_8GPU.sh training script in the PyTorch 21.05-py3 NGC container on NVIDIA DGX-1 with 8x V100 16GB GPUs. Performance numbers, in output mel-scale spectrogram frames per second, were averaged over an entire training epoch.

Batch size / GPUGPUsGrad accumulationThroughput - FP32Throughput - mixed precisionThroughput speedup (FP32 to mixed precision)Strong scaling - FP32Strong scaling - mixed precision
1611633,45663,9861.911.001.00
1644120,393209,3351.743.603.27
1682222,161356,5221.606.645.57

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

Expected training time

The following table shows the expected training time for convergence for 1500 epochs:

Batch size / GPUGPUsGrad accumulationTime to train with FP32 (Hrs)Time to train with mixed precision (Hrs)Speed-up with mixed precision
1611689.347.41.91
164424.914.61.74
168213.68.61.60

Note that most of the quality is achieved after the initial 1000 epochs.

Inference performance results

The following tables show inference statistics for the FastPitch and WaveGlow text-to-speech system, gathered from 100 inference runs. Latency is measured from the start of FastPitch inference to the end of WaveGlow inference. Throughput is measured as the number of generated audio samples per second at 22KHz. RTF is the real-time factor which denotes the number of seconds of speech generated in a second of wall-clock time, per input utterance. The used WaveGlow model is a 256-channel model.

Note that performance numbers are related to the length of input. The numbers reported below were taken with a moderate length of 128 characters. Longer utterances yield higher RTF, as the generator is fully parallel.

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

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

Batch sizePrecisionAvg latency (s)Latency tolerance interval 90% (s)Latency tolerance interval 95% (s)Latency tolerance interval 99% (s)Throughput (samples/sec)Speed-up with mixed precisionAvg RTF
1FP160.0910.0920.0920.0921,879,1891.2885.22
4FP160.3350.3370.3370.3382,043,6411.2123.17
8FP160.6520.6540.6540.6552,103,7651.2111.93
1TF320.1170.1170.1180.1181,473,838-66.84
4TF320.4060.4080.4080.4091,688,141-19.14
8TF320.7920.7940.7940.7951,735,463-9.84
Inference performance: NVIDIA DGX-1 (1x V100 16GB)

Our results were obtained by running the ./scripts/inference_benchmark.sh script in the PyTorch 21.05-py3 NGC container. The input utterance has 128 characters, synthesized audio has 8.05 s.

Batch sizePrecisionAvg latency (s)Latency tolerance interval 90% (s)Latency tolerance interval 95% (s)Latency tolerance interval 99% (s)Throughput (samples/sec)Speed-up with mixed precisionAvg RTF
1FP160.1490.1500.1500.1511,154,0612.6452.34
4FP160.5350.5380.5380.5391,282,6802.7114.54
8FP161.0551.0581.0591.0601,300,2612.717.37
1FP320.3930.3950.3950.396436,961-19.82
4FP321.4491.4521.4521.453473,515-5.37
8FP322.8612.8652.8662.867479,642-2.72
Inference performance: NVIDIA T4

Our results were obtained by running the ./scripts/inference_benchmark.sh script in the PyTorch 21.05-py3 NGC container. The input utterance has 128 characters, synthesized audio has 8.05 s.

Batch sizePrecisionAvg latency (s)Latency tolerance interval 90% (s)Latency tolerance interval 95% (s)Latency tolerance interval 99% (s)Throughput (samples/sec)Speed-up with mixed precisionAvg RTF
1FP160.4460.4490.4490.450384,7432.7217.45
4FP161.8221.8261.8271.828376,4802.704.27
8FP163.6563.6623.6643.666375,3292.702.13
1FP321.2131.2181.2191.220141,403-6.41
4FP324.9284.9374.9394.942139,208-1.58
8FP329.8539.8689.8719.877139,266-0.79