Skip to content

Benchmarking

Measuring system performance.

Throughput

Measure images per second.

\text{Throughput} = \frac{\text{Batch Size} \times \text{Batches}}{\text{Time (s)}}

Profiling

Use PyTorch Profiler to identify bottlenecks.

with torch.profiler.profile(...) as prof:
    model(input)
print(prof.key_averages().table())

See Performance Architecture for optimization tips.