Models · Classification

FastViT

FastViT (Vasu et al. 2023): a hybrid classifier with reparameterisable token mixing.

Commercial use: yes.

variantinputbackendtime (ms)peak memory (MiB, allocated / reserved)
fastvit_sa24.apple_dist_in1ksynthetic (224x224)original (fp32)
original
portable
kernels
portable + torch.compile
TensorRT fp16
11.9
16.5
6.88
1.39
3.87
0.808
132 / 144
157 / 176
81 / 108
112 / 190
113 / 148
72 (engine)
Details
  • Original code: https://github.com/huggingface/pytorch-image-models at 0df212b369a5
  • Code licence: Apache-2.0 (permissive); files:
  • Weights licence: LicenseRef-Apple-Sample-Code
  • Licence evidence: https://huggingface.co/timm/fastvit_sa24.apple_dist_in1k/blob/0b86f2b98f83274e9f03b6ddbcb3942b84efb839/README.md
  • Training data: ImageNet-1k (ILSVRC 2012 classification)
  • Licence note: The weights are under Apple's sample-code licence (the timm Hugging Face card says only 'license: other'); that licence grants no patent rights.
  • Kernel libraries: cudnn_hacc, fvm_conv, fvm_extra, fvm_mb, fvm_r3
  • Variants: fastvit_sa24.apple_dist_in1k (default of fastvit_sa24)
  • Outputs: logits; label_set: imagenet-1k
  • Input size: fixed 256x256: the input is resized (short side 284) and centre-cropped to it
  • Tested up to (portable, fp16, RTX 5060 Ti 16 GB): fastvit_sa24.apple_dist_in1k 256x256 (0.1 GiB peak allocated, 0.1 reserved)
  • fastvit_sa24.apple_dist_in1k 224x224, first call: portable + torch.compile 9 s (cold Inductor cache), TensorRT fp16 45 s (ONNX + engine).
  • fastvit_sa24.apple_dist_in1k original 224x224: torch.autocast(fp16) around the forward
  • fastvit_sa24.apple_dist_in1k load / first call: original 2.49 s / 1.669 s, portable 0.62 s / 0.17 s, kernels 2.42 s / 0.048 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
fastvit_sa24.apple_dist_in1kImageNet-1k val, 5000 random images, top-1 / top-5 %83.78 / 96.4883.78 / 96.4883.78 / 96.4483.80 / 96.42

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
fastvit_sa24.apple_dist_in1k0.00727 / 0.01865RTX 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