NVIDIA Deep Learning Examples
NCF for TensorFlow1
Resource
NVIDIA Deep Learning Examples
NCF for TensorFlow1

The NCF model focuses on providing recommendations. This is a modified implementation with improved overfitting and better accuracy.

  • 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.

    Performance Benchmark

    To benchmark the training and inference performance, run:

    mpirun -np 1 --allow-run-as-root python ncf.py --data /data/cache/ml-20m
    

    By default, the ncf.py script outputs metrics describing the following:

    • Training speed and throughput
    • Evaluation speed and throughput

    Results

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

    All throughput numbers are reported in millions of samples per second while time-to-train numbers are in seconds.

    Training accuracy results

    For all the sections below, our results were obtained by running:

    mpirun -np <number_of_GPUs> --allow-run-as-root python ncf.py [--amp] --data /data/cache/ml-20m
    

    in the TensorFlow-1 20.07 NGC container.

    Training accuracy: NVIDIA DGX A100 (8x A100 40GB)
    GPUsBatch size / GPUAccuracy - TF32Accuracy - mixed precisionTime to train - TF32 [s]Time to train - mixed precision [s]Time to train speedup (TF32 to mixed precision)
    11,048,5760.95880.958959.453.11.12
    4262,1440.95880.959022.821.51.06
    8131,0720.95870.958919.820.20.98
    Training accuracy: NVIDIA DGX-1 (8x V100 32GB)
    GPUsBatch size / GPUAccuracy - FP32Accuracy - mixed precisionTime to train - FP32Time to train - mixed precisionTime to train speedup (FP32 to mixed precision)
    11,048,5760.95830.9589120.991.61.32
    4262,1440.95890.958343.731.81.37
    8131,0720.95900.958826.221.91.20

    Training Performance Results

    For all the sections below, our results were obtained by running:

    mpirun -np <number_of_GPUs> --allow-run-as-root python ncf.py [--amp] --data /data/cache/ml-20m
    

    in the TensorFlow-1 20.07 NGC container.

    Training performance: NVIDIA DGX A100 (8x A100 40GB)
    GPUsBatch size / GPUThroughput - TF32Throughput - mixed precisionThroughput speedup (TF32 - mixed precision)Strong scaling - TF32Strong scaling - mixed precision
    11,048,57620.1822.841.13211
    4262,14460.3462.701.0392.992.75
    8131,07289.8880.860.9004.453.54
    Training performance: NVIDIA DGX-1 (8x V100 32GB)
    GPUsBatch size / GPUThroughput - FP32Throughput - mixed precisionThroughput speedup (FP32 - mixed precision)Strong scaling - FP32Strong scaling - mixed precision
    11,048,5769.7315.211.56311
    4262,14430.3139.471.3023.112.60
    8131,07250.9159.131.1615.233.89

    Inference Performance Results

    Our results were obtained by running the inference.py script in the PyTorch 20.07 NGC container.

    Throughput is reported in millions of samples per second while latency is reported in seconds.

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

    TF32

    Batch sizeThroughput AvgLatency AvgLatency 90%Latency 95%Latency 99%
    1,0241.670.00060.00060.00070.0007
    4,0966.020.00070.00070.00070.0007
    16,38419.010.00090.00090.00090.0009
    65,53634.910.00190.00190.00190.0019
    262,14444.720.00590.00630.00630.0066
    1,048,57647.220.02220.02300.02320.0237

    FP16

    Batch sizeThroughput AvgLatency AvgLatency 90%Latency 95%Latency 99%
    1,0241.340.00080.00080.00080.0008
    4,0965.230.00080.00080.00080.0008
    16,38417.610.00090.00090.00100.0010
    65,53638.630.00170.00170.00180.0018
    262,14455.360.00470.00490.00500.0051
    1,048,57659.480.01760.01780.01790.0184
    Inference performance: NVIDIA DGX-1 (8x V100 32GB)

    FP32

    Batch sizeThroughput AvgLatency AvgLatency 90%Latency 95%Latency 99%
    1,0240.790.00130.00150.00150.0016
    4,0962.880.00140.00160.00160.0017
    16,3848.380.00200.00210.00210.0024
    65,53616.770.00390.00410.00410.0041
    262,14422.530.01160.01180.01190.0122
    1,048,57625.140.04170.04250.04310.0440

    FP16

    Batch sizeThroughput AvgLatency AvgLatency 90%Latency 95%Latency 99%
    1,0240.690.00150.00170.00170.0018
    4,0962.640.00160.00170.00170.0018
    16,3848.840.00190.00200.00200.0021
    65,53621.430.00310.00320.00320.0032
    262,14433.610.00780.00800.00810.0083
    1,048,57638.830.02700.02760.02770.0286