From cd296c805a84a76946a5ce8a7ca9fe3b134a5860 Mon Sep 17 00:00:00 2001 From: Yuren Hao Date: Mon, 20 Jul 2026 00:09:16 -0500 Subject: =?UTF-8?q?guards=5Fsilent(=E7=94=A8=E6=88=B7=E4=BB=A407-20):=20?= =?UTF-8?q?=E5=AE=88=E5=8D=AB=E5=8F=AA=E6=8A=A5=E4=B8=8D=E6=8B=A6(skip?= =?UTF-8?q?=E5=85=A8=E9=83=A8=E6=94=BE=E8=A1=8C=E6=8F=90=E4=BA=A4,?= =?UTF-8?q?=E5=94=AF=E4=B8=80=E4=BE=8B=E5=A4=96=3D=E9=9D=9E=E6=9C=89?= =?UTF-8?q?=E9=99=90=E6=A2=AF=E5=BA=A6=E4=BB=8D=E8=B7=B3),=E8=AF=81?= =?UTF-8?q?=E4=B9=A6=E6=B5=81=E7=A8=8B=E5=BA=9F=E9=99=A4;=E5=94=AF?= =?UTF-8?q?=E4=B8=80=E6=89=A7=E6=B3=95=3D=E6=8E=A7=E5=88=B6=E5=99=A8?= =?UTF-8?q?=E8=87=AA=E8=BA=AB=E6=8A=98=E5=8D=8A;=E5=88=A4=E5=AE=98=3D?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E7=9B=AFCE;=20simplev2=E7=8E=8B=E5=86=A0?= =?UTF-8?q?=E7=9B=B4=E5=8F=91=E9=93=BE=E6=8E=92plain2=E5=90=8E(--guards=5F?= =?UTF-8?q?silent=20--kretry=200,=E6=97=A0cap/wsync)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_014FAPDWQ49M5Ye3NpTndTpn --- ep_run/casc_eq_train.py | 18 ++++++++++++++---- 1 file 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: -- cgit v1.2.3