Models / resnet-18

ResNet-18

The 18-layer residual network for ImageNet-1k: a 7x7 stem, four stages of two residual blocks, and a linear classifier.

11.7M parametersresnetApache-2.0image-classificationvisionconvolutional

NVIDIA H100 80GB HBM3 · median of 10 runs after 3 warm-ups · measured 2026-09-28T18:38:52+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 PyTorch1.77× fasterlatency
  • Linnet, CUDA graphs0.33 mstransformers, compiled0.59 ms
vs torch.onnx, on ONNX Runtime1.02× fasterlatency
  • Linnet, ONNX Runtime f320.64 mstorch.onnx export0.65 ms
vs torch.onnx, behind Triton0.98× slowerlatency
  • Triton, Linnet's ONNX3.18 msTriton, torch.onnx export3.10 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 Server0123mstransformers1.21 mstransformers, compiled0.59 msLinnet, generated PyTorch1.04 msLinnet, inductor0.63 msLinnet, CUDA graphs0.33 msLinnet, XLA (StableHLO)0.64 msLinnet, XLA (generated JAX)1.10 mstorch.onnx export0.65 msLinnet, ONNX Runtime f320.64 msLinnet, ONNX Runtime f160.53 msLinnet, ONNX Runtime bf161.05 msLinnet, TensorRT f320.27 msLinnet, TensorRT f160.21 msLinnet, TensorRT bf160.45 msTriton, torch.onnx export3.10 msTriton, Linnet's ONNX3.18 msTriton, Linnet Python backend2.76 ms

Throughput

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

PyTorchJAXONNX Runtime and TensorRTTriton Inference Server0200004000060000/stransformers18,541/stransformers, compiled23,490/sLinnet, generated PyTorch18,580/sLinnet, inductor24,100/sLinnet, CUDA graphs25,051/sLinnet, XLA (StableHLO)32,230/sLinnet, XLA (generated JAX)31,053/storch.onnx export15,125/sLinnet, ONNX Runtime f3214,894/sLinnet, ONNX Runtime f1619,847/sLinnet, ONNX Runtime bf1611,198/sLinnet, TensorRT f3236,114/sLinnet, TensorRT f1659,978/sLinnet, TensorRT bf1618,561/sTriton, torch.onnx export1,454/sTriton, Linnet's ONNX1,243/sTriton, Linnet Python backend1,220/s

Load time

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

PyTorchJAXONNX Runtime and TensorRTTriton Inference Server0510stransformers3.95 stransformers, compiled3.80 sLinnet, generated PyTorch0.51 sLinnet, inductor0.63 sLinnet, CUDA graphs0.62 sLinnet, XLA (StableHLO)0.37 sLinnet, XLA (generated JAX)0.43 storch.onnx export11.9 sLinnet, ONNX Runtime f320.30 sLinnet, ONNX Runtime f160.29 sLinnet, ONNX Runtime bf160.31 sLinnet, TensorRT f320.29 sLinnet, TensorRT f160.29 sLinnet, TensorRT bf160.33 sTriton, torch.onnx export4.06 sTriton, Linnet's ONNX9.08 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 Server012GiBtransformers0.91 GiBtransformers, compiled0.92 GiBLinnet, generated PyTorch0.91 GiBLinnet, inductor0.86 GiBLinnet, CUDA graphs0.95 GiBLinnet, XLA (StableHLO)0.43 GiBLinnet, XLA (generated JAX)0.50 GiBtorch.onnx export1.28 GiBLinnet, ONNX Runtime f321.28 GiBLinnet, ONNX Runtime f161.05 GiBLinnet, ONNX Runtime bf161.52 GiBLinnet, TensorRT f322.52 GiBLinnet, TensorRT f162.40 GiBLinnet, TensorRT bf162.58 GiBTriton, torch.onnx export1.50 GiBTriton, Linnet's ONNX1.50 GiBTriton, Linnet Python backend2.38 GiB

Every number

MethodLatencyThroughputLoad timePeak GPU memoryAgainst the stack it replacesDistance from referenceNotes
PyTorch
transformers1.21 ms18,541/s3.95 s0.91 GiB0 (the reference)
transformers, compiled0.59 ms23,490/s3.80 s0.92 GiB0.0313
Linnet, generated PyTorch1.04 ms18,580/s0.51 s0.91 GiB0.57× transformers, compiled0
Linnet, inductor0.63 ms24,100/s0.63 s0.86 GiB0.94× transformers, compiled0.0313
Linnet, CUDA graphs0.33 ms25,051/s0.62 s0.95 GiB1.77× transformers, compiled0.0313
JAX
Linnet, XLA (StableHLO)0.64 ms32,230/s0.37 s0.43 GiB0.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.10 ms31,053/s0.43 s0.50 GiB0.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 export0.65 ms15,125/s11.9 s1.28 GiB0.0894the reference model's own ONNX export, f32 like Linnet's;
Linnet, ONNX Runtime f320.64 ms14,894/s0.30 s1.28 GiB1.02× torch.onnx export0.0894f32; ONNX Runtime's CUDA execution provider; first calls build the sessions
Linnet, ONNX Runtime f160.53 ms19,847/s0.29 s1.05 GiB0.102f16; ONNX Runtime's CUDA execution provider; first calls build the sessions
Linnet, ONNX Runtime bf161.05 ms11,198/s0.31 s1.52 GiB0.0313bf16; ONNX Runtime's CUDA execution provider; first calls build the sessions
Linnet, TensorRT f320.27 ms36,114/s0.29 s2.52 GiB0.0895f32; ONNX Runtime's TensorRT execution provider; first calls build the sessions
Linnet, TensorRT f160.21 ms59,978/s0.29 s2.40 GiB0.104f16; ONNX Runtime's TensorRT execution provider; first calls build the sessions
Linnet, TensorRT bf160.45 ms18,561/s0.33 s2.58 GiB0.0313bf16; ONNX Runtime's TensorRT execution provider; first calls build the sessions
Triton Inference Server
Triton, torch.onnx export3.10 ms1,454/s4.06 s1.50 GiB0.0894over HTTP; f32; throughput with 4 requests of batch 32 in flight
Triton, Linnet's ONNX3.18 ms1,243/s9.08 s1.50 GiB0.98× Triton, torch.onnx export0.0894over HTTP; f32; throughput with 4 requests of batch 32 in flight
Triton, Linnet Python backend2.76 ms1,220/s6.02 s2.38 GiB0.0156over HTTP; bf16, CUDA graphs; throughput with 4 requests of batch 32 in flight