Skip to main content

Nvbenjo is a utility for benchmarking inference of deep learning models on NVIDIA GPUs.

Project description

Nvbenjo

Nox Ruff Tests

Nvbenjo is a utility for benchmarking inference of deep learning models on NVIDIA GPUs. It supports models in Onnx format as well as PyTorch models, including torch.compile and ahead-of-time (AOT) compiled models. Nvbenjo generates comprehensive benchmark results including:

  • CSV file with all measurement data (latency, throughput, memory usage, etc.)
  • Plots visualizing the benchmark results

Demo

Demo

Installing

pip install nvbenjo

If you need a specific version of PyTorch or want to benchmark Onnx models adapt your install:

pip install torch torchvision --index-url https://download.pytorch.org/whl/cu130
pip install onnx onnxruntime-gpu
pip install nvbenjo

Usage

# Specify models to run in the command line
nvbenjo \
"+nvbenjo.models={\
    efficientnet: {type_or_path: 'torchvision:efficientnet_b0',  shape:['B',3,224,224],  batch_sizes: [16,32]},\
    resnet:       {type_or_path: 'torchvision:wide_resnet101_2', shape: ['B',3,224,224], batch_sizes: [16,32]}\
}"

# or better, specify your own config (or one of the pre-defined config files)
nvbenjo -cn small
nvbenjo -cn="/my/config/path/myconfig.yaml"

# override single arguments of your config
nvbenjo -cn="/my/config/path/myconfig.yaml" nvbenjo.models.mymodel.num_batches=10

# show current config and help
nvbenjo -cn="/my/config/path/myconfig.yaml" --help

Take a look at the Documentation for more information as well as example configurations.

Development

Example using uv:

uv sync --group dev --extra onnx-cpu # or gpu
uv run nvbenjo

# for a quick run
uv run nvbenjo -cn small

# tests
uv run pytest
uv run nox

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nvbenjo-0.2.0.tar.gz (541.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nvbenjo-0.2.0-py3-none-any.whl (41.5 kB view details)

Uploaded Python 3

File details

Details for the file nvbenjo-0.2.0.tar.gz.

File metadata

  • Download URL: nvbenjo-0.2.0.tar.gz
  • Upload date:
  • Size: 541.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.14 {"installer":{"name":"uv","version":"0.11.14","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for nvbenjo-0.2.0.tar.gz
Algorithm Hash digest
SHA256 c84286b0ab8de069bf380d36f185c4663d24a063736cd9815c3e995c4ae0c216
MD5 08fddf45a39cd10c732876a638543787
BLAKE2b-256 81e1957d66820ae34ab7610ffb6d159a521a123406d33cbe5c77752353dbb6a6

See more details on using hashes here.

File details

Details for the file nvbenjo-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: nvbenjo-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 41.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.14 {"installer":{"name":"uv","version":"0.11.14","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for nvbenjo-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b512e22c9ae83b34410948fa705c7b45be50940eb62d0d19f866d9d115aa3fa3
MD5 8f3097f014625a760d93a376e0ce1c14
BLAKE2b-256 fe13691ed41664d14b4a4bd21425a2274b9976d53659a145655172802952948e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page