refactor: drop verbose route2 refresh log line, fold overlap into compact refr column

The per-refresh logger.info was noise (one line per refresh @every-2-5 steps).
The refr column already marks the refresh; for act-mask it now carries the
basis-overlap (mean |cos| old-vs-new v_act). grad-mask keeps a bare marker.

Co-Authored-By: Claudypoo <288921227+claudypoo@users.noreply.github.com>
This commit is contained in:
wassname
2026-06-01 01:08:55 +00:00
co-authored by Claudypoo
parent 8ef78f6d14
commit bb778d3cc6
+5 -10
View File
@@ -1651,16 +1651,11 @@ def main(cfg: Config) -> int:
opt.zero_grad(set_to_none=True) # extract leaves .grad populated
if _was_training:
model.train()
refr = f"route2:{cfg.route2_mask}"
# Announce it -- the route2 refresh was previously silent (only the
# v_hack path logged "refresh@step"), so it looked like the mask never
# refreshed. NOTE: this fires AFTER opt.step(), so if the model is
# already diverging the re-extracted direction is extracted on a broken
# model -- watch lp_t / ppl_t around the refresh step.
_ov_str = f", basis_overlap_with_prev={_act_overlap:.3f}" if cfg.route2_mask == "act" else ""
logger.info(f"route2 {cfg.route2_mask}-mask refreshed@step{step} "
f"({len(wrappers)} modules, quarantine ablated during extract{_ov_str}) "
f"SHOULD: overlap ~1 => stable hack subspace; low => v_act chasing a drifting target")
# No verbose per-refresh log line (it was noise). The compact `refr`
# column marks the refresh and, for act, carries the basis-overlap
# (mean |cos| old-vs-new v_act): ~1 = stable subspace, low = chasing a
# drifting target. grad-mask has no cheap overlap -> bare marker.
refr = f"{_act_overlap:.2f}" if cfg.route2_mask == "act" else "rfr"
if v_hack is not None and do_refresh:
from .extract_vhack_grad import extract_v_hack
if cfg.vhack_pairs_path is not None: