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.0.tar.gz (530.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.0-py3-none-any.whl (34.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: nvbenjo-0.1.0.tar.gz
  • Upload date:
  • Size: 530.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","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.0.tar.gz
Algorithm Hash digest
SHA256 384f1ddfbd21f869e35bf18b62e36d150e22b68cdda99dc091bae66d76fc0e03
MD5 fbf58a9ea84f09c8373146af5052b78c
BLAKE2b-256 8c5f86033eeba162efcb810f8d487d1cd0819d517c2daaeffddad464fe5fecdc

See more details on using hashes here.

File details

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

File metadata

  • Download URL: nvbenjo-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 34.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a60a3c809e35da381bb497a665a49231a059efd07c696988390417e8bc8415b5
MD5 44f07f1ba7ceeb39572eaafca1ad1ac6
BLAKE2b-256 2b413ae483d8fa23a3b07916280b5868288a9c6deb9f6b2079b220daea81984c

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