From f302c8a971064c3b22ac9cf252546967f6e62581 Mon Sep 17 00:00:00 2001 From: Yuren Hao Date: Sun, 19 Jul 2026 11:01:26 -0500 Subject: =?UTF-8?q?beta=5Fsimple(=E7=94=A8=E6=88=B7=E8=A7=84=E6=A0=BC,?= =?UTF-8?q?=E5=A4=8D=E6=9D=82=E6=9C=BA=E6=9E=84=E5=85=A8=E6=8B=86):=20?= =?UTF-8?q?=CE=B2=3D=E8=B5=B7=E5=A7=8B=C3=97bsimp,=E5=B9=B2=E5=87=80?= =?UTF-8?q?=E6=AD=A5=C3=971.01,=E9=9D=9E=E6=B3=95=E6=AD=A5sync=E6=8A=98?= =?UTF-8?q?=E5=8D=8A=E6=8C=81=E4=B9=85;=CF=83=E7=BC=A9=E6=94=BE/floor/bf?= =?UTF-8?q?=5Flate/cap/ride/servo/wsync=E5=85=A8=E9=83=A8=E4=B8=8D?= =?UTF-8?q?=E8=A7=A6=CE=B2;=20=E5=BC=80=E7=81=AB=E8=AF=81=E4=B9=A6PASS(?= =?UTF-8?q?=E8=BF=91=E8=BE=B9=E6=80=81=E9=94=AF=E9=BD=BF0.8-2.4e-3,18?= =?UTF-8?q?=E5=88=80,=E7=88=AC=E5=8D=87=E6=AE=B52.7=C3=97,=E9=9B=B6?= =?UTF-8?q?=E5=B4=A9=E6=BA=83);=20fw72m=5Fsimple=E7=8E=8B=E5=86=A0?= =?UTF-8?q?=E5=B7=B2=E5=8F=91=E5=B0=84?= 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 | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'ep_run') diff --git a/ep_run/casc_eq_train.py b/ep_run/casc_eq_train.py index 3000461..05659f0 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('--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. + # Sole authority = the synchronous measurement; the + # cap/ride/servo machinery is bypassed entirely. ap.add_argument('--beta_servo', type=float, default=0.0) # >0: CEILING-HUGGING SERVO. Meter lit (res above the # v2 absolute gate): deadbeat inversion onto the ceiling # — cap *= servo*cap_rho/rho^ (rho ~= G*beta near the @@ -473,6 +478,9 @@ def ep_step(x, y): GOV['prev_floor'] = fl beta_t = beta_t * GOV.get('cap', 1.0) # wall-2 loop-gain cap OVERRIDES the floor (the ceiling # can sit below the floor near the wall; survival first) + if args.beta_simple > 1.0: + # FULL ownership: no sigma-scaling, no floor/bf_late, no cap — beta = start * measured multiplier + beta_t = args.beta * GOV.get('bsimp', 1.0) if args.bsign_rand and torch.rand((), generator=BGEN).item() < 0.5: beta_t = -beta_t EST = args.est if args.est_late and GOV['step'] >= args.est_late_at: EST = args.est_late @@ -516,7 +524,8 @@ def ep_step(x, y): rho_s = ddp_bcast_scalar(GOV.get('rho') or 0.0) if res_s > 0.02 and rho_s > args.beta_cap_rho: return False return True - if not _legal(gdrift): + _ok0 = _legal(gdrift) + if not _ok0: ok_retry = False if args.wsync > 0 and not args.noguard and WSNAP['p'] is not None: # SYNCHRONOUS WEIGHT-STEP ACCEPTANCE: this state (= last opt.step's result) @@ -556,6 +565,8 @@ def ep_step(x, y): ok_retry = True if args.beta_ride > 1.0: # the failed trial IS the ceiling measurement GOV['cap'] = max(GOV.get('cap', 1.0) * 0.5 ** (_h + 1), args.cap_floor) + if args.beta_simple > 1.0: # PERSIST the halvings (the ceiling just measured) + GOV['bsimp'] = GOV.get('bsimp', 1.0) * 0.5 ** (_h + 1) break if ok_retry: pass @@ -572,10 +583,12 @@ def ep_step(x, y): GOV['skd'] = GOV.get('skd', 0) + 1 # drift-guard reject (relaxation non-convergence) for p in all_params: p.grad = None return free_ce, beta_t, GOV.get('kuse', GOV['K']), False + if args.beta_simple > 1.0 and _ok0: + GOV['bsimp'] = GOV.get('bsimp', 1.0) * args.beta_simple # clean step -> probe upward GOV['drift'] = gdrift if args.drift_adapt > 0: GOV['drift_ema'] = 0.95 * GOV.get('drift_ema', gdrift) + 0.05 * gdrift - if args.beta_cap_rho > 0 and GOV.get('rho') is not None: + if args.beta_cap_rho > 0 and GOV.get('rho') is not None and args.beta_simple <= 1.0: rho_g = ddp_bcast_scalar(GOV['rho']) # rank0's meter rules (identical control on all ranks) res_g = ddp_bcast_scalar(GOV.get('res', 0.0)) # v2: ABSOLUTE-SCALE GATE — rho is only meaningful when the residual is above the noise -- cgit v1.2.3