Matthew Ford commited on
Commit
5170824
·
1 Parent(s): 224d843

feat: 3-arm GPU job on corrected labels — morgan/openpom_256/pom_alltags (v2)

Browse files

Extends the A/B GPU job to three arms against empirical_dataset_v10_alltags.jsonl
(corrected fold(objective_targets) pyramid labels + 575-dim alltags_targets).
Uploads pimt_ab_*_v2.pt + frozen_eval_*_v2.json + gpu_run_summary.json.


Former-commit-id: 395cb007b244015ada377bfce5ce61772e1cd146
Former-commit-id: 0b0a66ecc6d05ef42a9c0db15d11e78f57fa7706

Files changed (1) hide show
  1. scripts/hf_gpu_ab_job.py +25 -18
scripts/hf_gpu_ab_job.py CHANGED
@@ -1,12 +1,17 @@
1
  #!/usr/bin/env python3
2
- """HF GPU job: two-arm representation A/B (Morgan vs genuine OpenPOM), longer run.
 
3
 
4
- Pulls fresh source + repaired dataset + genuine-POM assets from HF, trains BOTH
5
- representation arms back-to-back on GPU, runs the preregistered frozen-benchmark
6
- evaluator on each, and uploads checkpoints + eval JSON to the A/B model repo.
 
7
 
8
- Deterministic: fixed seed, molecule-disjoint split, identical corpus/split for
9
- both arms; the ONLY difference is --structural-source (morgan vs openpom_256).
 
 
 
10
  """
11
  from __future__ import annotations
12
 
@@ -36,7 +41,8 @@ BATCH = int(os.environ.get("PINO_BATCH", "32"))
36
  LR = os.environ.get("PINO_LR", "3e-4")
37
  SEED = int(os.environ.get("PINO_SEED", "42"))
38
  TRAIN_RATIO = os.environ.get("PINO_TRAIN_RATIO", "0.85")
39
- DATASET_NAME = "empirical_dataset_v9_plus_wisemoor_clean.repaired.jsonl"
 
40
 
41
 
42
  def log(msg: str) -> None:
@@ -84,10 +90,10 @@ def main() -> int:
84
 
85
  data_path = str(DATASET_DIR / DATASET_NAME)
86
  results = {}
87
- for arm in ("morgan", "openpom_256"):
88
- ckpt_name = f"pimt_ab_{arm}_gpu.pt"
89
  logdir = OUT_DIR / "runs" / arm
90
- log(f"[AB] ===== training arm {arm} ({EPOCHS} epochs) =====")
91
  run([sys.executable, "-m", "pino.train",
92
  "--data", data_path,
93
  "--structural-source", arm,
@@ -101,27 +107,28 @@ def main() -> int:
101
  "--log-dir", str(logdir)])
102
  ckpt = OUT_DIR / ckpt_name
103
  log(f"[AB] ===== frozen-benchmark eval arm {arm} =====")
104
- eval_out = OUT_DIR / f"frozen_eval_{arm}_gpu.json"
105
  run([sys.executable, str(SOURCE_DIR / "scripts" / "evaluate_frozen_benchmarks.py"),
106
  "--checkpoint", str(ckpt),
107
  "--structural-source", arm,
108
- "--arm-label", f"{arm}_gpu",
109
  "--output", str(eval_out)])
110
  results[arm] = {"checkpoint": str(ckpt), "eval": str(eval_out)}
111
 
112
  # Upload everything to the A/B repo.
113
  from huggingface_hub import HfApi
114
  api = HfApi(token=TOKEN)
115
- for arm in ("morgan", "openpom_256"):
116
- api.upload_file(path_or_fileobj=str(OUT_DIR / f"pimt_ab_{arm}_gpu.pt"),
117
- path_in_repo=f"pimt_ab_{arm}_gpu.pt", repo_id=AB_REPO, repo_type="model")
118
- api.upload_file(path_or_fileobj=str(OUT_DIR / f"frozen_eval_{arm}_gpu.json"),
119
- path_in_repo=f"frozen_eval_{arm}_gpu.json", repo_id=AB_REPO, repo_type="model")
120
  log(f"[AB] uploaded {arm} checkpoint + eval")
121
 
122
  summary = {"epochs": EPOCHS, "batch": BATCH, "lr": LR, "seed": SEED,
123
  "train_ratio": TRAIN_RATIO, "device": device, "dataset": DATASET_NAME,
124
- "arms": results, "note": "two-arm representation A/B on HF GPU, longer run"}
 
