Skip to main content

A pytorch perf decorator

Project description

PyTorch Perf

License PyPI Code style: black Colab Demo

Install

pip install -U pytorch-perf

To verify a successful installation:

python -c "from torchperf import info; info.show()"

Usage

import torch
from torchperf import perf, info

info.show()

N = 100
x = torch.rand(N, N, device="cuda")
results = []
repeats = 100

@perf(o=results, n=repeats)
def mul(x, y):
    return x * y

z = mul(x, x)
print(results[:5])
print("avg:", sum(results)/len(results))


@perf(n=repeats)
def mul(x, y):
    return x * y

z = mul(x, x)

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

pytorch-perf-0.0.3.tar.gz (5.6 kB view details)

Uploaded Source

Built Distribution

pytorch_perf-0.0.3-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

File details

Details for the file pytorch-perf-0.0.3.tar.gz.

File metadata

  • Download URL: pytorch-perf-0.0.3.tar.gz
  • Upload date:
  • Size: 5.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.13

File hashes

Hashes for pytorch-perf-0.0.3.tar.gz
Algorithm Hash digest
SHA256 77372c9c008a5c1725c62322cecbb2e58270b54f9787536fa61c01b7d6de0777
MD5 b58680bfbe4205bb923f6b3e897b1938
BLAKE2b-256 3dc0f765a6763cd9a3e13bdfca7ff6459de25175e6da6abcae357ae1a54e51be

See more details on using hashes here.

File details

Details for the file pytorch_perf-0.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for pytorch_perf-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 32c407cee223e93b713bb43878712048e954ca5ea7e09991fa236a60bf940a5c
MD5 8e11cb9992e381ce489ddc7b3eac9535
BLAKE2b-256 f1832a5ee03fa224d124e8ef161e59a3f389ec2b6b1b30545000e64af1172049

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page