diff options
| author | Yuren Hao <yurenh2@illinois.edu> | 2026-07-22 01:51:55 -0500 |
|---|---|---|
| committer | Yuren Hao <yurenh2@illinois.edu> | 2026-07-22 01:51:55 -0500 |
| commit | e903c185c471d7149650e3b337669d7b6355e564 (patch) | |
| tree | f843018b041d7da0cb746748fa68d9dc1e53e94b /ep_run | |
| parent | 4cf3811692022eb6f7ba89d5445661d078afce32 (diff) | |
resume NameError修复: bsimp恢复写在GOV定义之前(仅新ckpt含bsimp键时触发,135M DDP3迁移三rank齐炸=开火证书log:656-666); 缓冲变量两行修复,GOV定义后应用
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014FAPDWQ49M5Ye3NpTndTpn
Diffstat (limited to 'ep_run')
| -rw-r--r-- | ep_run/casc_eq_train.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/ep_run/casc_eq_train.py b/ep_run/casc_eq_train.py index 09a0132..74aab93 100644 --- a/ep_run/casc_eq_train.py +++ b/ep_run/casc_eq_train.py @@ -295,7 +295,7 @@ if args.resume: with torch.no_grad(): W_out.copy_(_ck['wout'].to(dev)) if _ck.get('lnf') is not None and not isinstance(ln_f, nn.Identity): ln_f.load_state_dict(_ck['lnf']) start_step = int(_ck.get('step', 0)) - if _ck.get('bsimp') is not None: GOV['bsimp'] = float(_ck['bsimp']) + _bsimp_resume = _ck.get('bsimp') # applied after GOV exists (NameError fix: GOV defined below) print(f'[resume] loaded {args.resume} at step {start_step}', flush=True) if args.bf16: for _m in (tok, pos, blocks): @@ -458,6 +458,8 @@ def dFdtheta(zs, x, y, beta): SIG0 = None BGEN = torch.Generator().manual_seed(args.seed + 990) # separate RNG: sign flips must not shift the data stream GOV = {'K': None, 'bscale': 1.0, 'gema': None, 'drift': 0.0, 'gn': 0.0, 'sig': 0.0} +if args.resume and '_bsimp_resume' in dir() and _bsimp_resume is not None: + GOV['bsimp'] = float(_bsimp_resume) WSNAP = {'p': None, 'o': None} def _clone_state(sd): if torch.is_tensor(sd): return sd.clone() |
