Something went wrong. Try again.
This repository has no description
Something went wrong. Try again.
123456789101112131415161718192021222324252627#!/usr/bin/env python3"""Report how long each in-training eval actually took, from a run's metrics.jsonl."""
import jsonimport sys
path = sys.argv[1]rows = [json.loads(line) for line in open(path)]train = [r for r in rows if "train/lm_loss" in r]evals = [r for r in rows if "all" in r]
for ev in evals: step = ev["step"] before = [r["time"] for r in train if r["step"] <= step] after = [r["time"] for r in train if r["step"] > step] if not before: continue dur = ev["time"] - max(before) acc = ev["all"] print( f"eval@{step}: {dur/60:.1f} min" f" | exact_acc {float(acc['exact_accuracy'])*100:.1f}% cell_acc {float(acc['accuracy'])*100:.1f}%" f" | q_halt_acc {float(acc['q_halt_accuracy'])*100:.1f}%" ) if after: print(f" training resumed {(min(after) - ev['time'])/60:.1f} min after eval metric written")