NVIDIA Deep Learning Examples
NVIDIA Deep Learning Examples
Temporal Fusion Transformer for PyTorch
Resource
NVIDIA Deep Learning Examples
NVIDIA Deep Learning Examples
Temporal Fusion Transformer for PyTorch

Temporal Fusion Transformer is a state-of-the-art architecture for interpretable, multi-horizon time-series prediction.

Benchmarking

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

Training performance benchmark

In order to run training benchmarks, use the scripts/benchmark.sh script.

Inference performance benchmark

To benchmark the inference performance on a specific batch size and dataset, run the inference.py script.

Results

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

Training accuracy results

We conducted an extensive hyperparameter search along with stability tests. The presented results are the averages from the hundreds of runs.

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

Our results were obtained by running the train.sh training script in the PyTorch 21.06 NGC container on NVIDIA A100 (8x A100 80GB) GPUs.

DatasetGPUsBatch size / GPUAccuracy - TF32Accuracy - mixed precisionTime to train - TF32Time to train - mixed precisionTime to train speedup (TF32 to mixed precision)
Electricity810240.027 / 0.057 / 0.0290.028 / 0.057 / 0.029216s176s1.227x
Traffic810240.043 / 0.108 / 0.0790.042 / 0.107 / 0.078151s126s1.198x
Training accuracy: NVIDIA DGX-1 (8x V100 16GB)

Our results were obtained by running the train.sh training script in the PyTorch 21.06 NGC container on NVIDIA DGX-1 with (8x V100 16GB) GPUs.

DatasetGPUsBatch size / GPUAccuracy - FP32Accuracy - mixed precisionTime to train - FP32Time to train - mixed precisionTime to train speedup (FP32 to mixed precision)
Electricity810240.028 / 0.057 / 0.0290.027 / 0.057 / 0.029381s261s1.460x
Traffic810240.042 / 0.106 / 0.0760.040 / 0.103 / 0.074256s176s1.455x
Training stability test

In order to get a greater picture of the model's accuracy, we performed a hyperparameter search along with stability tests on 100 random seeds for each configuration. Then, for each benchmark dataset, we have chosen the architecture with the least mean test q-risk. The table below summarizes the best configurations.

Dataset#GPUHidden size#HeadsLocal BSLRGradient clippingDropoutMean q-riskStd q-riskMin q-riskMax q-risk
Electricity8128410241e-30.00.10.11310.00250.10800.1200
Traffic8128410241e-30.00.30.21800.00490.20690.2336

Training performance results

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

Our results were obtained by running the train.sh training script in the PyTorch 21.06 NGC container on NVIDIA A100 (8x A100 80GB) GPUs. Performance numbers (in items/images per second) were averaged over an entire training epoch.

DatasetGPUsBatch size / GPUThroughput - TF32Throughput - mixed precisionThroughput speedup (TF32 - mixed precision)Weak scaling - TF32Weak scaling - mixed precision
Electricity1102410173137031.35x11
Electricity81024805961077611.34x7.92x7.86x
Traffic1102410197137791.35x11
Traffic81024806921079791.34x7.91x7.84x

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

The performance metrics used were items per second.

Training performance: NVIDIA DGX-1 (8x V100 16GB)

Our results were obtained by running the train.sh training script in the PyTorch 21.06 NGC container on NVIDIA DGX-1 with (8x V100 16GB) GPUs. Performance numbers (in items/images per second) were averaged over an entire training epoch.

DatasetGPUsBatch size / GPUThroughput - FP32Throughput - mixed precisionThroughput speedup (FP32 - mixed precision)Weak scaling - FP32Weak scaling - mixed precision
Electricity11024558091481.64x11
Electricity8102443351698551.61x7.77x7.64x
Traffic11024559391941.64x11
Traffic8102443426699831.61x7.76x7.61x

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

The performance metrics used were items per second.

Inference Performance Results

Inference Performance: NVIDIA DGX A100

Our results were obtained by running the inference.py script in the PyTorch 21.12 NGC container on NVIDIA DGX A100. Throughput is measured in items per second and latency is measured in milliseconds. To benchmark the inference performance on a specific batch size and dataset, run the inference.py script.

DatasetGPUsBatch size / GPUThroughput - mixed precision (item/s)Average Latency (ms)Latency p90 (ms)Latency p95 (ms)Latency p99 (ms)
Electricity11144.376.937.007.047.25
Electricity12277.537.217.257.277.48
Electricity14564.377.097.137.157.64
Electricity181399.255.725.715.777.51
Traffic11145.266.886.916.957.60
Traffic12277.977.197.287.307.46
Traffic14563.057.107.147.167.42
Traffic181411.625.675.695.796.21
Inference Performance: NVIDIA DGX-1 V100

Our results were obtained by running the inference.py script in the PyTorch 21.12 NGC container on NVIDIA DGX-1 V100. Throughput is measured in items per second and latency is measured in milliseconds. To benchmark the inference performance on a specific batch size and dataset, run the inference.py script.

DatasetGPUsBatch size / GPUThroughput - mixed precision (item/s)Average Latency (ms)Latency p90 (ms)Latency p95 (ms)Latency p99 (ms)
Electricity1195.6510.4511.3011.9512.13
Electricity12193.1510.3510.8011.4612.16
Electricity14381.0910.4910.7512.2912.41
Electricity18805.499.9310.4110.4810.91
Traffic1196.7210.3410.5311.9912.13
Traffic12192.9310.3710.8011.9712.12
Traffic14379.0010.5510.8811.0911.96
Traffic18859.699.3010.5810.6511.28

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.