item 24 pre-registered: d=1 retry with loop-only band-LoRA r=16 (4.8M params, whole band, k=0 bit-exact); trainer/eval gain --bandlora; smoke-tested train+eval

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Nils
2026-07-16 21:44:01 +02:00
co-authored by Claude Fable 5
parent 7a141948fa
commit fe89820e64
4 changed files with 83 additions and 3 deletions
+14
View File
@@ -36,11 +36,25 @@ def main():
ap.add_argument("--batch", type=int, default=8)
ap.add_argument("--feedforward", action="store_true")
ap.add_argument("--max-new", type=int, default=160)
ap.add_argument("--bandlora", default=None, metavar="LORA_PT",
help="load a lora_*_e*.pt loop-only band-LoRA checkpoint")
args = ap.parse_args()
model, tok = load_model(dtype=torch.bfloat16)
tok.padding_side = "left"
looper = BandLooper(model)
if args.bandlora:
from lora_band import inject_band_lora
ck = torch.load(args.bandlora, map_location="cuda")
scales = {l: 1.0 for l in ck["band"]}
ps = inject_band_lora(looper.tm, ck["band"][0], scales,
rank=ck["rank"])
assert len(ps) == len(ck["tensors"]), (len(ps), len(ck["tensors"]))
for pr, t in zip(ps, ck["tensors"]):
pr.data = t.cuda()
print(f"band-lora loaded: {args.bandlora} "
f"(r={ck['rank']}, layers {ck['band'][0]}-{ck['band'][-1]})",
flush=True)
adapter = MergeAdapter(
d=model.config.get_text_config().hidden_size).cuda()
adapter.load_state_dict(torch.load(args.adapter, map_location="cuda"))