Models / bert-base-uncased

BERT Base (uncased)

Google's original BERT: 12 post-norm encoder layers of width 768, word/position/token-type embeddings, and the next-sentence-prediction pooler.

109.5M parametersbertApache-2.0fill-masktext-encoderencoder-only

NVIDIA H100 80GB HBM3 · median of 10 runs after 3 warm-ups · measured 2026-09-28T18:07:07+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.27× fasterlatency
  • Linnet, CUDA graphs0.74 mstransformers, compiled1.67 ms
vs KerasHub, in JAX5.05× fasterlatency
  • Linnet, XLA (generated JAX)0.93 msKerasHub4.67 ms
vs torch.onnx, on ONNX Runtime1.36× fasterlatency
  • Linnet, ONNX Runtime f321.52 mstorch.onnx export2.06 ms
vs torch.onnx, behind Triton1.13× fasterlatency
  • Triton, Linnet's ONNX3.24 msTriton, torch.onnx export3.66 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 Server024mstransformers3.60 mstransformers, compiled1.67 msLinnet, generated PyTorch2.79 msLinnet, inductor1.75 msLinnet, CUDA graphs0.74 msKerasHub4.67 msLinnet, XLA (StableHLO)1.56 msLinnet, XLA (generated JAX)0.93 mstorch.onnx export2.06 msLinnet, ONNX Runtime f321.52 msLinnet, ONNX Runtime f161.25 msLinnet, ONNX Runtime bf161.25 msLinnet, TensorRT f320.74 msLinnet, TensorRT f160.53 msLinnet, TensorRT bf160.55 msTriton, torch.onnx export3.66 msTriton, Linnet's ONNX3.24 msTriton, Linnet Python backend2.71 ms

Throughput

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

PyTorchJAXONNX Runtime and TensorRTTriton Inference Server05000100001500020000/stransformers11,043/stransformers, compiled14,663/sLinnet, generated PyTorch13,867/sLinnet, inductor17,002/sLinnet, CUDA graphs17,770/sKerasHub5,159/sLinnet, XLA (StableHLO)13,223/sLinnet, XLA (generated JAX)11,749/storch.onnx export4,943/sLinnet, ONNX Runtime f325,274/sLinnet, ONNX Runtime f169,557/sLinnet, ONNX Runtime bf169,728/sLinnet, TensorRT f329,036/sLinnet, TensorRT f1619,916/sLinnet, TensorRT bf1618,310/sTriton, torch.onnx export579/sTriton, Linnet's ONNX594/sTriton, Linnet Python backend558/s

Load time

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

PyTorchJAXONNX Runtime and TensorRTTriton Inference Server051015stransformers1.44 stransformers, compiled1.63 sLinnet, generated PyTorch1.09 sLinnet, inductor1.11 sLinnet, CUDA graphs1.12 sKerasHub6.31 sLinnet, XLA (StableHLO)0.52 sLinnet, XLA (generated JAX)0.58 storch.onnx export17.5 sLinnet, ONNX Runtime f320.33 sLinnet, ONNX Runtime f160.56 sLinnet, ONNX Runtime bf160.29 sLinnet, TensorRT f320.28 sLinnet, TensorRT f160.28 sLinnet, TensorRT bf160.31 sTriton, torch.onnx export9.10 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.13 GiBtransformers, compiled1.12 GiBLinnet, generated PyTorch1.08 GiBLinnet, inductor1.04 GiBLinnet, CUDA graphs1.12 GiBKerasHub0.51 GiBLinnet, XLA (StableHLO)0.72 GiBLinnet, XLA (generated JAX)0.71 GiBtorch.onnx export3.30 GiBLinnet, ONNX Runtime f322.53 GiBLinnet, ONNX Runtime f161.71 GiBLinnet, ONNX Runtime bf161.71 GiBLinnet, TensorRT f323.21 GiBLinnet, TensorRT f162.97 GiBLinnet, TensorRT bf162.97 GiBTriton, torch.onnx export2.37 GiBTriton, Linnet's ONNX2.37 GiBTriton, Linnet Python backend2.81 GiB

