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.6.tar.gz (11.7 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.6-py3-none-any.whl (10.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: fasterbench-0.0.6.tar.gz
  • Upload date:
  • Size: 11.7 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.6.tar.gz
Algorithm Hash digest
SHA256 46b7edea06cb2cdc418343c45d47db362b1543519d1d70f644cf19ce05237243
MD5 50f066b84dd1197411ffae0fb4ab57d4
BLAKE2b-256 1ccea1192cc6b31201c0050b86f731ce8a9fb5c3877240e101e91ee9e920354e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fasterbench-0.0.6-py3-none-any.whl
  • Upload date:
  • Size: 10.8 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.6-py3-none-any.whl
Algorithm Hash digest
SHA256 345b8ad9ca803f8bfa162a8c8cb666a4682387917ea7e42efcf1bb18c302380d
MD5 ae177251e6e3a664cfd20f9dba5e23c9
BLAKE2b-256 5696137d13d4283046cb989a86a06ddc1242d7590d202320c97bdb37cee589d9

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