Skip to content

Commit f8ecb68

Browse files
committed
WIP: gpu utilization
1 parent 4977515 commit f8ecb68

File tree

1 file changed

+9
-25
lines changed

1 file changed

+9
-25
lines changed

cometx/cli/admin_usage_report.py

Lines changed: 9 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -48,27 +48,7 @@
4848
SimpleDocTemplate,
4949
Spacer,
5050
)
51-
52-
try:
53-
from tqdm import tqdm
54-
except ImportError:
55-
# Fallback if tqdm is not available
56-
def tqdm(iterable=None, desc=None, total=None, disable=False):
57-
if iterable is None:
58-
59-
class FakeProgressBar:
60-
def __enter__(self):
61-
return self
62-
63-
def __exit__(self, *args):
64-
pass
65-
66-
def update(self, n=1):
67-
pass
68-
69-
return FakeProgressBar()
70-
return iterable
71-
51+
from tqdm import tqdm
7252

7353
# Suppress matplotlib warnings about non-GUI backend
7454
warnings.filterwarnings("ignore", category=UserWarning, module="matplotlib")
@@ -196,10 +176,14 @@ def generate_experiment_chart(api, workspace, project, debug=False):
196176
metric_data = api.get_metrics_for_chart(experiment_keys, metric_names)
197177
for experiment_key in metric_data:
198178
for metric in metric_data[experiment_key]["metrics"]:
199-
print(metric["metricName"])
200-
print(metric["values"])
201-
print(metric["timestamps"])
202-
print(metric["durations"])
179+
# there is also metric["timestamp"] milliseconds to put into month bin
180+
if metric["metricName"].endswith("_utilization"):
181+
print(
182+
" metric:",
183+
metric["metricName"],
184+
"max utilization:",
185+
max(metric["values"]),
186+
)
203187

204188
# Group experiments by month/year based on startTimeMillis
205189
monthly_counts = defaultdict(int)

0 commit comments

Comments
 (0)