EfficientNet
EfficientNet (Tan and Le 2019): compound-scaled classifiers of different sizes.
Commercial use: yes.
| variant | input | backend | time (ms) | peak memory (MiB, allocated / reserved) |
|---|---|---|---|---|
efficientnet_b0.tv_in1k | synthetic (224x224) | original (fp32) original portable kernels portable + torch.compile TensorRT fp16 | 5.64 7.91 4.98 0.769 2.88 0.536 | 64 / 78 64 / 84 48 / 96 78 / 118 80 / 96 38 (engine) |
efficientnet_b4.tv_in1k | synthetic (224x224) | original (fp32) original portable kernels | 11.1 15.7 10.0 2.00 | 156 / 190 147 / 174 89 / 114 111 / 180 |
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:
efficientnet_b0.tv_in1k(default ofefficientnet_b0),efficientnet_b4.tv_in1k(default ofefficientnet_b4) - Outputs: logits; label_set:
imagenet-1k - Input size:
efficientnet_b0.tv_in1k: fixed 224x224: the input is resized (short side 256) and centre-cropped to itefficientnet_b4.tv_in1k: fixed 380x380: the input is resized (short side 384) and centre-cropped to it
- Tested up to (portable, fp16, RTX 5060 Ti 16 GB):
efficientnet_b0.tv_in1k224x224 (0.0 GiB peak allocated, 0.1 reserved);efficientnet_b4.tv_in1k380x380 (0.1 GiB peak allocated, 0.1 reserved) efficientnet_b0.tv_in1k224x224, first call: portable + torch.compile 9 s (cold Inductor cache), TensorRT fp16 26 s (ONNX + engine).efficientnet_b0.tv_in1koriginal 224x224: torch.autocast(fp16) around the forwardefficientnet_b4.tv_in1koriginal 224x224: torch.autocast(fp16) around the forwardefficientnet_b0.tv_in1kload / first call: original 1.25 s / 2.863 s, portable 0.17 s / 0.378 s, kernels 1.53 s / 0.063 sefficientnet_b4.tv_in1kload / first call: original 0.41 s / 1.72 s, portable 0.37 s / 0.061 s, kernels 1.94 s / 0.065 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.
| variant | dataset | original fp32 | original fp16 | portable | kernels | note |
|---|---|---|---|---|---|---|
efficientnet_b0.tv_in1k | ImageNet-1k val, 5000 random images, top-1 / top-5 % | 78.62 / 93.86 | 78.62 / 93.86 | 78.60 / 93.86 | 78.56 / 93.88 | |
efficientnet_b4.tv_in1k | ImageNet-1k val, 5000 random images, top-1 / top-5 % | 84.04 / 96.82 | 84.02 / 96.86 | 84.02 / 96.86 | 84.02 / 96.86 |
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).
| variant | kernels error vs original, mean / p99 | GPU, torch | kernels used |
|---|---|---|---|
efficientnet_b0.tv_in1k | 0.00343 / 0.01174 | RTX 5060 Ti, torch 2.14.1+cu130 | cudnn_hacc@cudnn92400, fvm_conv@f1d064e539e1:sm_120, fvm_extra@3208ce525a91:sm_120, fvm_mb@720dd3f29bf7:sm_120, fvm_r3@f54eb890e23c:sm_120 |
efficientnet_b4.tv_in1k | 0.00234 / 0.00886 | RTX 5060 Ti, torch 2.14.1+cu130 | cudnn_hacc@cudnn92400, fvm_conv@f1d064e539e1:sm_120, fvm_extra@3208ce525a91:sm_120, fvm_mb@720dd3f29bf7:sm_120, fvm_r3@f54eb890e23c:sm_120 |