throughput 0.0.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- throughput-0.0.1/LICENSE +1 -0
- throughput-0.0.1/PKG-INFO +15 -0
- throughput-0.0.1/README.md +1 -0
- throughput-0.0.1/pyproject.toml +22 -0
- throughput-0.0.1/setup.cfg +4 -0
- throughput-0.0.1/src/throughput/image.py +42 -0
- throughput-0.0.1/src/throughput.egg-info/PKG-INFO +15 -0
- throughput-0.0.1/src/throughput.egg-info/SOURCES.txt +9 -0
- throughput-0.0.1/src/throughput.egg-info/dependency_links.txt +1 -0
- throughput-0.0.1/src/throughput.egg-info/requires.txt +1 -0
- throughput-0.0.1/src/throughput.egg-info/top_level.txt +1 -0
throughput-0.0.1/LICENSE
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Contact Dan Jacobellis
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: throughput
|
|
3
|
+
Version: 0.0.1
|
|
4
|
+
Summary: throughput
|
|
5
|
+
Author-email: Dan Jacobellis <danjacobellis@utexas.edu>
|
|
6
|
+
License-Expression: LicenseRef-Proprietary
|
|
7
|
+
Classifier: Programming Language :: Python :: 3
|
|
8
|
+
Classifier: Operating System :: OS Independent
|
|
9
|
+
Requires-Python: >=3.6
|
|
10
|
+
Description-Content-Type: text/markdown
|
|
11
|
+
License-File: LICENSE
|
|
12
|
+
Requires-Dist: torch
|
|
13
|
+
Dynamic: license-file
|
|
14
|
+
|
|
15
|
+
# compute
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# compute
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=42", "wheel"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "throughput"
|
|
7
|
+
version = "0.0.1"
|
|
8
|
+
description = "throughput"
|
|
9
|
+
authors = [
|
|
10
|
+
{name = "Dan Jacobellis", email = "danjacobellis@utexas.edu"}
|
|
11
|
+
]
|
|
12
|
+
readme = "README.md"
|
|
13
|
+
license = "LicenseRef-Proprietary"
|
|
14
|
+
license-files = ["LICENSE"]
|
|
15
|
+
classifiers = [
|
|
16
|
+
"Programming Language :: Python :: 3",
|
|
17
|
+
"Operating System :: OS Independent"
|
|
18
|
+
]
|
|
19
|
+
dependencies = [
|
|
20
|
+
"torch",
|
|
21
|
+
]
|
|
22
|
+
requires-python = ">=3.6"
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import time
|
|
2
|
+
from contextlib import contextmanager
|
|
3
|
+
from collections import defaultdict
|
|
4
|
+
|
|
5
|
+
class WallClock:
|
|
6
|
+
def __init__(self):
|
|
7
|
+
self.timings = defaultdict(list)
|
|
8
|
+
|
|
9
|
+
@contextmanager
|
|
10
|
+
def __call__(self, name):
|
|
11
|
+
t0 = time.perf_counter()
|
|
12
|
+
yield
|
|
13
|
+
elapsed = time.perf_counter() - t0
|
|
14
|
+
self.timings[name].append(elapsed)
|
|
15
|
+
|
|
16
|
+
def mean(self, name):
|
|
17
|
+
times = self.timings[name]
|
|
18
|
+
return sum(times) / len(times) if times else 0.0
|
|
19
|
+
|
|
20
|
+
def total(self, name):
|
|
21
|
+
return sum(self.timings[name])
|
|
22
|
+
|
|
23
|
+
def count(self, name):
|
|
24
|
+
return len(self.timings[name])
|
|
25
|
+
|
|
26
|
+
def reset(self, name=None):
|
|
27
|
+
if name is None:
|
|
28
|
+
self.timings.clear()
|
|
29
|
+
else:
|
|
30
|
+
self.timings[name].clear()
|
|
31
|
+
|
|
32
|
+
def throughput(self, name, pixels=1920*1080):
|
|
33
|
+
"""Returns megapixels per second"""
|
|
34
|
+
mean_time = self.mean(name)
|
|
35
|
+
return pixels * 1e-6 / mean_time if mean_time > 0 else float('inf')
|
|
36
|
+
|
|
37
|
+
def summary(self, pixels=1920*1080):
|
|
38
|
+
for name in self.timings:
|
|
39
|
+
print(f"{name}: mean={self.mean(name)*1000:.2f}ms, "
|
|
40
|
+
f"throughput={self.throughput(name, pixels):.2f} MP/s")
|
|
41
|
+
|
|
42
|
+
wallclock = WallClock()
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: throughput
|
|
3
|
+
Version: 0.0.1
|
|
4
|
+
Summary: throughput
|
|
5
|
+
Author-email: Dan Jacobellis <danjacobellis@utexas.edu>
|
|
6
|
+
License-Expression: LicenseRef-Proprietary
|
|
7
|
+
Classifier: Programming Language :: Python :: 3
|
|
8
|
+
Classifier: Operating System :: OS Independent
|
|
9
|
+
Requires-Python: >=3.6
|
|
10
|
+
Description-Content-Type: text/markdown
|
|
11
|
+
License-File: LICENSE
|
|
12
|
+
Requires-Dist: torch
|
|
13
|
+
Dynamic: license-file
|
|
14
|
+
|
|
15
|
+
# compute
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
torch
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
throughput
|