125
  api.upload_file(path_or_fileobj=json.dumps(summary, indent=2).encode(),
126
  path_in_repo="gpu_run_summary.json", repo_id=AB_REPO, repo_type="model")
127
  log("[AB] DONE")
 
1
  #!/usr/bin/env python3
2
+ """HF GPU job: three-arm representation A/B (Morgan vs genuine OpenPOM vs POM+all-tags),
3
+ retrained on the CORRECTED labels (v10 pyramidfix/alltags dataset).
4
 
5
+ Pulls fresh source + corrected dataset + genuine-POM assets from HF, trains ALL
6
+ THREE representation arms back-to-back on GPU, runs the preregistered
7
+ frozen-benchmark evaluator on each, and uploads checkpoints + eval JSON to the
8
+ A/B model repo.
9
 
10
+ Deterministic: fixed seed, molecule-disjoint split, identical corpus/split for all
11
+ arms; the ONLY difference is --structural-source (morgan | openpom_256 | pom_alltags).
12
+
13
+ Label fix (2026-07-17): the prior pyramid_targets field was degenerate (30%
14
+ base-only). This run uses fold(objective_targets) labels (balanced tiers).
15
  """
16
  from __future__ import annotations
17
 
 
41
  LR = os.environ.get("PINO_LR", "3e-4")
42
  SEED = int(os.environ.get("PINO_SEED", "42"))
43
  TRAIN_RATIO = os.environ.get("PINO_TRAIN_RATIO", "0.85")
44
+ DATASET_NAME = "empirical_dataset_v10_alltags.jsonl"
45
+ ARMS = ("morgan", "openpom_256", "pom_alltags")
46
 
47
 
48
  def log(msg: str) -> None:
 
90
 
91
  data_path = str(DATASET_DIR / DATASET_NAME)
92
  results = {}
93
+ for arm in ARMS:
94
+ ckpt_name = f"pimt_ab_{arm}_v2.pt"
95
  logdir = OUT_DIR / "runs" / arm
96
+ log(f"[AB] ===== training arm {arm} ({EPOCHS} epochs, corrected labels) =====")
97
  run([sys.executable, "-m", "pino.train",
98
  "--data", data_path,
99
  "--structural-source", arm,
 
107
  "--log-dir", str(logdir)])
108
  ckpt = OUT_DIR / ckpt_name
109
  log(f"[AB] ===== frozen-benchmark eval arm {arm} =====")
110
+ eval_out = OUT_DIR / f"frozen_eval_{arm}_v2.json"
111
  run([sys.executable, str(SOURCE_DIR / "scripts" / "evaluate_frozen_benchmarks.py"),
112
  "--checkpoint", str(ckpt),
113
  "--structural-source", arm,
114
+ "--arm-label", f"{arm}_v2",
115
  "--output", str(eval_out)])
116
  results[arm] = {"checkpoint": str(ckpt), "eval": str(eval_out)}
117
 
118
  # Upload everything to the A/B repo.
119
  from huggingface_hub import HfApi
120
  api = HfApi(token=TOKEN)
121
+ for arm in ARMS:
122
+ api.upload_file(path_or_fileobj=str(OUT_DIR / f"pimt_ab_{arm}_v2.pt"),
123
+ path_in_repo=f"pimt_ab_{arm}_v2.pt", repo_id=AB_REPO, repo_type="model")
124
+ api.upload_file(path_or_fileobj=str(OUT_DIR / f"frozen_eval_{arm}_v2.json"),
125
+ path_in_repo=f"frozen_eval_{arm}_v2.json", repo_id=AB_REPO, repo_type="model")
126
  log(f"[AB] uploaded {arm} checkpoint + eval")
127
 
128
  summary = {"epochs": EPOCHS, "batch": BATCH, "lr": LR, "seed": SEED,
129
  "train_ratio": TRAIN_RATIO, "device": device, "dataset": DATASET_NAME,
130
+ "label_fix": "pyramid_targets regenerated as fold(objective_targets); prior field degenerate (30% base-only)",
131
+ "arms": results, "note": "three-arm representation A/B on HF GPU, corrected labels (v2)"}
132
  api.upload_file(path_or_fileobj=json.dumps(summary, indent=2).encode(),
133
  path_in_repo="gpu_run_summary.json", repo_id=AB_REPO, repo_type="model")
134
  log("[AB] DONE")