diff options
| author | Yuren Hao <yurenh2@illinois.edu> | 2026-07-20 00:09:16 -0500 |
|---|---|---|
| committer | Yuren Hao <yurenh2@illinois.edu> | 2026-07-20 00:09:16 -0500 |
| commit | cd296c805a84a76946a5ce8a7ca9fe3b134a5860 (patch) | |
| tree | d29478599f26ac2773bbbceeb59b001b03b24dc9 /ep_run/casc_eq_train.py | |
| parent | 881269f2789011dc01a58c46224c6002aaed69d0 (diff) | |
guards_silent(用户令07-20): 守卫只报不拦(skip全部放行提交,唯一例外=非有限梯度仍跳),证书流程废除;唯一执法=控制器自身折半;判官=用户盯CE; simplev2王冠直发链排plain2后(--guards_silent --kretry 0,无cap/wsync)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014FAPDWQ49M5Ye3NpTndTpn
Diffstat (limited to 'ep_run/casc_eq_train.py')
| -rw-r--r-- | ep_run/casc_eq_train.py | 18 |
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: |
