summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ep_run/casc_eq_train.py18
1 files changed, 14 insertions, 4 deletions
diff --git a/ep_run/casc_eq_train.py b/ep_run/casc_eq_train.py
index b378c07..c77b92c 100644
--- a/ep_run/casc_eq_train.py
+++ b/ep_run/casc_eq_train.py
@@ -68,6 +68,11 @@ ap.add_argument('--drift_adapt', type=float, default=0.0) # >0: adaptive drift
ap.add_argument('--beta_cap_rho', type=float, default=0.0) # >0: LOOP-GAIN CAP on beta — if per-sweep residual
# ratio rho^ exceeds this, bscale *= 0.8 (beta backs off
# under the wall-2 ceiling); recovers x1.02 when rho^ low
+ap.add_argument('--guards_silent', action='store_true') # USER ORDER 07-20: guards REPORT but never
+ # block — no step skips, no kretry escalation
+ # needed, gn/drift pass-through. The only acting
+ # mechanism is the beta controller's own halving
+ # (that's its measurement, not a guard). Judge = CE.
ap.add_argument('--beta_simple', type=float, default=0.0) # >1: the user-spec adaptive beta setter, NOTHING else:
# clean step -> beta *= this (e.g. 1.01, next step);
# illegal step -> the beta_sync halvings PERSIST.
@@ -590,6 +595,9 @@ def ep_step(x, y):
# CODEX FIX: K=8 rescue ran at beta/2^beta_sync — persist those halvings too,
# else the next step jumps straight back to the failed beta (upward bias)
GOV['bsimp'] = GOV.get('bsimp', 1.0) * 0.5 ** args.beta_sync
+ if not ok_retry and args.guards_silent:
+ GOV['skd'] = GOV.get('skd', 0) + 1 # counted for telemetry, but the step COMMITS
+ ok_retry = True
if not ok_retry:
GOV['skd'] = GOV.get('skd', 0) + 1 # drift-guard reject (relaxation non-convergence)
for p in all_params: p.grad = None
@@ -669,8 +677,9 @@ def ep_step(x, y):
gdrift2 = ddp_max_scalar(drift2)
if (not math.isfinite(gdrift2)) or (gdrift2 > 0.5 and not args.noguard):
GOV['skd'] = GOV.get('skd', 0) + 1 # second-pass drift reject -> skip step (synced)
- for p in all_params: p.grad = None
- return free_ce, beta_t, GOV.get('kuse', GOV['K']), False
+ if not args.guards_silent:
+ for p in all_params: p.grad = None
+ return free_ce, beta_t, GOV.get('kuse', GOV['K']), False
E2 = 0.0
for z, o in zip(zpb, lob): E2 = E2 + 0.5 * ((z.detach().float() - o.float()) ** 2).sum()
gsE2 = torch.autograd.grad(E2 / (NBT * b2), all_params, allow_unused=True)
@@ -691,8 +700,9 @@ def ep_step(x, y):
GOV['gn'] = gn
if not math.isfinite(gn) or (gn > 8 * GOV['gema'] and not args.noguard):
GOV['skg'] = GOV.get('skg', 0) + 1 # gn-EMA-guard reject (gradient-magnitude spike)
- for p in all_params: p.grad = None
- return free_ce, beta_t, GOV.get('kuse', GOV['K']), False
+ if not (args.guards_silent and math.isfinite(gn)):
+ for p in all_params: p.grad = None
+ return free_ce, beta_t, GOV.get('kuse', GOV['K']), False
for p, g in zip(all_params, gs):
p.grad = g
if args.beta_simple > 1.0 and _ok0: