MCPcopy Create free account
hub / github.com/RightNow-AI/autokernel / _get_baseline_throughput

Function _get_baseline_throughput

analysis.py:260–281  ·  view source on GitHub ↗

Determine baseline throughput from the first row in results or from baselines.json.

(df: pd.DataFrame, baselines: dict | None)

Source from the content-addressed store, hash-verified

258
259
260def _get_baseline_throughput(df: pd.DataFrame, baselines: dict | None) -> float | None:
261 """
262 Determine baseline throughput from the first row in results or from
263 baselines.json.
264 """
265 # Try first row
266 if df is not None and len(df) > 0 and "throughput_tflops" in df.columns:
267 first_tp = df.iloc[0]["throughput_tflops"]
268 if pd.notna(first_tp) and float(first_tp) > 0:
269 return float(first_tp)
270
271 # Fallback: baselines.json -- pick the best throughput across configs
272 if baselines:
273 best = 0.0
274 for entry in baselines.values():
275 tp = entry.get("throughput_tflops", 0)
276 if tp > best:
277 best = tp
278 if best > 0:
279 return best
280
281 return None
282
283
284# ---------------------------------------------------------------------------

Callers 3

make_progress_plotFunction · 0.85
print_terminal_summaryFunction · 0.85
generate_reportFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected