Skip to main content

pytorch dataset wrappers for in-memory caching

Project description

KappaBenchmark

publish

Utilities for benchmarking pytorch applications.

Setup

pip install kappabenchmark

Dataloading

import kappabenchmark as kbm
dataloader = ...
result = kbm.benchmark_dataloading(
    dataloader=dataloader,
    num_epochs=...,
)

predefined benchmarks examples

  • python main_benchmark_grid.py --benchmark imagefolder --root ROOT --num_epochs 5 --batch_size 256 --num_workers 8,16 --num_fetch_workers 0,2,4

register your own benchmark

write a script run_mybenchmark.py

import torch
from torch.utils.data import TensorDataset
from kappabenchmark.dataloading_benchmarks import DATALOADING_BENCHMARKS, DataloadingBenchmark
from kappabenchmark.scripts.main_benchmark_grid import parse_args, main

def mybenchmark(root):
    # root is a (optional) path to a directory which is passed via --root
    # for this toy dataset it is not needed
    return DataloadingBenchmark(dataset=TensorDataset(torch.randn(1024)))


if __name__ == "__main__":
    DATALOADING_BENCHMARKS["mybenchmark"] = mybenchmark
    main(**parse_args())

python run_mybenchmark.py --benchmark mybenchmark [--root ROOT] --num_epochs 5 --batch_size 256 --num_workers 8,16 --num_fetch_workers 0,2,4

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

kappabenchmark-0.0.10.tar.gz (6.3 kB view details)

Uploaded Source

Built Distribution

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

kappabenchmark-0.0.10-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

File details

Details for the file kappabenchmark-0.0.10.tar.gz.

File metadata

  • Download URL: kappabenchmark-0.0.10.tar.gz
  • Upload date:
  • Size: 6.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.1

File hashes

Hashes for kappabenchmark-0.0.10.tar.gz
Algorithm Hash digest
SHA256 a0b121e60fe9e1cf3e1233b2a73908ded7256d40aab590ecd16ae515a32c1087
MD5 2e9f18be55a6be94c75ca24d008a9fad
BLAKE2b-256 1384f59061224d0fbb4f461ea22ccd9f2762045f3962dc395330197cc260729e

See more details on using hashes here.

File details

Details for the file kappabenchmark-0.0.10-py3-none-any.whl.

File metadata

File hashes

Hashes for kappabenchmark-0.0.10-py3-none-any.whl
Algorithm Hash digest
SHA256 cd5e039a546f6bd8301e5f7b4278b0102028bdf931b32e6dcd69f92278c1f715
MD5 71896ba456a6ef2d8722e009209fb11d
BLAKE2b-256 e70fb0fe7d6beb7224f0cab08041420860c607d46c236544d41589818a325fcc

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