Models · Classification

ResNet

ResNet (He et al. 2015): the standard residual classifier.

Commercial use: yes.

variantinputbackendtime (ms)peak memory (MiB, allocated / reserved)
resnet18.tv_in1ksynthetic (224x224)original (fp32)
original
portable
kernels
portable + torch.compile
TensorRT fp16
1.91
2.44
1.48
0.459
1.04
0.220
94 / 130
105 / 130
61 / 90
90 / 150
91 / 108
34 (engine)
resnet50.tv2_in1ksynthetic (224x224)original (fp32)
original
portable
kernels
portable + torch.compile
TensorRT fp16
4.74
5.84
3.15
0.826
2.10
0.466
148 / 162
180 / 192
89 / 142
116 / 162
119 / 138
70 (engine)
resnet152.tv2_in1ksynthetic (224x224)original (fp32)
original
portable
kernels
12.8
16.3
8.36
1.83
280 / 288
378 / 390
155 / 186
182 / 266
Details
  • Original code: https://github.com/pytorch/vision at 1f1a920d685d
  • Code licence: BSD-3-Clause (permissive); files:
  • Weights licence: BSD-3-Clause (assumed from code)
  • Licence evidence: https://github.com/pytorch/vision/blob/1f1a920d685d46dfbe187934b785b7ecb7a182f2/LICENSE
  • Training data: ImageNet-1k (ILSVRC 2012 classification)
  • Kernel libraries: cudnn_hacc, fvm_conv, fvm_extra, fvm_mb, fvm_r3
  • Variants: resnet18.tv_in1k (default of resnet18), resnet50.tv2_in1k (default of resnet50), resnet152.tv2_in1k (default of resnet152)
  • Outputs: logits; label_set: imagenet-1k
  • Input size:
    • resnet18.tv_in1k: fixed 224x224: the input is resized (short side 256) and centre-cropped to it
    • resnet50.tv2_in1k, resnet152.tv2_in1k: fixed 224x224: the input is resized (short side 232) and centre-cropped to it
  • Tested up to (portable, fp16, RTX 5060 Ti 16 GB): resnet18.tv_in1k 224x224 (0.1 GiB peak allocated, 0.1 reserved); resnet50.tv2_in1k 224x224 (0.1 GiB peak allocated, 0.1 reserved); resnet152.tv2_in1k 224x224 (0.2 GiB peak allocated, 0.2 reserved)
  • resnet18.tv_in1k 224x224, first call: portable + torch.compile 4 s (cold Inductor cache), TensorRT fp16 14 s (ONNX + engine).
  • resnet50.tv2_in1k 224x224, first call: portable + torch.compile 8 s (cold Inductor cache), TensorRT fp16 24 s (ONNX + engine).
  • resnet18.tv_in1k original 224x224: torch.autocast(fp16) around the forward
  • resnet50.tv2_in1k original 224x224: torch.autocast(fp16) around the forward
  • resnet152.tv2_in1k original 224x224: torch.autocast(fp16) around the forward
  • resnet18.tv_in1k load / first call: original 0.27 s / 0.004 s, portable 0.07 s / 0.003 s, kernels 1.48 s / 0.041 s
  • resnet50.tv2_in1k load / first call: original 0.51 s / 0.007 s, portable 0.16 s / 0.003 s, kernels 1.48 s / 0.041 s
  • resnet152.tv2_in1k load / first call: original 2.34 s / 0.243 s, portable 0.43 s / 0.024 s, kernels 1.88 s / 0.041 s
  • Protocol, median of 9 after 3 warm-up, uint8 CUDA input (synthetic for bench_inputs sizes), card defaults; gc before each load; peak = max over the first call and the timed calls

Measured

fastforks: the model's own resize / crop on the GPU; original: the library's pretrained loader and its PIL eval transform. Original = the original code named under Details, same checkpoint and protocol.

variantdatasetoriginal fp32original fp16portablekernelsnote
resnet18.tv_in1kImageNet-1k val, 5000 random images, top-1 / top-5 %70.80 / 89.1870.80 / 89.1870.82 / 89.1270.74 / 89.10
resnet50.tv2_in1kImageNet-1k val, 5000 random images, top-1 / top-5 %82.02 / 95.3282.00 / 95.3081.94 / 95.3081.96 / 95.34
resnet152.tv2_in1kImageNet-1k val, 5000 random images, top-1 / top-5 %82.90 / 96.2282.90 / 96.2082.90 / 96.2482.90 / 96.24

Measured on NVIDIA GeForce RTX 5060 Ti, torch 2.14.1+cu130, fastforks 939adfe8, 2026-11-06.

Parity

CPU, float32: max |diff| <= 0.002 vs the original. GPU, float16 (the default), portable and kernels: mean |diff| <= 0.02 and p99 <= 0.08 (absolute error of the output logits).

variantkernels error vs original, mean / p99GPU, torchkernels used
resnet18.tv_in1k0.00193 / 0.0071RTX 5060 Ti, torch 2.14.1+cu130cudnn_hacc@cudnn92400, fvm_conv@f1d064e539e1:sm_120, fvm_extra@3208ce525a91:sm_120, fvm_mb@720dd3f29bf7:sm_120, fvm_r3@f54eb890e23c:sm_120
resnet50.tv2_in1k0.00202 / 0.00827RTX 5060 Ti, torch 2.14.1+cu130cudnn_hacc@cudnn92400, fvm_conv@f1d064e539e1:sm_120, fvm_extra@3208ce525a91:sm_120, fvm_mb@720dd3f29bf7:sm_120, fvm_r3@f54eb890e23c:sm_120
resnet152.tv2_in1k0.00122 / 0.00834RTX 5060 Ti, torch 2.14.1+cu130cudnn_hacc@cudnn92400, fvm_conv@f1d064e539e1:sm_120, fvm_extra@3208ce525a91:sm_120, fvm_mb@720dd3f29bf7:sm_120, fvm_r3@f54eb890e23c:sm_120