From a8e0b88d9992f088ca7fa219c70b5843e50afdc3 Mon Sep 17 00:00:00 2001 From: Frank Date: Tue, 25 Aug 2026 16:57:02 -0700 Subject: [PATCH] Parse current llama timing output in ubatch bench --- scripts/bench-ubatch-rocmi4.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/scripts/bench-ubatch-rocmi4.sh b/scripts/bench-ubatch-rocmi4.sh index c97cf9e..004a5b8 100755 --- a/scripts/bench-ubatch-rocmi4.sh +++ b/scripts/bench-ubatch-rocmi4.sh @@ -192,10 +192,12 @@ def grab(arr): g_tps = "" if evals and ct: - # eval time line: "eval time = .. ms for N tokens" - ev = evals[-1].split("= ")[-1] - ms = float(ev.split(" for")[0].strip()) - g_tps = f"{ct / (ms / 1000):.2f}" + # eval timing line: "eval time = .. ms / N tokens (... tokens per second)" + import re + match = re.search(r"eval time =\\s*([0-9.]+) ms", evals[-1]) + if match: + ms = float(match.group(1)) + g_tps = f"{ct / (ms / 1000):.2f}" print(f"== RESULT ubatch={ubatch} run={r} " f"PREFILL={grab(prefill)} GEN_TPS={g_tps} " f"pt={pt} ct={ct} wall={dt:.1f}s")