Models · Classification

EfficientNet

EfficientNet (Tan and Le 2019): compound-scaled classifiers of different sizes.

stable Fork of pytorch/vision@1f1a920 · backends: portable, kernels

Checkpoint

Paper 2019 Added in 0.1.0 Evaluated with 0.2.0

Kernels, RTX 5060 Ti 16 GB 0.769 ms 224x224, fp16
vs the faster original 7.3× original fp32: 5.64 ms
Peak memory 78 MiB original: 64 MiB
Accuracy vs original fp32 −0.06 kernels top-1 %, ImageNet-1k val (78.62 original)

Use it

pip install fastforks

Lean install with only what this model needs: pip install "fastforks-core[torchvision]"

from fastforks import classification

model = classification.load("efficientnet_b0.tv_in1k")  # kernels on a supported GPU, else portable PyTorch
result = model(image)
result.logits
result.backend  # what ran: mode, device, dtype, kernels
fastforks bench efficientnet_b0.tv_in1k

Times the model on this machine. load(…, mode="portable") or mode="kernels" picks a backend; usage guide.

Speed and memory

Every backend on one GPU (RTX 5060 Ti 16 GB) and the same input, the authors’ code included. Kernels runs fp16. Portable runs fp16 on CUDA.

Input: synthetic, 224x224 (the task’s standard size)

BackenddtypeTime per call (ms)vs original fp32Peak memory
allocated / reserved
Load (s)First call (s)
Original fp32fp32 5.64–64 MiB/78 MiB0.10.18
Original fp16torch.autocast(fp16) around the forwardfp16 7.910.71×64 MiB/84 MiB1.32.86
Portable fp32fp32not measured ––––
Portablefp16 4.981.1×48 MiB/96 MiB0.20.38
Kernelsfp16 0.7697.3×78 MiB/118 MiB1.50.06
Portable + torch.compile 2.882.0×80 MiB/96 MiB9 (build)–
TensorRT fp16fp16 0.53611×38 MiBenginenot comparable26 (build)–

Measured on RTX 5060 Ti 16 GB, torch 2.14.1+cu130, 2026-11-03 to 2026-11-04. First call, 3 warm-up, peak reset, median of 3 rounds x median of 5. Ratios divide two times of this table (same GPU, same input). Original fp16 is the authors’ own precision option, else torch.autocast. torch.compile and TensorRT: build time instead of load time. TensorRT memory (engine, not comparable) is the GPU memory the engine took, read from the driver because TensorRT allocates outside PyTorch, so it can't be compared with the PyTorch peaks of the other rows.

Other devices

DeviceBackenddtypems / callPeak memoryOutput vs referenceInput
Apple M1 Pro 16 GB MPS, torch 2.14.1, 2026-11-14Originalfp3217.9 442 MiB processmatches224x224
Portablefp1613.6 503 MiB processmatches224x224
Portablefp3213.0 463 MiB processmatches224x224
Kernelsfp16not implemented–224x224
NVIDIA L4 CUDA, torch 2.14.1+cu130, 2026-11-07Portablefp168.41 25 MiB/34 MiB–224x224
Kernelsfp161.14 30 MiB/78 MiB–224x224
NVIDIA L40S CUDA, torch 2.14.1+cu130, 2026-11-07Portablefp166.35 25 MiB/34 MiB–224x224
Kernelsfp160.844 30 MiB/78 MiB–224x224
NVIDIA A10 CUDA, torch 2.14.1+cu130, 2026-11-07Portablefp164.63 24 MiB/34 MiB–224x224
Kernelsfp161.09 30 MiB/78 MiB–224x224
NVIDIA A100-SXM4-40GB CUDA, torch 2.14.1+cu130, 2026-11-07Portablefp166.35 24 MiB/34 MiB–224x224
Kernelsfp161.51 30 MiB/78 MiB–224x224
NVIDIA RTX PRO 6000 CUDA, torch 2.14.1+cu130, 2026-11-08Portablefp161.89 48 MiB/54 MiB–224x224
Kernelsfp160.736 78 MiB/118 MiB–224x224

CUDA memory is torch’s peak allocated / reserved; Apple has no such counter, so the Mac rows show the process footprint (weights, Python and torch included). “Output vs reference” compares the device’s output with the stored golden output under the card’s tolerance; – = not checked on that device. Kernels “not implemented” = no kernels for this model on that backend yet: it runs portable there.

Licence and weights

Commercial use allowed

Code
BSD-3-Clause
Weights
BSD-3-Clause (assumed from code)(not stated by the authors; assumed to follow the code) source
Training data
  • weights licence not stated by the original authors; assumed to be the code licence

Our reading of the licences, not legal advice.

Weights

efficientnet_b0_rwightman-7f5810bc.pth 21.4 MB· hosted on PyTorch

fastforks downloads and checks these files on first use (fastforks download efficientnet_b0.tv_in1k).

Accuracy

The test set through the authors’ code and through ours: same checkpoint, same protocol. The distance between the original’s fp32 and fp16 runs is what half precision alone costs; our runs should stay within it.

ImageNet-1k val

5000 random images, top-1 / top-5 %

Rundtypetop-1 % ↑top-5 % ↑Δ top-1 % vs fp32 originalimagesms / image
Original fp32fp3278.6293.86 reference 5000 0.731
Original fp16fp1678.6293.86 ±0.00 5000 0.708
Portable fp32fp3278.5693.86 −0.06 5000 1.33
Portablefp1678.6093.86 −0.02 5000 0.581
Kernelsfp1678.5693.88 −0.06 5000 0.361

