Models / vit-base-patch16-224

ViT-Base/16 224

Google's Vision Transformer for ImageNet-1k classification: 16-pixel patches of a 224-pixel image, 12 layers of width 768.

86.6M parametersvitApache-2.0image-classificationvisionencoder-only

NVIDIA H100 80GB HBM3 · median of 10 runs after 3 warm-ups · measured 2026-09-28T19:01:59+00:00

Linnet 0.1.0, PyTorch 2.14.0, JAX 0.11.2, transformers 5.17.0, diffusers 0.40.0, ONNX Runtime 1.30.0, Python 3.12.3, driver 580.126.09

Linnet against the stack it replaces

Each side in its fastest configuration, on the same GPU and checkpoint. A speed-up is how many times the other's speed; an export is measured against the original checkpoint in the same engine.

vs the reference, in PyTorch2.42× fasterlatency
  • Linnet, CUDA graphs0.81 mstransformers, compiled1.97 ms
vs KerasHub, in JAX5.63× fasterlatency
  • Linnet, XLA (generated JAX)1.00 msKerasHub5.61 ms
vs torch.onnx, on ONNX Runtime1.14× fasterlatency
  • Linnet, ONNX Runtime f322.13 mstorch.onnx export2.43 ms
vs torch.onnx, behind Triton1.02× fasterlatency
  • Triton, Linnet's ONNX3.81 msTriton, torch.onnx export3.87 ms

Each row also carries its distance from reference: the largest absolute difference between its output and transformers (eager)'s on the same input. bf16 outputs differ by rounding (about 0.1 on logits near 16), so a small number is expected; it is there so that a fast wrong answer cannot look like a win.

Latency

ms, lower is better; the best bar is red.

PyTorchJAXONNX Runtime and TensorRTTriton Inference Server024mstransformers2.31 mstransformers, compiled1.97 msLinnet, generated PyTorch2.16 msLinnet, inductor1.68 msLinnet, CUDA graphs0.81 msKerasHub5.61 msLinnet, XLA (StableHLO)1.37 msLinnet, XLA (generated JAX)1.00 mstorch.onnx export2.43 msLinnet, ONNX Runtime f322.13 msLinnet, ONNX Runtime f161.91 msLinnet, ONNX Runtime bf161.76 msLinnet, TensorRT f320.95 msLinnet, TensorRT f160.61 msLinnet, TensorRT bf160.64 msTriton, torch.onnx export3.87 msTriton, Linnet's ONNX3.81 msTriton, Linnet Python backend3.21 ms

Throughput

/s, higher is better; the best bar is red.

PyTorchJAXONNX Runtime and TensorRTTriton Inference Server0500010000/stransformers8,811/stransformers, compiled4,916/sLinnet, generated PyTorch8,215/sLinnet, inductor9,646/sLinnet, CUDA graphs10,007/sKerasHub1,814/sLinnet, XLA (StableHLO)6,835/sLinnet, XLA (generated JAX)7,063/storch.onnx export2,296/sLinnet, ONNX Runtime f322,657/sLinnet, ONNX Runtime f164,406/sLinnet, ONNX Runtime bf164,090/sLinnet, TensorRT f324,340/sLinnet, TensorRT f1610,975/sLinnet, TensorRT bf1610,282/sTriton, torch.onnx export1,391/sTriton, Linnet's ONNX1,241/sTriton, Linnet Python backend1,272/s

Load time

s, lower is better; the best bar is red.

PyTorchJAXONNX Runtime and TensorRTTriton Inference Server051015stransformers9.36 stransformers, compiled3.83 sLinnet, generated PyTorch1.06 sLinnet, inductor1.70 sLinnet, CUDA graphs1.17 sKerasHub5.27 sLinnet, XLA (StableHLO)0.56 sLinnet, XLA (generated JAX)0.51 storch.onnx export17.2 sLinnet, ONNX Runtime f320.30 sLinnet, ONNX Runtime f160.28 sLinnet, ONNX Runtime bf160.29 sLinnet, TensorRT f320.29 sLinnet, TensorRT f160.28 sLinnet, TensorRT bf160.29 sTriton, torch.onnx export10.0 sTriton, Linnet's ONNX16.1 sTriton, Linnet Python backend6.02 s

