From 63cd19edce4def028f18e092d1af95ff6e0d91f4 Mon Sep 17 00:00:00 2001 From: Yuren Hao Date: Thu, 9 Jul 2026 15:41:54 -0500 Subject: =?UTF-8?q?casc=5Feq=5Ftrain:=20exact=20mode=20(dtop=5Fevery=3D1)?= =?UTF-8?q?=20now=20DEFAULT=20=E2=80=94=20bisection=20showed=20the=20v7=20?= =?UTF-8?q?dedup=20cost=20~4%=20CE=20at=20tuned=20lr;=20fast=20mode=20kept?= =?UTF-8?q?=20as=20opt-in.=20K3=20verdict:=20exact=20equilibrium-EP=202.04?= =?UTF-8?q?81=20vs=20BP=202.053+-0.004=20=3D=20matched-tuning=20PARITY?= 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 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'ep_run') diff --git a/ep_run/casc_eq_train.py b/ep_run/casc_eq_train.py index 38b687e..10206f6 100644 --- a/ep_run/casc_eq_train.py +++ b/ep_run/casc_eq_train.py @@ -24,6 +24,7 @@ ap.add_argument('--untie', action='store_true') # separate readout matri ap.add_argument('--tok_init', type=float, default=0.0) # >0: init tok/pos with this std (GPT-standard 0.02) ap.add_argument('--compile', action='store_true') # torch.compile each block (free speed where supported) ap.add_argument('--sig_every', type=int, default=25) # tok-sigma refresh interval (amortized) +ap.add_argument('--dtop_every', type=int, default=1) # 1 = exact (DEFAULT, BP-parity); 2 = fast mode (~20% cheaper, ~4% CE tax at high lr) ap.add_argument('--gate_every', type=int, default=200) # in-training cos(EP,BP) telemetry args = ap.parse_args() torch.manual_seed(args.seed) @@ -100,7 +101,7 @@ def relax(z0, zs, ins, outs, y, beta, K, x): reuses them instead of re-running a full graphed chain.""" d = [None] * args.L for k in range(K): - if k % 2 == 0 or d[args.L - 1] is None: + if k % args.dtop_every == 0 or d[args.L - 1] is None: zc = zs[args.L - 1].detach().requires_grad_(True) ce = F.cross_entropy(readout(zc).reshape(-1, vocab), y.reshape(-1)) d[args.L - 1] = (-beta * NBT * torch.autograd.grad(ce, zc)[0]).detach() -- cgit v1.2.3