NVIDIA Deep Learning Examples
wav2vec 2.0 for PyTorch
Resource
NVIDIA Deep Learning Examples
wav2vec 2.0 for PyTorch

A framework for self-supervised learning of speech representations which masks latent representations of the raw waveform and solves a contrastive task over quantized speech representations.

  • 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 with a number of specific configurations, run:

    NUM_GPUS=[NUM] UPDATE_FREQ=[NUM] NUM_CONCAT_BATCHES=[NUM] NUM_EPOCHS=[NUM] NUM_WARUP_EPOCHS=[NUM] \
        BF16=[true|false] FP16=[true|false] bash scripts/pretrain_base_benchmark.sh
    
    NUM_GPUS=[NUM] UPDATE_FREQ=[NUM] NUM_CONCAT_BATCHES=[NUM] NUM_EPOCHS=[NUM] NUM_WARUP_EPOCHS=[NUM] \
        BF16=[true|false] FP16=[true|false] bash scripts/finetune_base_benchmark.sh
    

    for example:

    NUM_GPUS=8 UPDATE_FREQ=1 NUM_CONCAT_BATCHES=8 BF16=true bash scripts/pretrain_base_benchmark.sh
    NUM_GPUS=8 UPDATE_FREQ=1 NUM_CONCAT_BATCHES=1 BF16=true bash scripts/finetune_base_benchmark.sh
    

    By default, these scripts run initially for NUM_WARMUP_EPOCHS=2, and collect performance results for another NUM_EPOCHS=5 on the train-clean-100 subset of LibriSpeech.

    Inference performance benchmark

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

    NUM_WARMUP_REPEATS=[NUM] NUM_REPEATS=[NUM] BATCH_SIZE=[NUM] BF16=[true|false] FP16=[true|false] \
        bash scripts/inference_benchmark.sh
    

    for example:

    NUM_WARMUP_REPEATS=2 NUM_REPEATS=10 BATCH_SIZE=8 BF16=true bash scripts/inference_benchmark.sh
    

    By default, the model will process all samples in the test-other subset of LibriSpeech initially NUM_WARMUP_REPEATS times for warmup, and then NUM_REPEATS times recording the measurements. The number of iterations will depend on the batch size.

    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)

    Pre-training results were obtained by running the scripts/pretrain_base.sh training script in the PyTorch 22.11-py3 NGC container on NVIDIA A100 (8x A100 80GB) GPUs. We report a median of eight (BF16 mixed precision) and three (TF32) runs.

    GPUs(Concatenated) batch size / GPUAccuracy - TF32Accuracy - mixed precisionTime to train - TF32Time to train - mixed precisionTime to train speedup (TF32 to mixed precision)
    88 x 1400k max tokens0.6190.63364.9 h48.1 h1.35

    Accuracy during pre-training

    Fine-tuning results were obtained by running the scripts/finetune_base_960h.sh training script in the PyTorch 22.11-py3 NGC container on NVIDIA A100 (8x A100 80GB) GPUs. We report a median of eight runs; each resumed from a different pre-training checkpoint.

    GPUs(Concatenated) batch size / GPUWER - mixed precisionTime to train - TF32Time to train - mid precisionTime to train speedup (TF32 to mixed precision)
    81 x 3200k max tokens8.8788.2 h6.5 h1.27

    Word error rate during fine-tuning

    Training stability test

    The wav2vec 2.0 Base model was pre-trained with eight different initial random seeds in bfloat16 precision in the PyTorch 22.11-py3 NGC container on NVIDIA DGX A100 with 8x A100 80GB.

    Below we present accuracy of this model in the self-training task:

    UpdateAverageStdMinMaxMedian
    50k0.4910.0110.4710.5140.493
    100k0.5370.0090.5180.5500.539
    150k0.5640.0090.5440.5770.564
    200k0.5800.0090.5580.5890.583
    250k0.5990.0080.5860.6070.602
    300k0.6100.0100.5890.6220.611
    350k0.6190.0090.6070.6340.617
    400k0.6290.0070.6140.6360.633

    Afterward, each of those runs was fine-tuned on LibriSpeech 960 h dataset with yet another different initial random seed. Below we present the word error rate (WER) on the dev-other subset of LibriSpeech:

    UpdateAverageStdMinMaxMedian
    50k11.1980.30310.56411.62811.234
    100k10.8250.21410.57411.21110.763
    150k10.5070.16010.22410.77810.518
    200k9.5670.1869.2359.8369.530
    250k9.1150.1938.7649.3399.194
    300k8.8850.2018.5079.1518.972
    320k8.8270.1888.4409.0438.878

    Training performance results

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

    Pre-training

    Our results were obtained by running the scripts/pretrain_base_benchmark.sh training script in the PyTorch 22.11-py3 NGC container on NVIDIA A100 (8x A100 80GB) GPUs. Performance numbers in transformer tokens per second were averaged over an entire training epoch.

    GPUsConcat batches / GPUGrad accumulationThroughput - TF32Throughput - mixed precisionThroughput speedup (TF32 to mixed precision)Strong scaling - TF32Strong scaling - mixed precision
    18828045.2737609.841.341.001.00
    482103842.47138956.381.343.703.69
    881194306.46261881.291.356.936.96

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

    Fine-tuning

    Our results were obtained by running the scripts/finetune_base_benchmark.sh training script in the PyTorch 22.11-py3 NGC container on NVIDIA A100 (8x A100 80GB) GPUs. Performance numbers in transformer tokens per second were averaged over an entire training epoch.

    GPUsConcat batches / GPUGrad accumulationThroughput - TF32Throughput - mixed precisionThroughput speedup (TF32 to mixed precision)Strong scaling - TF32Strong scaling - mixed precision
    18134813.4641275.761.191.001.00
    421102326.57132361.621.292.943.21
    811163610.16207200.911.274.705.02

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

    Inference performance results

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

    Our results were obtained by running the scripts/inference_benchmark.sh inferencing benchmarking script in the PyTorch 22.11-py3 NGC container on the NVIDIA A100 (1x A100 80GB) GPU. The script runs inference on the test-other subset of LibriSpeech in variable-length batches.

    DurationBF16 Latency (ms) PercentilesTF32 Latency (ms) PercentilesBF16/TF32 speedup
    BSAvg90%95%99%Avg90%95%99%AvgAvg
    16.54 s11.0211.4112.4210.4510.8811.2312.5110.310.99
    46.54 s21.7424.1235.8017.6923.1726.8541.6218.421.04
    86.54 s40.0648.0774.5928.7046.4354.8688.7331.301.09
    166.54 s88.78117.40151.3758.82102.64135.92175.6867.441.15

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

    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.