A pytorch perf decorator
Project description
PyTorch Perf
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file pytorch-perf-0.0.1.dev0.tar.gz
.
File metadata
- Download URL: pytorch-perf-0.0.1.dev0.tar.gz
- Upload date:
- Size: 3.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5857f53c85bc3319fe7dd07cb64a27d1ac28d70b79bbbae2a336042c18e16ccc |
|
MD5 | 9fc29991ec5b5f0e23b84da71ba3531b |
|
BLAKE2b-256 | ba89852c0e0ff6fdef52488a9a97ce05921159651601a16e4e5b3fa94b8d73e9 |
File details
Details for the file pytorch_perf-0.0.1.dev0-py3-none-any.whl
.
File metadata
- Download URL: pytorch_perf-0.0.1.dev0-py3-none-any.whl
- Upload date:
- Size: 3.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ef2cad0360f13b7e3f6071d582f4afcc853e6864bf337604bccfc66772eecb39 |
|
MD5 | 795617bf54c91682e5d1ac29693dedf3 |
|
BLAKE2b-256 | 92c6174541e43480bd34c9d5bb1cfefc5fb8b377eb8c6b87eaee61ea6afd45eb |