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.1.1.tar.gz (532.3 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.1.1-py3-none-any.whl (36.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: nvbenjo-0.1.1.tar.gz
  • Upload date:
  • Size: 532.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.12 {"installer":{"name":"uv","version":"0.11.12","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.1.1.tar.gz
Algorithm Hash digest
SHA256 7a5c65953968549da80b10609fea386310d5c96bc5bc5233b61c11d8a447214d
MD5 ac7da297ae114a104a3051e335720ad8
BLAKE2b-256 2165e84c6cd96804360e83ff4d66b83f4e1e9195466632c99c1293ee8a88fd9d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: nvbenjo-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 36.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.12 {"installer":{"name":"uv","version":"0.11.12","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.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3c62210cce43df2c0deb1cf5b663920eae95639207062b9eeb08dcecec96feeb
MD5 3bd343ffee9877b4269629ce57631eb6
BLAKE2b-256 2031c83d71431a4a278d81bf55fbdc3deb8e6bf0a33bb00995d5e679ece1c658

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