‹ Back to Benchmarks

GPU ResNet-50 training: OpenNN vs PyTorch vs TensorFlow

OpenNN trains ResNet-50 at 29,069 images/s in fp32 and 35,097 images/s in bf16 on an NVIDIA GeForce RTX 4080, reaching up to 2.14x the throughput of the compared framework implementations.

This result measures CIFAR-10 geometry and one representative run per cell. It is a throughput benchmark, not an ImageNet-geometry or time-to-accuracy result.

Contents

Introduction

ResNet-50 combines convolution, batch normalization, residual connections, activation functions, and a classifier head. On CIFAR-sized images, individual kernels are short and launch overhead is an important part of the measured training step. This makes the workload useful for comparing the complete optimized framework path rather than only isolated convolution kernels.

Benchmark application

Item Configuration
Network ResNet-50 v1.5 bottleneck
Geometry CIFAR, 32×32 RGB images
Dataset CIFAR-10 training split
Batch 128
Epochs 2
Precisions fp32 and bf16
Metric Training samples per second; higher is better
Timed work Forward + backward + optimizer update

Reference computer

Component Value
CPU Intel Core i9-12900K
GPU NVIDIA GeForce RTX 4080, 16 GB
Operating system Linux 6.17 x86_64
NVIDIA driver 595.71.05
Python 3.12.3
PyTorch 2.13.0+cu130
TensorFlow 2.21.0
OpenNN 9.0.0

Methodology

The canonical harness prepares one CIFAR-10 dataset and invokes each framework alone for the same model, batch, epochs, and precision. Each engine uses its fair optimized path:

  • OpenNN uses GPU-resident image data and CUDA graph execution.
  • PyTorch uses channels-last layout, torch.compile, TF32 policy in fp32, and bf16 autocast.
  • TensorFlow uses XLA and the mixed-bfloat16 policy for bf16.
  • Framework setup and graph compilation are excluded from the reported steady-state throughput.
  • The artifact contains one successful run per engine and precision. A repeated-run variance study remains future work.

The result JSON does not contain a common accuracy or loss target. The comparison therefore supports claims about executed training throughput at a fixed configuration, not convergence or final predictive quality.

Results

ResNet-50 training throughput
Higher is better
RTX 4080 · CIFAR-10 geometry · batch 128
fp32
OpenNN
29.1k img/s
PyTorch
15.3k img/s
TensorFlow
13.6k img/s
bf16
OpenNN
35.1k img/s
PyTorch
19.6k img/s
TensorFlow
18.4k img/s
One controlled run per framework and cell; see the methodology and caveats below.
Precision OpenNN PyTorch TensorFlow OpenNN / PyTorch OpenNN / TensorFlow
fp32 29,069 images/s 15,329 images/s 13,562 images/s 1.896x 2.143x
bf16 35,097 images/s 19,550 images/s 18,389 images/s 1.795x 1.909x

Discussion

OpenNN leads by the widest margin in fp32: 89.6% more throughput than PyTorch and 114.3% more than TensorFlow. The bf16 comparison is closer because all engines benefit from reduced-precision tensor-core execution, but OpenNN remains 79.5% ahead of PyTorch and 90.9% ahead of TensorFlow.

OpenNN itself gains 20.7% moving from fp32 to bf16 for this model and batch. PyTorch gains 27.5% and TensorFlow 35.6%, so reduced precision narrows the relative OpenNN lead while raising absolute throughput for all three engines.

The result is specific to 32×32 CIFAR geometry. At 224×224 ImageNet geometry, convolution arithmetic has a larger share of the total step and these ratios should not be assumed. A separate ImageNet-geometry result is required before making that claim.

Conclusions

  • OpenNN leads both tested precisions on CIFAR-10 geometry.
  • OpenNN reaches 1.90x PyTorch and 2.14x TensorFlow throughput in fp32.
  • OpenNN reaches 1.80x PyTorch and 1.91x TensorFlow throughput in bf16.
  • The result is training throughput, not a time-to-accuracy comparison.

Reproducing

The canonical runner is docs/benchmarks/throughput/resnet50/run_resnet50.py:

python run_resnet50.py --dataset cifar10 --epochs 2 --batch 128 --runs 1 --precision both

The result artifact is docs/benchmarks/results/gpu-resnet50-training-speed-cifar10-20260710T120445Z.json.

References