"""Summarize the concurrent TP sweep: bench-out/tp{1,2,4}-{xserv,llama}.""" import glob import json import os import sys base = sys.argv[1] if len(sys.argv) > 1 else "bench-out" rows = [] for tp in (1, 2, 4): for sysname in ("xserv", "llama"): files = sorted(glob.glob(os.path.join(base, f"tp{tp}-{sysname}", "comparison-*.json"))) if not files: continue d = json.load(open(files[-1])) for r in d["quality"]["summary"]: rows.append((tp, sysname, r["task"], r["n_correct"], r["n_total"], r["accuracy"] * 100, r["mean_completion_tokens"], r["mean_ttft_ms"], r["mean_tpot_ms"], r["wall_s"])) print("%-3s %-7s %-9s %-9s %7s %9s %9s %10s %9s" % ("TP", "engine", "task", "correct", "acc%", "mean_tok", "TTFT_ms", "TPOT_ms", "wall_s")) for (tp, s, task, nc, nt, acc, tok, ttft, tpot, wall) in rows: print("%-3d %-7s %-9s %-9s %6.1f%% %9.0f %9.1f %10.2f %9.0f" % (tp, s, task, f"{nc}/{nt}", acc, tok, ttft, tpot, wall))