Every number

MethodLatencyThroughputLoad timePeak GPU memoryAgainst the stack it replacesDistance from referenceNotes
PyTorch
transformers3.60 ms11,043/s1.44 s1.13 GiB0 (the reference)unpadded batches of exactly 128 tokens (this card takes no padding mask)
transformers, compiled1.67 ms14,663/s1.63 s1.12 GiB0.109unpadded batches of exactly 128 tokens (this card takes no padding mask)
Linnet, generated PyTorch2.79 ms13,867/s1.09 s1.08 GiB0.60× transformers, compiled0.117unpadded batches of exactly 128 tokens; bf16 on cuda
Linnet, inductor1.75 ms17,002/s1.11 s1.04 GiB0.95× transformers, compiled0.141unpadded batches of exactly 128 tokens; bf16 on cuda
Linnet, CUDA graphs0.74 ms17,770/s1.12 s1.12 GiB2.27× transformers, compiled0.141unpadded batches of exactly 128 tokens; bf16 on cuda
JAX
KerasHub4.67 ms5,159/s6.31 s0.51 GiB0.227bf16, under jax.jit; unpadded batches of exactly 128 tokens; peak memory is JAX's allocator peak; the driver shows its pool, which grows in whole regions
Linnet, XLA (StableHLO)1.56 ms13,223/s0.52 s0.72 GiB3.01× KerasHub0.109unpadded batches of exactly 128 tokens; bf16 on cuda; peak memory is JAX's allocator peak; the driver shows its pool, which grows in whole regions
Linnet, XLA (generated JAX)0.93 ms11,749/s0.58 s0.71 GiB5.05× KerasHub0.25unpadded batches of exactly 128 tokens; bf16 on cuda; peak memory is JAX's allocator peak; the driver shows its pool, which grows in whole regions
ONNX Runtime and TensorRT
torch.onnx export2.06 ms4,943/s17.5 s3.30 GiB0.114the reference model's own ONNX export, f32 like Linnet's; unpadded batches of exactly 128 tokens
Linnet, ONNX Runtime f321.52 ms5,274/s0.33 s2.53 GiB1.36× torch.onnx export0.115f32; ONNX Runtime's CUDA execution provider; first calls build the sessions; unpadded batches of exactly the sequence length
Linnet, ONNX Runtime f161.25 ms9,557/s0.56 s1.71 GiB0.113f16; ONNX Runtime's CUDA execution provider; first calls build the sessions; unpadded batches of exactly the sequence length
Linnet, ONNX Runtime bf161.25 ms9,728/s0.29 s1.71 GiB0.125bf16; ONNX Runtime's CUDA execution provider; first calls build the sessions; unpadded batches of exactly the sequence length
Linnet, TensorRT f320.74 ms9,036/s0.28 s3.21 GiB0.112f32; ONNX Runtime's TensorRT execution provider; first calls build the sessions; unpadded batches of exactly the sequence length
Linnet, TensorRT f160.53 ms19,916/s0.28 s2.97 GiB0.113f16; ONNX Runtime's TensorRT execution provider; first calls build the sessions; unpadded batches of exactly the sequence length
Linnet, TensorRT bf160.55 ms18,310/s0.31 s2.97 GiB0.109bf16; ONNX Runtime's TensorRT execution provider; first calls build the sessions; unpadded batches of exactly the sequence length
Triton Inference Server
Triton, torch.onnx export3.66 ms579/s9.10 s2.37 GiB0.114over HTTP; f32; throughput with 4 requests of batch 64 in flight
Triton, Linnet's ONNX3.24 ms594/s16.1 s2.37 GiB1.13× Triton, torch.onnx export0.115over HTTP; f32; throughput with 4 requests of batch 64 in flight
Triton, Linnet Python backend2.71 ms558/s6.02 s2.81 GiB0.141over HTTP; bf16, CUDA graphs; throughput with 4 requests of batch 64 in flight