Models · Classification

ShuffleNetV2

ShuffleNet V2 (Ma et al. 2018): a classifier built on channel split and shuffle units.

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

Checkpoint shufflenet_v2_x1_0.tv_in1k

Paper 2018 Added in 0.1.0 Evaluated with 0.2.0

Kernels, RTX 5060 Ti 16 GB 0.804 ms 224x224, fp16
vs the faster original 6.0× original fp32: 4.79 ms
Peak memory 55 MiB original: 45 MiB
Accuracy vs original fp32 +0.10 kernels top-1 %, ImageNet-1k val (71.00 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("shufflenet_v2_x1_0.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 shufflenet_v2_x1_0.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 4.79–45 MiB/68 MiB0.00.14
Original fp16torch.autocast(fp16) around the forwardfp16 6.530.73×47 MiB/48 MiB1.11.15
Portable fp32fp32not measured ––––
Portablefp16 3.721.3×39 MiB/48 MiB1.40.36
Kernelsfp16 0.8046.0×55 MiB/76 MiB1.30.11
Portable + torch.compile 1.982.4×71 MiB/88 MiB8 (build)–
TensorRT fp16fp16 0.32915×32 MiBenginenot comparable17 (build)–

Measured on RTX 5060 Ti 16 GB, torch 2.14.1+cu130, 2026-11-03 to 2026-11-15. 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-14Originalfp3212.1 364 MiB processmatches224x224
Portablefp166.87 401 MiB processmatches224x224
Portablefp326.33 374 MiB processmatches224x224
Kernelsfp16not implemented–224x224
NVIDIA L4 CUDA, torch 2.14.1+cu130, 2026-11-07Portablefp166.06 15 MiB/28 MiB–224x224
Kernelsfp161.13 39 MiB/56 MiB–224x224
NVIDIA L40S CUDA, torch 2.14.1+cu130, 2026-11-07Portablefp164.26 15 MiB/28 MiB–224x224
Kernelsfp160.874 39 MiB/56 MiB–224x224
NVIDIA A10 CUDA, torch 2.14.1+cu130, 2026-11-07Portablefp164.36 15 MiB/28 MiB–224x224
Kernelsfp161.22 39 MiB/56 MiB–224x224
NVIDIA A100-SXM4-40GB CUDA, torch 2.14.1+cu130, 2026-11-08Portablefp164.41 15 MiB/28 MiB–224x224
Kernelsfp161.63 39 MiB/56 MiB–224x224
NVIDIA RTX PRO 6000 CUDA, torch 2.14.1+cu130, 2026-11-08Portablefp161.37 39 MiB/48 MiB–224x224
Kernelsfp160.811 87 MiB/116 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

shufflenetv2_x1-5666bf0f80.pth 9.2 MB· hosted on PyTorch

fastforks downloads and checks these files on first use (fastforks download shufflenet_v2_x1_0.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 fp32fp3271.0088.72 reference 5000 0.313
Original fp16fp1671.0688.74 +0.06 5000 0.336
Portable fp32fp3271.0488.78 +0.04 5000 0.642
Portablefp1671.0488.80 +0.04 5000 0.386
Kernelsfp1671.1088.78 +0.10 5000 0.257

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.00435
GPU default dtypes, p99 |diff|≤ 0.08 0.01481

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

Details

ShuffleNet V2 (Ma et al. 2018): channel split and shuffle units.

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 (41 MiB allocated)
Outputs
logits
Checkpoint
arch="shufflenet_v2_x1_0"
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

Limitations

  • At 224 x 224 portable runs 5.0 ms / 39 MB (fp32 original 4.8 ms / 45 MB, fp16 original 6.5 ms / 47 MB); kernels run 0.80 ms but peak 55 MB allocated / 76 MB reserved (original 47 / 45 MB) from cuDNN workspaces of the small convolutions.
Full reference, generated from the repository

ShuffleNet V2 (Ma et al. 2018): a classifier built on channel split and shuffle units.

Commercial use: yes.

variantinputbackendtime (ms)peak memory (MiB, allocated / reserved)
shufflenet_v2_x1_0.tv_in1ksynthetic (224x224)original (fp32)
original
portable
kernels
portable + torch.compile
TensorRT fp16
4.79
6.53
3.72
0.804
1.98
0.329
45 / 68
47 / 48
39 / 48
55 / 76
71 / 88
70 / 80
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: shufflenet_v2_x1_0.tv_in1k (default of shufflenet_v2_x1_0)
  • Outputs: logits; label_set: imagenet-1k
  • Input size: fixed 224x224: the input is resized (short side 256) and centre-cropped to it
  • Tested up to (portable, fp16, RTX 5060 Ti 16 GB): shufflenet_v2_x1_0.tv_in1k 224x224 (0.0 GiB peak allocated, 0.1 reserved)
  • shufflenet_v2_x1_0.tv_in1k 224x224, first call: portable + torch.compile 8 s (cold Inductor cache), TensorRT fp16 17 s (ONNX + engine).
  • shufflenet_v2_x1_0.tv_in1k original 224x224: torch.autocast(fp16) around the forward
  • shufflenet_v2_x1_0.tv_in1k load / first call: original 1.13 s / 1.146 s, portable 1.44 s / 0.36 s, kernels 1.3 s / 0.106 s
  • Protocol, 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
shufflenet_v2_x1_0.tv_in1kImageNet-1k val, 5000 random images, top-1 / top-5 %71.00 / 88.7271.06 / 88.7471.04 / 88.8071.04 / 88.7871.10 / 88.78

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
shufflenet_v2_x1_0.tv_in1k0.00435 / 0.01481RTX 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

Limitations

  • At 224 x 224 portable runs 5.0 ms / 39 MB (fp32 original 4.8 ms / 45 MB, fp16 original 6.5 ms / 47 MB); kernels run 0.80 ms but peak 55 MB allocated / 76 MB reserved (original 47 / 45 MB) from cuDNN workspaces of the small convolutions.

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 90%
  2. tabby 5.0%
  3. tiger cat 4.9%
  4. lynx <0.1%
  5. plastic bag <0.1%
Chelsea the cat, input
Input · 100%

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