Peak GPU memory

What the driver reports the process holding at its peak, in GiB; lower is better; the best bar is red.

PyTorchJAXONNX Runtime and TensorRTTriton Inference Server0123GiBtransformers1.04 GiBtransformers, compiled1.14 GiBLinnet, generated PyTorch1.02 GiBLinnet, inductor1.04 GiBLinnet, CUDA graphs1.16 GiBKerasHub0.41 GiBLinnet, XLA (StableHLO)0.63 GiBLinnet, XLA (generated JAX)0.61 GiBtorch.onnx export2.34 GiBLinnet, ONNX Runtime f322.42 GiBLinnet, ONNX Runtime f161.65 GiBLinnet, ONNX Runtime bf161.67 GiBLinnet, TensorRT f323.07 GiBLinnet, TensorRT f162.87 GiBLinnet, TensorRT bf162.87 GiBTriton, torch.onnx export2.38 GiBTriton, Linnet's ONNX2.37 GiBTriton, Linnet Python backend2.81 GiB

Every number

MethodLatencyThroughputLoad timePeak GPU memoryAgainst the stack it replacesDistance from referenceNotes
PyTorch
transformers2.31 ms8,811/s9.36 s1.04 GiB0 (the reference)
transformers, compiled1.97 ms4,916/s3.83 s1.14 GiB0.0234
Linnet, generated PyTorch2.16 ms8,215/s1.06 s1.02 GiB0.91× transformers, compiled0.0313
Linnet, inductor1.68 ms9,646/s1.70 s1.04 GiB1.17× transformers, compiled0.0195
Linnet, CUDA graphs0.81 ms10,007/s1.17 s1.16 GiB2.42× transformers, compiled0.0195
JAX
KerasHub5.61 ms1,814/s5.27 s0.41 GiB0.0625bf16, under jax.jit; ; peak memory is JAX's allocator peak; the driver shows its pool, which grows in whole regions
Linnet, XLA (StableHLO)1.37 ms6,835/s0.56 s0.63 GiB4.09× KerasHub0.0313bf16, like the torch rows; peak memory is JAX's allocator peak; the driver shows its pool, which grows in whole regions
Linnet, XLA (generated JAX)1.00 ms7,063/s0.51 s0.61 GiB5.63× KerasHub0.0313bf16, like the torch rows; peak memory is JAX's allocator peak; the driver shows its pool, which grows in whole regions
ONNX Runtime and TensorRT
torch.onnx export2.43 ms2,296/s17.2 s2.34 GiB0.0396the reference model's own ONNX export, f32 like Linnet's;
Linnet, ONNX Runtime f322.13 ms2,657/s0.30 s2.42 GiB1.14× torch.onnx export0.0397f32; ONNX Runtime's CUDA execution provider; first calls build the sessions
Linnet, ONNX Runtime f161.91 ms4,406/s0.28 s1.65 GiB0.041f16; ONNX Runtime's CUDA execution provider; first calls build the sessions
Linnet, ONNX Runtime bf161.76 ms4,090/s0.29 s1.67 GiB0.0313bf16; ONNX Runtime's CUDA execution provider; first calls build the sessions
Linnet, TensorRT f320.95 ms4,340/s0.29 s3.07 GiB0.0403f32; ONNX Runtime's TensorRT execution provider; first calls build the sessions
Linnet, TensorRT f160.61 ms10,975/s0.28 s2.87 GiB0.041f16; ONNX Runtime's TensorRT execution provider; first calls build the sessions
Linnet, TensorRT bf160.64 ms10,282/s0.29 s2.87 GiB0.0313bf16; ONNX Runtime's TensorRT execution provider; first calls build the sessions
Triton Inference Server
Triton, torch.onnx export3.87 ms1,391/s10.0 s2.38 GiB0.0413over HTTP; f32; throughput with 4 requests of batch 32 in flight
Triton, Linnet's ONNX3.81 ms1,241/s16.1 s2.37 GiB1.02× Triton, torch.onnx export0.0413over HTTP; f32; throughput with 4 requests of batch 32 in flight
Triton, Linnet Python backend3.21 ms1,272/s6.02 s2.81 GiB0.0313over HTTP; bf16, CUDA graphs; throughput with 4 requests of batch 32 in flight