fastforks: the model's own resize / crop on the GPU; original: the library's pretrained loader and its PIL eval transform. Original = the authors’ code, same checkpoint and protocol. Measured on original fp32, original fp16: RTX 5060 Ti, torch 2.14.1+cu130, 2026-11-06; portable fp32: RTX 5060 Ti, torch 2.14.1+cu130, fastforks 7c91993, 2026-10-31; portable, kernels: RTX 5060 Ti, torch 2.14.1+cu130, fastforks 939adfe8, 2026-11-06.

Closeness to the original

Beyond the test-set scores: the raw output of ours against the original’s fp32 output on the same input, pixel by pixel. 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).

CheckToleranceMeasured
CPU fp32, max |diff|≤ 0.002 not recorded
GPU default dtypes, mean |diff|≤ 0.02 0.00343
GPU default dtypes, p99 |diff|≤ 0.08 0.01174

Recorded for efficientnet_b0.tv_in1k on RTX 5060 Ti, torch 2.14.1+cu130, 2026-11-04, with these kernels: cudnn_haccfvm_convfvm_extrafvm_mbfvm_r3

Details

EfficientNet (Tan and Le 2019): compound-scaled MBConv networks with squeeze-excite.

Input / output
Input: one RGB image. Output: ImageNet-1k class logits.
Input size
fixed 224x224: the input is resized (short side 256) and centre-cropped to it; tested up to 224x224 (50 MiB allocated)
Outputs
logits
Checkpoint
arch="efficientnet_b0"
CUDA kernels
  • cudnn_haccconvolutions with fp16 accumulation (cuDNN)
  • fvm_convfused convolutions for image classifiers
  • fvm_extrafused transformer row operations (rotary split, SwiGLU with LayerNorm)
  • fvm_mbfused MBConv blocks (MobileNet and EfficientNet families)
  • fvm_r3further fused classifier blocks
Apple (MPS)
fp32, fp16
Full reference, generated from the repository

EfficientNet (Tan and Le 2019): compound-scaled classifiers of different sizes.

Commercial use: yes.

variantinputbackendtime (ms)peak memory (MiB, allocated / reserved)
efficientnet_b0.tv_in1ksynthetic (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
81 / 92
efficientnet_b4.tv_in1ksynthetic (224x224)original (fp32)
original
portable
kernels
portable + torch.compile
TensorRT fp16
11.1
15.7
9.93
2.02
5.39
1.63
156 / 190
147 / 174
89 / 114
90 / 118
124 / 154
157 / 200
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 of efficientnet_b0), efficientnet_b4.tv_in1k (default of efficientnet_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 it
    • efficientnet_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_in1k 224x224 (0.0 GiB peak allocated, 0.1 reserved); efficientnet_b4.tv_in1k 380x380 (0.1 GiB peak allocated, 0.1 reserved)
  • efficientnet_b0.tv_in1k 224x224, first call: portable + torch.compile 9 s (cold Inductor cache), TensorRT fp16 26 s (ONNX + engine).
  • efficientnet_b4.tv_in1k 224x224, first call: portable + torch.compile 14 s (cold Inductor cache), TensorRT fp16 35 s (ONNX + engine).
  • efficientnet_b0.tv_in1k original 224x224: torch.autocast(fp16) around the forward
  • efficientnet_b4.tv_in1k original 224x224: torch.autocast(fp16) around the forward
  • efficientnet_b0.tv_in1k load / first call: original 1.25 s / 2.863 s, portable 0.17 s / 0.378 s, kernels 1.53 s / 0.063 s
  • efficientnet_b4.tv_in1k load / first call: original 0.41 s / 1.72 s, portable 1.83 s / 0.948 s, kernels 2.11 s / 0.09 s
  • Protocol, efficientnet_b0.tv_in1k: 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
  • Protocol, efficientnet_b4.tv_in1k: first call, 3 warm-up, peak reset, median of 3 rounds x median of 5

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 fp16portableportable fp32kernelsnote
efficientnet_b0.tv_in1kImageNet-1k val, 5000 random images, top-1 / top-5 %78.62 / 93.8678.62 / 93.8678.60 / 93.8678.56 / 93.8678.56 / 93.88
efficientnet_b4.tv_in1kImageNet-1k val, 5000 random images, top-1 / top-5 %84.04 / 96.8284.02 / 96.8684.02 / 96.8684.00 / 96.8484.02 / 96.86

Measured on portable: NVIDIA GeForce RTX 5060 Ti, torch 2.14.1+cu130, fastforks 939adfe8, 2026-11-06; portable32: NVIDIA GeForce RTX 5060 Ti, torch 2.14.1+cu130, fastforks 7c91993, 2026-10-31; kernels: 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
efficientnet_b0.tv_in1k0.00343 / 0.01174RTX 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
efficientnet_b4.tv_in1k0.00234 / 0.00886RTX 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

Example output

One fixed input through this checkpoint, the same for every model of the task (kernels · float16 · NVIDIA GeForce RTX 5060 Ti).

Input

Top 5

  1. Egyptian cat 57%
  2. tiger cat 25%
  3. tabby 13%
  4. lynx 0.2%
  5. swab <0.1%
Chelsea the cat, input
Input · 100%

Input: Chelsea the cat, Stéfan van der Walt (CC0).