diff --git a/prodtests/full-system-test/analyze_gpu_all_tasks.py b/prodtests/full-system-test/analyze_gpu_all_tasks.py new file mode 100644 index 0000000000000..9097d67b75252 --- /dev/null +++ b/prodtests/full-system-test/analyze_gpu_all_tasks.py @@ -0,0 +1,1038 @@ +#!/usr/bin/env python3 + +import argparse +import csv +import math +import re +import warnings +from collections import defaultdict, deque +from dataclasses import dataclass, field +from pathlib import Path + +import numpy as np +import matplotlib.pyplot as plt + +try: + from scipy.optimize import curve_fit, OptimizeWarning + SCIPY_AVAILABLE = True +except ImportError: + SCIPY_AVAILABLE = False + OptimizeWarning = RuntimeWarning + + +# Example usage: +# +# python3 analyze_gpu_all_tasks.py \ +# -l log.log \ +# --unit ms \ +# --duration-source wall +# +# Safer benchmarking usage, keeping short-lived expensive tasks: +# +# python3 analyze_gpu_all_tasks.py \ +# -l log.log \ +# --unit ms \ +# --duration-source wall \ +# --drop-edges 0 \ +# --min-complete 1 \ +# --min-used 1 \ +# --print-all-found-tasks + + +CYAN = "\033[96m" +GREEN = "\033[92m" +MAGENTA = "\033[95m" +YELLOW = "\033[93m" +RED = "\033[91m" +BOLD = "\033[1m" +RESET = "\033[0m" + + +# Robustly matches: +# +# [1572905:its-tracker_t0]: [13:13:15][INFO] Processing timeslice:0, ... +# [1572905:its-tracker_t0]: [13:13:15][INFO] [foo - run] Processing timeslice:0, ... +# [1552948:gpu-reconstruction]: [13:13:15.449723][INFO] Done processing timeslice:0, ... +# +LINE_RE = re.compile( + r"^\[(?P\d+):(?P[^\]]+)\]:\s*" + r"\[(?P