Upload make_board_overlay.py with huggingface_hub
Browse files- make_board_overlay.py +45 -0
make_board_overlay.py
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env python3
|
| 2 |
+
"""GoLLeM-v5 vs Glint board (74 models) — where are our models? ARC / WikiText / efficiency vs params."""
|
| 3 |
+
import json, matplotlib
|
| 4 |
+
matplotlib.use("Agg")
|
| 5 |
+
import matplotlib.pyplot as plt
|
| 6 |
+
|
| 7 |
+
D = json.load(open(r"C:/Projekty/Slayer/gollem-v5-en-staging/board_eff_vs_params.json", encoding="utf-8"))
|
| 8 |
+
board, ours = D["board"], D["ours"]
|
| 9 |
+
|
| 10 |
+
def xs(rows, k): return [r["params_M"] for r in rows], [r[k] for r in rows]
|
| 11 |
+
|
| 12 |
+
fig, ax = plt.subplots(1, 3, figsize=(16, 4.8), dpi=130)
|
| 13 |
+
panels = [("arc", "ARC-Easy (higher=better)", False),
|
| 14 |
+
("wiki", "WikiText-2 byte_ppl (lower=better)", True),
|
| 15 |
+
("eff", "Efficiency = score x size-bonus (board rank metric)", False)]
|
| 16 |
+
|
| 17 |
+
for a, (key, title, low_better) in zip(ax, panels):
|
| 18 |
+
bx, by = xs(board, key)
|
| 19 |
+
a.scatter(bx, by, s=42, c="#9aa0a6", alpha=.65, edgecolor="none", label="Glint board (74)")
|
| 20 |
+
for r in ours:
|
| 21 |
+
a.scatter([r["params_M"]], [r[key]], s=300, marker="*", c="#e03131",
|
| 22 |
+
edgecolor="k", zorder=6, label="GoLLeM-v5 (ours)" if r is ours[0] else None)
|
| 23 |
+
tag = "16M" if "16M" in r["name"] else "32M"
|
| 24 |
+
a.annotate(f'{tag}\n{r[key]:.1f}', (r["params_M"], r[key]), textcoords="offset points",
|
| 25 |
+
xytext=(8, 6 if not low_better else -18), fontsize=8, color="#e03131", fontweight="bold")
|
| 26 |
+
a.set_xscale("log"); a.set_xlabel("parameters (M, log)"); a.set_ylabel(key)
|
| 27 |
+
if key == "wiki": a.set_ylim(0, 75) # clip a broken board outlier (~4e6) to match board view
|
| 28 |
+
a.set_title(title, fontsize=10); a.grid(alpha=.3, which="both")
|
| 29 |
+
a.legend(fontsize=8, loc="upper left" if not low_better else "upper right")
|
| 30 |
+
|
| 31 |
+
# efficiency panel: mark frontier + note
|
| 32 |
+
axe = ax[2]
|
| 33 |
+
best = max(board, key=lambda r: r["eff"])
|
| 34 |
+
axe.annotate(f'#1 {best["name"][:16]}\neff {best["eff"]:.1f}', (best["params_M"], best["eff"]),
|
| 35 |
+
textcoords="offset points", xytext=(-10, -28), fontsize=7, color="#1864ab")
|
| 36 |
+
axe.axhline(ours[0]["eff"], color="#e03131", ls=":", lw=.8, alpha=.5)
|
| 37 |
+
axe.annotate("16M > 32M on eff\n(size-bonus penalty > ARC gain)\n-> 16M optimal for THIS bench",
|
| 38 |
+
(0.5, 0.04), xycoords="axes fraction", fontsize=7.5, ha="center", color="#555")
|
| 39 |
+
|
| 40 |
+
fig.suptitle("GoLLeM-v5 vs Glint Tiny-ML board — our models (red stars) among 74 entries", fontsize=13, y=1.03)
|
| 41 |
+
fig.tight_layout()
|
| 42 |
+
out = "C:/Projekty/datasets/gollem-v5-models/board_overlay_v5.png"
|
| 43 |
+
fig.savefig(out, bbox_inches="tight")
|
| 44 |
+
print("saved", out, "| board n=", len(board), "| ours=", [o["name"] for o in ours])
|
| 45 |
+
print("eff range board:", round(min(r["eff"] for r in board),2), "-", round(max(r["eff"] for r in board),2))
|