mirror of
https://github.com/wassname/evil_MoE.git
synced 2026-07-17 11:27:23 +08:00
reorg: out/ sorted by datatype (vhack/ pools/ runs/ vhack_grads/ figs/)
Code writes+reads the new scheme; migrate_out_dirs.py moved 225 loose artifacts (0 left at top level). Per-run checkpoints+rollouts now group under runs/<ts>_<run_id>/ as train.safetensors/rollouts.jsonl. Figures land in out/figs/ with a stable docs/figs/<name>.png symlink (figs.link_latest). justfile also gains run-cell REFRESH param (online-erasure arm). Smoke + smoke-vanilla + results all green on new paths. Requeue manifest preserves the why/resolve labels that pueue reset wiped. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
4fb7b59548
commit
4621488cc0
@@ -45,6 +45,8 @@ import matplotlib.pyplot as plt
|
||||
import numpy as np
|
||||
from loguru import logger
|
||||
|
||||
from projected_grpo.figs import link_latest
|
||||
|
||||
# --- parse -----------------------------------------------------------------
|
||||
|
||||
# Series we plot, by cleaned header name. frac "7/28" -> 0.25; float "+0.264".
|
||||
@@ -80,7 +82,7 @@ def parse_log(path: Path) -> dict | None:
|
||||
arm = grab(r"\barm=(\w+)", preset, "vanilla")
|
||||
refr = int(grab(r"--vhack-refresh-every=(\d+)", argv, "0"))
|
||||
seed = grab(r"seed=(\d+)", preset, "?")
|
||||
vhack = grab(r"v-hack-path=out/(\S+?)\.safetensors", argv, "-")
|
||||
vhack = grab(r"v-hack-path=out/(?:vhack/)?(\S+?)\.safetensors", argv, "-")
|
||||
|
||||
# header line: the one containing both "step" and "hack_s"
|
||||
hdr = next((l for l in txt.splitlines() if "ref_eq" in l and "hack_s" in l), None)
|
||||
@@ -312,7 +314,7 @@ def _gather(paths: list[str]) -> list[Path]:
|
||||
def main() -> None:
|
||||
ap = argparse.ArgumentParser(description=__doc__)
|
||||
ap.add_argument("logs", nargs="+", help="log files, globs, or dirs")
|
||||
ap.add_argument("--out", type=Path, default=Path("out/dynamics.png"))
|
||||
ap.add_argument("--out", type=Path, default=Path("out/figs/dynamics.png"))
|
||||
args = ap.parse_args()
|
||||
files = _gather(args.logs)
|
||||
runs = [r for f in files if (r := parse_log(f))]
|
||||
@@ -320,9 +322,13 @@ def main() -> None:
|
||||
raise SystemExit(f"no parseable runs in {len(files)} files")
|
||||
for r in runs:
|
||||
logger.info(f"{classify(r):16s} seed={r['seed']} steps={len(r['steps'])} {r['vhack']}")
|
||||
args.out.parent.mkdir(parents=True, exist_ok=True)
|
||||
plot(runs, args.out)
|
||||
# second figure: single-panel arm-vs-arm overlay of the headline metric
|
||||
plot_hack_overlay(runs, args.out.with_name(args.out.stem + "_hack_overlay.png"))
|
||||
overlay = args.out.with_name(args.out.stem + "_hack_overlay.png")
|
||||
plot_hack_overlay(runs, overlay)
|
||||
for p in (args.out, overlay):
|
||||
logger.info(f"docs/figs latest -> {link_latest(p)}")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
Reference in New Issue
Block a user