summaryrefslogtreecommitdiff
path: root/ep_run
diff options
context:
space:
mode:
Diffstat (limited to 'ep_run')
-rw-r--r--ep_run/casc_eq_train.py17
1 files changed, 15 insertions, 2 deletions
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