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.2.tar.gz (5.6 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: pytorch-perf-0.0.2.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.2.tar.gz
Algorithm Hash digest
SHA256 0655d13ab913ea186e69a36a0d62cdd9cc6a1e399ea51af851a2452b133dae7b
MD5 3bab61e57c5bb7b8cb609eada2d030fd
BLAKE2b-256 ac27b8c14f755874af3cba8c8dce81c995f9fad234a8ad52558ac42f72ac5e9a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pytorch_perf-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 30935b4767f358c8b94c2dab7836c1a08c542a90e5cc18c4b1874c5c2e28649c
MD5 926160931937d2820e1bffe7ef03e672
BLAKE2b-256 129172a586ad25774ba8d4c31313e5cf30e3a23d3f8fb91752a82f9a06b52335

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