Skip to main content

A library for benchmarking AI models

Project description

fasterbench

PyPI version License: MIT

Overview

fasterbench is a powerful benchmarking library designed to help AI researchers and engineers evaluate PyTorch models across multiple dimensions:

  • Size: Model disk size and parameter count
  • Speed: GPU and CPU latency and throughput
  • Compute: MACs (multiply-accumulate operations)
  • Memory: GPU memory usage
  • Energy: Power consumption and carbon emissions

Whether you’re optimizing for deployment, comparing architectures, or researching model efficiency, fasterbench provides the metrics you need to make informed decisions.

Installation

pip install fasterbench

Quick Start

import torch
from torchvision.models import resnet18
from fasterbench import benchmark

# Load your model
model = resnet18()

# Create sample input
dummy_input = torch.randn(1, 3, 224, 224)

# Run comprehensive benchmarks
results = benchmark(model, dummy_input)

Features

  • All-in-one benchmarking: Get comprehensive metrics with a single function call
  • GPU and CPU performance: Compare inference speed across different hardware
  • Environmental impact: Measure carbon footprint with CodeCarbon integration
  • Memory profiling: Track peak and average GPU memory usage
  • Model comparison: Easily visualize differences between model variants

Example: Comparing Models

from fasterbench import compare_models
from torchvision.models import resnet18, resnet34, resnet50

# Define your models
models = [resnet18(), resnet34(), resnet50()]

# Compare metrics across models
compare_models(models, dls)

Documentation

For more detailed usage examples and API documentation, visit our documentation.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

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

fasterbench-0.0.5.tar.gz (10.6 kB view details)

Uploaded Source

Built Distribution

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

fasterbench-0.0.5-py3-none-any.whl (10.1 kB view details)

Uploaded Python 3

File details

Details for the file fasterbench-0.0.5.tar.gz.

File metadata

  • Download URL: fasterbench-0.0.5.tar.gz
  • Upload date:
  • Size: 10.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.10.15

File hashes

Hashes for fasterbench-0.0.5.tar.gz
Algorithm Hash digest
SHA256 8ae84ea7fe69f85b00f32380ece8e8a52fd6525cd771b3c3ce7d7f324bc97e7b
MD5 fe3650316705983b02172be1bedd1982
BLAKE2b-256 aaae6506e9f9cadb72bf715c722cb58b6f809ebb51a0d4283bad3f22f7ed4690

See more details on using hashes here.

File details

Details for the file fasterbench-0.0.5-py3-none-any.whl.

File metadata

  • Download URL: fasterbench-0.0.5-py3-none-any.whl
  • Upload date:
  • Size: 10.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.10.15

File hashes

Hashes for fasterbench-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 3f284314fff0d26e768978744a7aae0229089cb700a11ff5125c396babb76b2e
MD5 8568019ccba93660f31bcd77563a485c
BLAKE2b-256 c9d6605715bb9c4187ca1822d282ec0918bc0973b4d99db98cce012d7c089466

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