diff options
| author | Yuren Hao <yurenh2@illinois.edu> | 2026-07-30 17:48:35 -0500 |
|---|---|---|
| committer | Yuren Hao <yurenh2@illinois.edu> | 2026-07-30 17:48:35 -0500 |
| commit | 96ff889ed214b68142daa0abf00456c733c879c6 (patch) | |
| tree | 8bc6fa1f484e1d62dd65e83ba1c55dc136d5eb8e /ep_run/casc_eq_train.py | |
| parent | ca756df145c132f152f40d10e1d363f34b5ed321 (diff) | |
RESULT 78: read_lin梯度级验证==fp64(fp32下泄漏塌零,读出舍入=全部病因); 附属谱仪:前沿随训练下压+seed轴证'比值决定非层号'+阈值带2-5e-7; 修复入训练路径; CE级仪器终审在飞(预注册~+100%关闭)
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 | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/ep_run/casc_eq_train.py b/ep_run/casc_eq_train.py index 3cb9494..ed164ce 100644 --- a/ep_run/casc_eq_train.py +++ b/ep_run/casc_eq_train.py @@ -699,7 +699,14 @@ def ep_step(x, y): gs = torch.autograd.grad(obj, all_params, allow_unused=True) elif EST == 'single': E = 0.0 - for z, o in zip(zp, last_outs): E = E + 0.5 * ((z.detach().float() - o.float()) ** 2).sum() # fp32 accumulation (bf16-safe; no-op in fp32) + if args.read_lin: + # FP-FLOOR FIX (RESULT 77/78): the read identity z - o = d holds algebraically but not in + # fp32 — (z - o) is a ROUNDED copy of d (components below eps·|o| are erased; the C768 + # top-half leak). The d tensors themselves are full-precision; the linear form -<d,o> has + # the identical theta-derivative and bypasses the rounding. Probe-verified == fp64. + for dl, o in zip(GOV['_last_d'], last_outs): E = E - (dl.detach().float() * o.float()).sum() + else: + for z, o in zip(zp, last_outs): E = E + 0.5 * ((z.detach().float() - o.float()) ** 2).sum() # fp32 accumulation (bf16-safe; no-op in fp32) obj = E / (NBT * beta_t) + obj_loss(readout(zp[-1].detach()).reshape(-1, vocab), y.reshape(-1)) gs = torch.autograd.grad(obj, all_params, allow_unused=True) else: |
